Firebase-android-sdk: Firebase Auth uses Facebook Graph API v2.12, which is after end-of-life

Created on 6 Aug 2020  ·  17Comments  ·  Source: firebase/firebase-android-sdk

Firebase Android Auth SDK calls Facebook Graph API v2.12, possibly on the backend. This can be learned by inspecting logs in case of an error:

08-05 14:40:31.075 11998 25757 I AuthChimeraService: Error description received from server: INVALID_IDP_RESPONSE : Failed to fetch resource from https://graph.facebook.com/v2.12/me, http status: 400, http response: {"error":{"message":"Unsupported get request.","type":"GraphMethodException","code":100,"fbtrace_id":"A3Gg_KXAn2F_pbLYZtyC4J6"}} [CONTEXT service_id=16 ]

Official Facebook documentation for v2.12 states that it's available until May 5h, 2020.

It means that that version is officially unavailable and the plug may be pulled at any time. As I understand it, this would mean breaking Firebase users depending on Facebook login.

Edit:
Please note that this issue is not about the error itself (which might actually be a client error), but about the fact that Firebase Auth seems to use unsupported Facebook Graph API version, which can be learned by inspecting the error message.

For information about Facebook token expiration, see Facebook documentation on access tokens. For any other client error, search for appropriate documentation.

Edit 2020-08-31:
The Graph API version on Firebase Auth backend seems to have been upgraded to v8.0.
It didn't really help with the error itself, which seems to have been related to Facebook country restrictions. See the comments.

auth internal-bug-filed

Most helpful comment

I managed to solve my problem with the help of Facebook support: I needed to turn off country restrictions (despite my users being in the country selected). Something must've changed about how Facebook country restrictions are applied to Graph API in the last few weeks.

All 17 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Thanks for the report. We're tracking this internally (b/163142688)

Hello,

Pretty new to GitHub, not sure if this is the right place but I have been facing this issue as well. If this can help, this is the error I get:

"code":"auth/invalid-credential",
"message":"Failed to fetch resource from https://graph.facebook.com/v2.12/me, http status: 400, http response: {"error": {"message": Unsupported get request., "type": "GraphMethodException", "code": 100}}

Thanks

Hi,

I have been facing this issue too.
If this can help, this is the error I get:

The supplied auth credential is malformed or has expired. [ Failed to fetch resource from https://graph.facebook.com/v2.12/me, http status: 400, http response: {"error":{"message":"Unsupported get request.","type":"GraphMethodException","code":100}} ]

Thanks

Hi,

As it is stated here : https://github.com/jeduan/cordova-plugin-facebook4
"Please note that this plugin itself does not specify which Graph API version is used. The Graph API version is set by the Facebook SDK for iOS and Android"

I checked my FB dev console, I have the following:
iOS v5.15.0
Android v5.13.0
v8.0 is used for all APIs

In my package.json, I have the following:

    "cordova-plugin-facebook4": "^6.4.0",
    "@ionic-native/facebook": "^5.27.0",
      "cordova-plugin-facebook4": {
        "APP_ID": "xxx",
        "APP_NAME": "“xxx”",
        "FACEBOOK_HYBRID_APP_EVENTS": "false",
        "FACEBOOK_ANDROID_SDK_VERSION": "5.13.0"
      }

I cannot see anything wrong, happy to get some help here :)

Thanks

Hi,

