question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[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:open
  • Created 3 years ago
  • Reactions:2
  • Comments:33 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
chkuang-gcommented, Oct 17, 2020

Internal feature request tracking: b/171089917

4reactions
tylerfangfbcommented, Oct 27, 2021

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[FR] Support Signin with Facebook Gaming Graph login ...
[FR] Support Signin with Facebook Gaming Graph login (which is different from regular Facebook login) #396.
Read more >
Facebook Login for Gaming - Facebook Games - Documentation
Facebook Login For Gaming. Facebook Login for Gaming enables authentication and allows your app to ask a person for permission to access their...
Read more >
Authentication Versus Data Access - Facebook Login
Facebook Login provides two major benefits: authentication and data access. These are not mutually exclusive. You can use Facebook Login to authenticate ...
Read more >
FAQ - Facebook Games - Documentation
Q: Is Facebook Login for Gaming a different login authenticator from ... Login for Gaming, what user information will be available to query...
Read more >
Access Token Guide - Facebook Login - Meta for Developers
An access token is an opaque string that identifies a user, app, or Page and can be used by the app to make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found