【发布时间】:2017-09-09 02:36:43
【问题描述】:
我点击链接 https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-how-to-configure-facebook-authentication 设置 Facebook 登录。
在https://developers.facebook.com/apps 中,“有效的 OAuth 重定向 URI”具有以下 URI
https://myapp.azurewebsites.net/.auth/login/facebook/callback
但是还是报错?
URL 被阻止:此重定向失败,因为重定向 URI 未在应用的客户端 OAuth 设置中列入白名单。确保客户端和 Web OAuth 登录已打开,并将您的所有应用程序域添加为有效的 OAuth 重定向 URI。
更新:
添加了https://myapp.azurewebsites.net/signin-facebook 和https://myapp.azurewebsites.net/.auth/login/facebook/callback。现在网站出现了错误
A claim of type 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier' or 'http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider' was not present on the provided ClaimsIdentity. To enable anti-forgery token support with claims-based authentication, please verify that the configured claims provider is providing both of these claims on the ClaimsIdentity instances it generates. If the configured claims provider instead uses a different claim type as a unique identifier, it can be configured by setting the static property AntiForgeryConfig.UniqueClaimTypeIdentifier.。
在@Html.AntiForgeryToken()的线上d:\home\site\wwwroot\Views\Account\_ExternalLoginsListPartial.cshtm
更新: 在 global.asax 中添加了 followign 行,上面的错误就消失了。
AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimTypes.NameIdentifier;
但是,它只显示以下消息框,其 url 为 https://myapp.azurewebsites.net/.auth/login/done#_=_。
You have successfully signed in
-> RETURN TO THE WEBSITE
单击链接将返回登录屏幕。 https://myapp.azurewebsites.net/(不需要授权)而不是https://myapp.azurewebsites.net/event。输入https://myapp.azurewebsites.net/event 将再次显示登录页面。 (重定向到https://myapp.azurewebsites.net/Account/Login?ReturnUrl=%2Fevent)
【问题讨论】:
标签: facebook azure azure-web-app-service facebook-apps