Same error on signInWithCredentisla
[auth/invalid-credential] The supplied auth credential is malformed or has expired. [ Failed to fetch resource from https://graph.facebook.com/v2.12/me, http status: 400, http response: {"error":{"message":"Unsupported get request.","type":"GraphMethodException","code":100,"fbtrace_id":"AHJGp_CWxuPoWGZqwe6fwMU"}} ]

I tried to execute this url with same token on Graph API Explorer and it's working.

Thanks

@etiennept78 @gustavocgsoares @max010
Please note that this issue is about the mere fact that Firebase Auth seems to use unsupported Facebook Graph API, which I learned by inspecting the logs.

The error you people quote is a a client error. In this specific situation it probably actually means that the Facebook token you provided to Firebase Auth has expired (or, maybe actually is "invalid", for example corrupted). See Facebook documentation on access tokens. It's probably not related to the fact that Auth uses unsupported Graph API.

@cubuspl42
This would be quite surprising as nothing on my app changed (wrong excuse I guess). Google and Apple Sign in features that use the same flow still work.

I can see that the error happens right after the signInWithCredential call:

const credential: firebase.auth.OAuthCredential = firebase.auth.FacebookAuthProvider.credential(resFacebook.authResponse.accessToken); firebase.auth().signInWithCredential(credential)

@gustavocgsoares @max010 , let us know if you found a fix.

Thanks

@samhorlbeck
In the recent logs I've seen mentions of Graph v8.0. Can you confirm this?

Hi,

I got response from Facebook support:
"I got information from the product team, the reason you saw this error was the version 2.12 of Graph API expired back in May 2020: https://developers.facebook.com/docs/graph-api/changelog/version2.12.
Please upgrade to the latest version then the issue will be fixed.
Hope this helps."

Reproducing only on production facebook app, and only for users who not presents in administrators, developers or testers groups.

We still have at least one account failing login with:

I/flutter (17951): [firebase_auth/invalid-credential] The supplied auth credential is malformed or has expired. [ Failed to fetch resource from https://graph.facebook.com/v8.0/me, http status: 400, http response: {"error":{"message":"Unsupported get request.","type":"GraphMethodException","code":100,"fbtrace_id":"A4HaeTBTqGnhysyUpy2PAqw"}} ]

(note how it's already v8.0, not v2.12)

The accessToken is considered valid if entered on https://developers.facebook.com/tools/debug/accesstoken

Hi @noinskit

Probably this is Facebook's problem.
I created a new app in facebook developer console and it works fine with same code.
I also suspect that the reason is in permissions, because I was start receive this error after get user_location, user_gender, user_birthday, user_hometown, user_age_range permissions :(.

This is my conversation with facebook support:

Facebook : "I got information from the product team, the reason you saw this error was the version 2.12 of Graph API expired back in May 2020: https://developers.facebook.com/docs/graph-api/changelog/version2.12.
Please upgrade to the latest version then the issue will be fixed.
Hope this helps."
Me: "This request is make by react-native-firebase library, and I can't change its version.
But I am confident that the problem is not in the api version, because I created a new Facebook app.
I reconfigured my app's sign-in flow to new facebook app and it's working.
With the above said, I would appreciate it very much if you pointed out how to make my old facebook app to work too."
Facebook : "Thanks for your information. As I can see from the error message, your app was trying to send a request to v2.12 of Graph API, that's why I said this issue was due to old version of Graph API and you need to upgrade.

But for your new app, Is the react-native-firebase library version in your new app the same as the one that had the login issue?

And I also want to let you know that, since you are using react-native-firebase library, this is not supported by Facebook, you should provide feedback to Firebase, we only provide support to Facebook React Native SDK, https://developers.facebook.com/docs/react-native/"

Hi everyone,

Without changing my code, I have the following error now (similar to @noinskit):

{"code":"auth/invalid-credential","message":"Failed to fetch resource from https://graph.facebook.com/v8.0/me, http status: 400, http response: {\"error\":{\"message\":\"Unsupported get request.\",\"type\":\"GraphMethodException\",\"code\":100,\"fbtrace_id\":\"AjnDQYB0yilxb-8qgMQLtVo\"}}"}

It changed from v2.12 to v8.0 but still does not work.
The accessToken is considered valid if entered on https://developers.facebook.com/tools/debug/accesstoken as well.

I managed to solve my problem with the help of Facebook support: I needed to turn off country restrictions (despite my users being in the country selected). Something must've changed about how Facebook country restrictions are applied to Graph API in the last few weeks.

@noinskit awesome ! Seems like it fixed the issue !

I don't know why the issue started to happen recently, but I've just found that somebody solved it (without Firebase Auth involved, probably) in 2013 (see this answer on StackOverflow).

As a) The Graph API version used by Auth backend seems to be updated and b) the Facebook Graph error root cause is known, I'm closing the issue

Was this page helpful?
0 / 5 - 0 ratings