Based on testing, this does not currently work. Unity 2019.4.11, Firebase 6.15.2 from UPM.
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 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 (which we use with the regular FB Graph in multiple apps).
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)
{
...
Results in debug output:
Getting credential from access token GG|360413575143503|TSMeEBNI3HGY55Try83yfGizvDM
---> (Inner Exception #0) Firebase.FirebaseException: The supplied auth credential is malformed or has expired.<---