이전에 모바일 애플리케이션 백엔드로 Azure Mobile App을 사용 중이며 이제는 회사에서 웹 사이트 인터페이스를 개발하도록 요청했으며 현재 모든 사용자가 기존 계정으로 로그인 할 수 있어야합니다.Azure 웹 사이트가 모바일 앱과 다른 사용자 아이디 생성
내베이스 (link to guide)
모두 잘 작동으로 아드리안 방법을 사용하고 있습니다. 모바일 앱과 웹 사이트는 동일한 앱 서비스를 사용합니다. 웹 사이트를 제외하고 인증하는 경우 다른 사용자 ID가
웹 사이트 사용자
{푸른-URL} /. 인증/로그인/페이스 북
(내 경우 페이스 북 & 구글에서) 모바일 앱 비교 생성사용자 ID : XXX
<div class="panel-body">
<a href="/.auth/login/facebook?post_login_redirect_url=/Home" class="btn btn-block btn-social btn-facebook">
<i class="fa fa-facebook"></i> Sign in with Facebook
</a>
</div>
모바일 사용자
/인증/로그인/페이스 북 {푸른-URL을} LoginAsync()를 사용하거나 호출
사용자 ID :. SID : XXX
이것은 내 Startup.cs
public static void ConfigureMobileApp(IAppBuilder app)
{
HttpConfiguration config = new HttpConfiguration();
new MobileAppConfiguration()
.AddTables(
new MobileAppTableConfiguration()
.MapTableControllers()
.AddEntityFramework())
.MapApiControllers()
.AddPushNotifications()
.ApplyTo(config);
// Use Entity Framework Code First to create database tables based on your DbContext
// Database.SetInitializer(new MobileServiceInitializer());
var migrator = new DbMigrator(new Migrations.Configuration());
migrator.Update();
MobileAppSettingsDictionary settings = config.GetMobileAppSettingsProvider().GetMobileAppSettings();
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Account/Login"),
Provider = new CookieAuthenticationProvider
{
OnApplyRedirect = ctx =>
{
if (!IsZumoAuth(ctx.Request))
{
ctx.Response.Redirect(ctx.RedirectUri);
}
}
}
});
if (string.IsNullOrEmpty(settings.HostName))
{
app.Use(typeof(CustomAppServiceAuthenticationMiddleware), app, new AppServiceAuthenticationOptions
//app.UseAppServiceAuthentication(new AppServiceAuthenticationOptions
{
// This middleware is intended to be used locally for debugging. By default, HostName will
// only have a value when running in an App Service application.
SigningKey = ConfigurationManager.AppSettings["SigningKey"],
ValidAudiences = new[] { ConfigurationManager.AppSettings["ValidAudience"] },
ValidIssuers = new[] { ConfigurationManager.AppSettings["ValidIssuer"] },
TokenHandler = config.GetAppServiceTokenHandler()
});
}
app.UseWebApi(config);
}
내가 빠뜨릴만한 것들이 있습니까?