firebase-unity-sdk icon indicating copy to clipboard operation
firebase-unity-sdk copied to clipboard

[FR] Support Signin with Facebook Gaming Graph login (which is different from regular Facebook login)

Open ferretnt opened this issue 5 years ago • 29 comments

[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%

ferretnt avatar Oct 15 '20 18:10 ferretnt

Hi @ferretnt

Firebase currently only support regular Facebook Login but not this separate login for gaming.

I can file a feature request for you. Since this will requires some backend changes, it probably will not be done soon.

Another option is to configure a generic OIDC provider by upgrading to GCIP. https://cloud.google.com/identity-platform/docs/web/oidc And you can use OAuthProvider to sign-in with Firebase Auth SDK.

var credential = Firebase.Auth.OAuthProvider.GetCredential("oidc.myProvider", idToken, accessToken);
var task = auth.SignInWithCredentialAsync(credential);

They have a different billing structure though since it charges a small amount per MAU.

chkuang-g avatar Oct 16 '20 19:10 chkuang-g

Internal feature request tracking: b/171089917

chkuang-g avatar Oct 17 '20 00:10 chkuang-g

I can file a feature request for you. Since this will requires some backend changes, it probably will not be done soon.

Is there any movement in this direction? when can we expect this feature?

arkon89games avatar Sep 01 '21 21:09 arkon89games

@chkuang-g Dev of Facebook Login for Gaming here. I'd love to help making Facebook Login for Gaming compatible with Firebase. We have developer reported the following exception:


The supplied auth credential is malformed or has expired. [ Remote site 5XX from facebook.com for VERIFY_CREDENTIAL ]

All I need to know is how FireBase verifies credential with Facebook. Could you help?

tylerfangfb avatar Sep 03 '21 07:09 tylerfangfb

Any news on this FR? There is no official way to move Face Gaming Login to Facebook login, so we not able to use Facebook in our app now.

Thanks

jsding avatar Sep 06 '21 05:09 jsding

I filed a corresponding issue to this one on the Facebook sdk GitHub at the time (?? 12 months ago??) as this issue if that is helpful for info.

All our current development is enterprise with azure auth so not able to provide any further information in the short term, sorry.

On Sun, Sep 5, 2021 at 22:32 jsding @.***> wrote:

Any news on this FR? There is no official way to move Face Gaming Login to Facebook login, so we not able to use Facebook in our app now.

Thanks

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/firebase/firebase-unity-sdk/issues/396, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABDPWJ67B3TQAB6EE7GMZWTUARG5ZANCNFSM4SSKP2IQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

ferretnt avatar Sep 06 '21 06:09 ferretnt

Hi @ferretnt

Firebase currently only support regular Facebook Login but not this separate login for gaming.

I can file a feature request for you. Since this will requires some backend changes, it probably will not be done soon.

Another option is to configure a generic OIDC provider by upgrading to GCIP. https://cloud.google.com/identity-platform/docs/web/oidc And you can use OAuthProvider to sign-in with Firebase Auth SDK.

var credential = Firebase.Auth.OAuthProvider.GetCredential("oidc.myProvider", idToken, accessToken);
var task = auth.SignInWithCredentialAsync(credential);

They have a different billing structure though since it charges a small amount per MAU.

Hi, I was wondering if you were able to accomplish this. From what I found out, I need to use FB.Mobile.LoginWithTrackingPreference(...) to receive an AuthenticationToken (which I think is what is needed for the idToken parameter of the GetCredential function) but this only works on iOS.

yansievre avatar Sep 30 '21 14:09 yansievre

It would be great to have this feature, lot of games use FB & Firebase.

yanmasharski avatar Oct 19 '21 09:10 yanmasharski

@chkuang-g can you help @tylerfangfb with the requested information? I can't believe this is not already supported. :/ More and more apps are created as "Gaming" app on Facebook because of their new "categorization"-process when creating new apps.

Whyser avatar Oct 27 '21 12:10 Whyser

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.

tylerfangfb avatar Oct 27 '21 20:10 tylerfangfb

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.

Any progress regarding about this issue?

Thanks

jsding avatar Nov 30 '21 08:11 jsding

Do we have any progress on that? Thanks for the reply :)

