skip to Main Content

I’m using Azure Mobile Apps with the .NET SDK as a backend for my iOS app. The authentication done via Facebook. Yesterday out of nowhere (no code changes either on backend or app) the authentication with Facebook failed. The login inside the iOS client app is done via

self.client?.login(withProvider:"facebook", token: ["access_token" : FBSDKAccessToken.current().tokenString] ){ (user, error) in }

By calling this function I’m getting the following result, on the client.

Error Domain=com.Microsoft.MicrosoftAzureMobile.ErrorDomain Code=-1302 "You do not have permission to view this directory or page."

By inspecting the streaming logs of Azure Mobile Apps, I found out that the backend gets an Unauthorized 401.71 return back from calling the Facebook Graph API.

Streaming Log:

Microsoft.Azure.AppService.Authentication Verbose: 0 : Received request: POST https://XXXXXXXXXX.azurewebsites.net/.auth/login/facebook
'w3wp.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'D:WindowsMicrosoft.NetassemblyGAC_MSILSMDiagnosticsv4.0_4.0.0.0__b77a5c561934e089SMDiagnostics.dll'. Skipped loading symbols.
'w3wp.exe' (CLR v4.0.30319: DefaultDomain): Loaded 'D:WindowsMicrosoft.NetassemblyGAC_MSILSystem.ServiceModel.Internalsv4.0_4.0.0.0__31bf3856ad364e35System.ServiceModel.Internals.dll'. Skipped loading symbols. 
Microsoft.Azure.AppService.Authentication Verbose: 0 : Calling into external HTTP endpoint GET https://graph.facebook.com/oauth/access_token.
Microsoft.Azure.AppService.Authentication Information: 0 : Sending response: 401.71 Unauthorized

I already tried cloning the Mobile App in Azure and creating a new Facebook App, without success.

3

Answers


  1. Chosen as BEST ANSWER

    for other users affected by this issue - I will quote the official answer from the MSDN Thread

    TL;DR Hotfix applied - App Restart Required

    ** UPDATE 3/28/2017 ** We're in the process of rolling out a rapid hotfix for affected apps worldwide. The hotfix mechanism will require you to restart your app backend. You can do this using the Azure Portal, the Azure Management CLI, or the App Service Mobile Companion app for iOS and Android. Once restarted, please verify that your Facebook logins are working again.

    West US: Hotfix applied. Please restart your app. Other Regions: Pending


  2. I have the same problem, it stopped working yesterday without any code change.

    I have tried to call the azure azure facebook authentication from rest client.
    I get the same result as from the app, 401, and no additional information.
    https://appname.azurewebsites.net/.auth/login/facebook
    {
    “access_token”: “token Obtained after athorizing with facebook”,
    }

    I have tried calling the facebook api from a rest client and it works.
    https://graph.facebook.com/oauth/access_token?client_id=APP_ID&client_secret=SECRET_APP_ID&grant_type=fb_exchange_token&fb_exchange_token=ACCESS_TOKEN

    My guess is that they changed something in azure web apps and broke the facebook authentification.

    Please let me know if you find any solution.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search