[FR] Support Signin with Facebook Gaming Graph login (which is different from regular Facebook login)
See original GitHub issue[REQUIRED] Please fill in the following fields:
- Unity editor version: 2019.4.11
- Firebase Unity SDK version: 15.2
- Source you installed the SDK: UPM (.unitypackage or Unity Package Manager)
- Problematic Firebase Component: Auth (Auth, Database, etc.)
- Other Firebase Components in use: RTDB (Auth, Database, etc.)
- Additional SDKs you are using: Facebook (Facebook, AdMob, etc.)
- Platform you are using the Unity editor on: Mac (Mac, Windows, or Linux)
- Platform you are targeting: iOS (iOS, Android, and/or desktop)
- Scripting Runtime: Mono (Editor), il2cpp (Device) (Mono, and/or IL2CPP)
[REQUIRED] Please describe the issue here:
We have updated one of our development apps to use the gaming graph. Login to facebook (using Facebook APIs) works correctly, and returns an access token of the form “GG|{tokenString}”. Attempting to pass this token to SignInWithCredentialAsync() results in:
(Inner Exception #0) Firebase.FirebaseException: The supplied auth credential is malformed or has expired.
We can confirm that that token is for the gaming graph API (by logging the Facebook AccessToken’s GraphDomain) , however, when we attempt to log in to Firebase using a credential generated from that token, SignInWithCredentialAsync() throws an exception , the inner of which is:
(Inner Exception #0) Firebase.FirebaseException: The supplied auth credential is malformed or has expired.
Interestingly, Credential.IsValid() returns true.
We are as certain we’ve got this test right as it’s possible to be when most of the opportunities for error are mostly app configuration dashboards rather than the 10 lines of fairly well tested code itself.
Relevant code:
Debug.Log($"Getting credential from access token {AccessToken.CurrentAccessToken.TokenString}");
Firebase.Auth.Credential credential = Firebase.Auth.FacebookAuthProvider.GetCredential(AccessToken.CurrentAccessToken.TokenString);
Debug.Log($"Credential has provider {credential.Provider} : IsValid {credential.IsValid()}" + credential.ToString());
var authTask = auth.SignInWithCredentialAsync(credential);
Debug.Log("Android debugging with printf is fun.");
try
{
var authUser = await authTask;
Debug.Log($"Firebase auth sign in task completed. IsCompleted:{authTask.IsCompleted} IsCanceled:{authTask.IsCanceled}. UserID {authUser.UserId} Provider: {authUser.ProviderId}");
}
catch (System.Exception ex)
{
...
Steps to reproduce:
- Produce a simple app with Firebase and Facebook SDKs.
- Confirm that sign in with Facebook and Firebase Auth FacebookCredentialProvider works.
- Switch facebook app in the Facebook developer dashboard to use Gaming Graph API
- https://www.facebook.com/fbgaminghome/developers/gaming-services/
- Confirm that Facebook will still sign in correctly but Firebase SignInWithCredentialAsync logs exception:
—> (Inner Exception #0) Firebase.FirebaseException: The supplied auth credential is malformed or has expired.<—
Repro 100%
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:33 (2 by maintainers)
Top GitHub Comments
Internal feature request tracking: b/171089917
Hey everyone, just want to let you know that I’ve worked with the team at FireBase to investigate the issue. A fix is expected in coming weeks. Thank you all for your patience and we hope to resolve this long standing issue as soon as we can.