Asp.net on Azure cannot login facebook? Location: /Account/ExternalLoginCallback?error=access_denied

后端 未结 1 1073
别那么骄傲
别那么骄傲 2020-12-22 06:05

I followed the link https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-how-to-configure-facebook-authentication to set up Facebook login.

I

1条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-22 06:34

    I could encounter the same issue, after some searches I found that the facebook graph api did some changes. Here is the detailed info, you could refer to it:

    Facebook Graph API has a force upgrade: Changes from v2.2 to v2.3

    [Oauth Access Token] Format - The response format of https://www.facebook.com/v2.3/oauth/access_token returned when you exchange a code for an access_token now return valid JSON instead of being URL encoded. The new format of this response is {"access_token": {TOKEN}, "token_type":{TYPE}, "expires_in":{TIME}}. We made this update to be compliant with section 5.1 of RFC 6749.

    Since the access_token returned with the JSON instead of the URL encoded, Microsoft.Owin.Security.Facebook prior to 3.1.0 could not handle this change. You need to upgrade Microsoft.Owin.Security.Facebook to 3.1.0 version, or you need to implement the FacebookAuthenticationOptions.BackchannelHttpHandler for a workaround to handle this change, for more details, you could refer to this similar answer.

    UPDATE

    As I known, X-Frame-Options indicates whether or not a browser should be allowed to render a page in a ,