我跟着链接https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-how-to-configure-facebook-authentication设置了Facebook登录。URL阻止:此重定向失败,因为重定向URI未在应用的客户端OAuth设置中列入白名单?
在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;
但是,它只是显示下面的消息框与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)
我试图使用提琴手和我的网络包似乎不同。它发布'POST https://myapp.azurewebsites.net/Account/ExternalLogin?ReturnUrl=%2Fevent HTTP/1.1',然后隧道到'CONNECT 2-edge-chat.facebook.com:443 HTTP/1.0',然后' GET https://2-edge-chat.facebook.com/pull?channel = p_100000343225510&seq = 0&partition = -2&clientid = .....'? – ca9163d9
另一次我得到'GET https://www.facebook.com/dialog/oauth?response_type = code&client_id = 365322087148601&redirect_uri = https%3A%2F%2Fmyapp.azurewebsites.net%2Fsignin-facebook&scope =&state = 3hmmvp23P8PQvmH78BtKA .... '。 – ca9163d9
清除并在“有效的OAuth重定向URI”中添加了“https:// myapp.azurewebsites.net/signin-facebook”。错误消失了。但是,它不会重定向到'/ event'页面。 – ca9163d9