-1

After the deprecation of the old Facebook API's last month, our Azure app has not been able to authenticate with Facebook. The Azure team has assured me that all of the updates needed for this to work was done on our servers, but still no luck. I have spent countless hours with the Azure support teams as well as their mobile apps developers. In the end, the only thing that we came up with is something is either incorrect in our settings (in our app dashboard), or Facebook is denying the request for some reason.

I have log files, fiddler traces, and other information on the call and subsequent failed response(s).

We have over 150,000 users that have logins for our app, and right now they cannot get in. Please help if anyone has any suggestions.

Message='Result statuscode BadRequest', Id=bbc37b22-9286-4c7d-8f45-806250156405, Category='Client.pvbchak'

This app has worked for over 2 years with no issues using Facebook login. Then all of a sudden after the change late last month it does not work. 404 errors each time.

FYI - our Facebook Dashboard says were using API v2.3, this is why I selected it above. But I am not making any calls that were deprecated with that API. Plus the Facebook authentication with Azure is handled backend and works for countless others.

The exact graph url that fails can be sent upon request.

Please help! Thank you! Last Known Working Date March 26, 2017

Fiddler Trace

2017-04-17T18:16:02 PID[13220] Information Message='Beginning Request: GET hzzps://setellit.azure-mobile.net/login/facebook (AntaresRequestId: 262d45e9-6a45-4af4-bfb8-1c0635a1e921)', Id=1ef13922-d6aa-4f7c-944a-d91002728d06, Category='Service.MessageHandlers'

2017-04-17T18:16:02 PID[13220] Information Message='Request Complete (StatusCode: 401)', Id=1ef13922-d6aa-4f7c-944a-d91002728d06, Category='Service.MessageHandlers'

2017-04-17T18:16:03 PID[13220] Error       Message='request uri hzzps://graph.facebook.com/oauth/access_token?grant_type=authorization_code&code=AQCuxPK8rqgEVuMpVV-BVU7DvMeAj8kLt1uybhaGfAsGjTqT1c8XVsOmXUVAQRnLuhEot8YJh9m9aEMZs36tyPODbXK7mf9-aRK4VB6EegxuVCeXZBA9jMHmjBu2bahkWSvsppsz2XebSbQf1_PhofejkSfih9QRu3w-dKyOSW9jSGCYWu_ID1CL3WeoOsHsRUN6eIr2HajGGwfdIVm8V2Zkp9cvee9IIvJxU9oOx57q8EnHRX1_qa8hE2ImCE3hLyPuZUwvzZrbp_jGpNuONmV6edI5QkzeQOzXzv2wX3rrLsewubqiUgYbqMswmED8YPY&redirect_uri=https:%2F%2Fsetellit.azure-mobile.net%2Fsignin-facebook&client_id=1379963935653653&client_secret=xxxxxxx', Id=bbc37b22-9286-4c7d-8f45-806250156405, Category='Client.pvbchak'

2017-04-17T18:16:03 PID[13220] Error       Message='Result statuscode BadRequest', Id=bbc37b22-9286-4c7d-8f45-806250156405, Category='Client.pvbchak'

2017-04-17T18:16:03 PID[13220] Error       Message='request uri hzzps://graph.facebook.com/me?access_token=', Id=51b0e6ec-fb3e-415f-8642-44c153534640, Category='Client.pvbchak'

2017-04-17T18:16:03 PID[13220] Error       Message='Result statuscode BadRequest', Id=51b0e6ec-fb3e-415f-8642-44c153534640, Category='Client.pvbchak'

2017-04-17T18:16:03 PID[13220] Error       Message='Authentication failed', Exception=System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).

   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()

   at Microsoft.Owin.Security.Facebook.FacebookAuthenticationHandler.d__0.MoveNext(), Id=00000000-0000-0000-0000-000000000000, Category='Microsoft.Owin.Security.Facebook.FacebookAuthenticationMiddleware'

2017-04-17T18:16:03 PID[13220] Information Message='Beginning Request: GET hzzps://setellit.azure-mobile.net/login/facebook?error=access_denied (AntaresRequestId: 4a542c6c-81b3-4038-995b-c1842d56b577)', Id=06fe970a-7dc9-4875-ad03-9becc4a5e672, Category='Service.MessageHandlers'

  • Are you able to repro the issue locally? If so, can you capture a Fiddler trace which shows the exact HTTP 400 error response that is coming from Facebook during login? – Chris Gillum Apr 21 '17 at 23:12
  • @ChrisGillum Added trace above. Had to change the urls to hzzp to avoid getting rejected edit. Thx! – Sean Jaeger Apr 22 '17 at 13:53
  • The traces helped a little, but it's not what I was asking for. Do you have a setup which allows you to run your application on a local Windows development machine? If so, you can use Fiddler (http://www.telerik.com/fiddler) to capture easy-to-read network traces both from your browser and from your mobile backend. Having that would allow us to more easily trace exactly where the problem is. The traces above don't show any browser interaction, nor do they show response content, so it's not quite enough information. – Chris Gillum Apr 22 '17 at 22:49

1 Answers1

1

2017-04-17T18:16:03 PID[13220] Error Message='request uri hzzps://graph.facebook.com/oauth/access_token?grant_type=authorization_code&code=AQCuxPK8rqgEVuMpVV-BVU7DvMeAj8kLt1uybhaGfAsGjTqT1c8XVsOmXUVAQRnLuhEot8YJh9m9aEMZs36tyPODbXK7mf9-aRK4VB6EegxuVCeXZBA9jMHmjBu2bahkWSvsppsz2XebSbQf1_PhofejkSfih9QRu3w-dKyOSW9jSGCYWu_ID1CL3WeoOsHsRUN6eIr2HajGGwfdIVm8V2Zkp9cvee9IIvJxU9oOx57q8EnHRX1_qa8hE2ImCE3hLyPuZUwvzZrbp_jGpNuONmV6edI5QkzeQOzXzv2wX3rrLsewubqiUgYbqMswmED8YPY&redirect_uri=https:%2F%2Fsetellit.azure-mobile.net%2Fsignin-facebook&client_id=1379963935653653&client_secret=xxxxxxx', Id=bbc37b22-9286-4c7d-8f45-806250156405, Category='Client.pvbchak'

at Microsoft.Owin.Security.Facebook.FacebookAuthenticationHandler.d__0.MoveNext(), Id=00000000-0000-0000-0000-000000000000, Category='Microsoft.Owin.Security.Facebook.FacebookAuthenticationMiddleware'

According to your network traces, I assumed that you are using the Middleware app.UseFacebookAuthentication for authenticating users using Facebook by your mobile back-end code.

Please help! Thank you! Last Known Working Date March 26, 2017

As Facebook Graph API Changelog states that API v2.2 is available until March 25,2017, and facebook did a force upgrade from V2.2 to v2.3, which returns valid JSON instead of being URL encoded when you exchanging the authorization_code for an access_token. For more details, you could refer to Changelog about Changes from v2.2 to v2.3. I assumed that you could try to upgrade Microsoft.Owin.Security.Facebook to 3.1.0 and you could try to invoke https://graph.facebook.com/v2.8/me?access_token={your-access-token} to retrieve the logged user info. Also, there is a similar issue, you could refer to it.

Community
  • 1
  • 1
Bruce Chen
  • 18,207
  • 2
  • 21
  • 35