私はFacebookのログインを設定するためにhttps://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-how-to-configure-facebook-authenticationというリンクをたどりました。 https://developers.facebook.com/appsでURLがブロックされました:リダイレクトURIがアプリのクライアントOAuth設定でホワイトリストに登録されていないため、このリダイレクトに失敗しましたか?
、 "有効なOAuthのは、URIをリダイレクト" しかし、それはまだエラーを取得し、次のURI
https://myapp.azurewebsites.net/.auth/login/facebook/callback
を持っていますか?
URLブロック:このリダイレクトは、リダイレクトURIがアプリのクライアントOAuth設定でホワイトリストに登録されていないため失敗しました。クライアントとウェブの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.
というエラーを受けました。
d:\home\site\wwwroot\Views\Account\_ExternalLoginsListPartial.cshtm
で
@Html.AntiForgeryToken()
の行で
更新: は、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と入力すると、再度ログインページが表示されます。 Azureのアプリケーションサービスでの認証と承認については、この公式tutorialとして
私はフィドラーを使用しようとしました。私のネットワークパッケージは異なって見えます。 '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
"Valid OAuth redirect URIs"の 'https:// myapp.azurewebsites.net/signin-facebook'をクリアして追加しました。エラーはなくなりました。しかし、 '/ event'ページにはリダイレクトされません。 – ca9163d9