nonstappstudio avatar Dec 02 '21 23:12 nonstappstudio

A fix has been deployed by team @ google. Could someone who ran into this issue before try again?

tylerfangfb avatar Dec 06 '21 06:12 tylerfangfb

Hi @tylerfangfb. We tried after the update. Now the error we are seeing is this:

Remote site 5XX from facebook.com for USER_INFO

Do we need to update the Firebase sdk also?

bombayplayinc avatar Dec 09 '21 05:12 bombayplayinc

I updated firebase to the latest version and this problem still exists. The error is "Remote site 5XX from facebook.com for USER_INFO"

452283662 avatar Dec 28 '21 11:12 452283662

me too: Firebase.FirebaseException: The supplied auth credential is malformed or has expired. [ Remote site 5XX from facebook.com for VERIFY_CREDENTIAL ]

I updated firebase to the latest version and this problem still exists. The error is "Remote site 5XX from facebook.com for USER_INFO"

arkon89games avatar Jan 03 '22 20:01 arkon89games

Hello, is there any updates about this issue?

eatsports avatar Jan 20 '22 13:01 eatsports

This issue happens in Firebase SDK 8.8.0 as well.

Ant1m3ta avatar Feb 14 '22 11:02 Ant1m3ta

After 2 days I discovered the above is why our newly implemented Facebook login over Firebase doesn't work...though I didn't test with Firebase 8.8.0 yet...any updates?

rainbowcreatures avatar Apr 06 '22 12:04 rainbowcreatures

Hi! Is it safe now to use facebook gaming login with firebase? Has the issue been resolved?

krenki-fitonomy avatar May 12 '22 09:05 krenki-fitonomy

Still not working here with latest SDKs and nobody seems to care at all. It's a complete disaster. You can't even add the old "Facebook Login" anymore, because something is bugged in the Facebook interface. When trying to add any package it always says "We couldn't find your developer website URL in your app's store listing", although it's there. Bug reports on Facebook also don't work... EDIT: Facebook finally fixed their interface, so at least the "Facebook Login" works again with Firebase.

MetalMonkey-GSD avatar May 27 '22 13:05 MetalMonkey-GSD

@tylerfangfb do you have any update on the issue? Have you managed to resolve it?

krenki-fitonomy avatar May 30 '22 08:05 krenki-fitonomy

I'm still having the exact same issue. Any updates?

manelinho avatar Jul 14 '22 23:07 manelinho

@paulinon Is there a workaround you could point me to, or at least a timeframe if this will/or will not be implemented by Firebase? Creating another Facebook app, just to be able to use firebase authentication is not viable at this stage.

flaengel avatar Jul 19 '22 18:07 flaengel

I ended this non-sense and ditched Firebase. It's a lot of work to implement another backend service but I just can't take this anymore. I'm back using Playfab. I don't even know why I decided to use Firebase in my current project tbh.

manel-graca avatar Jul 20 '22 20:07 manel-graca

The same happens to me! Any timeframe when it will be fixed?

awais-100 avatar Sep 04 '22 13:09 awais-100

Anyone has tried this recently? Is it yet not possible to user Facebook Login for Gaming with Firebase?

fmoyano avatar Oct 10 '22 11:10 fmoyano

It is still not working. I think this feature needs to be prioritized. Nowadays, Facebook login for gaming is an important aspect of the games.

hdemircioglu avatar Oct 11 '22 07:10 hdemircioglu

https://github.com/firebase/flutterfire/issues/4524#issuecomment-764610739

This worked for me by recreating Facebook Application with type of Consumer.

I have noticed that Facebook Application built for gaming doesn't have public_profile available in their permissions and have gaming_profile instead. I haven't tried it out, but for those of you that doesn't want to recreate Facebook Application, maybe replacing public_profile permission requirements to gaming_profile may avoid this error.

Sitiyoh avatar Oct 12 '22 16:10 Sitiyoh

@Sitiyoh does this work? Consumer profile doesnt work with the invitable_friends endpoint and connecting players with thier friends is 100% of the reason we're involving facebook. Are you implying that I may be able to change the user permission to gaming_profile instead of public_profile and that will circumvent the issue?

Toupoc avatar Oct 29 '22 18:10 Toupoc