firebase / firebase-unity-sdk

The Firebase SDK for Unity
http://firebase.google.com
Apache License 2.0
216 stars 35 forks source link

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

Closed ferretnt closed 5 months ago

ferretnt commented 3 years ago

[REQUIRED] Please fill in the following fields:

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

---> (Inner Exception #0) Firebase.FirebaseException: The supplied auth credential is malformed or has expired.<---

Repro 100%

chkuang-g commented 3 years ago

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 commented 3 years ago

Internal feature request tracking: b/171089917

arkon89games commented 3 years ago

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?

tylerfangfb commented 3 years ago

@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?

jsding commented 3 years ago

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

ferretnt commented 3 years ago

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.

yansievre commented 2 years ago

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.

yanmasharski commented 2 years ago

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

Whyser commented 2 years ago

@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.

tylerfangfb commented 2 years ago

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.

jsding commented 2 years ago

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

nonstappstudio commented 2 years ago

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

tylerfangfb commented 2 years ago

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

bombayplayinc commented 2 years ago

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?

452283662 commented 2 years ago

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 commented 2 years ago

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"

eatsports commented 2 years ago

Hello, is there any updates about this issue?

Ant1m3ta commented 2 years ago

This issue happens in Firebase SDK 8.8.0 as well.

rainbowcreatures commented 2 years ago

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?

krenki-fitonomy commented 2 years ago

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

MetalMonkey-GSD commented 2 years ago

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.

krenki-fitonomy commented 2 years ago

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

manelinho commented 2 years ago

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

flaengel commented 2 years ago

@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.

manel-graca commented 2 years ago

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.

Awais6 commented 2 years ago

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

fmoyano commented 1 year ago

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

hdemircioglu commented 1 year ago

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.

Sitiyoh commented 1 year ago

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.

Toupoc commented 1 year ago

@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?

zhihaozhangim commented 1 year ago

Hi everyone, I'm an engineer from Facebook Login for Gaming. We have landed a fix on our end last week and verified Facebook Login for Gaming now can integrate with our Firebase test App. Could you please help us confirm if the issue has also been resolved for your Apps?

Thank you very much for your patience and help!

Whyser commented 1 year ago

Hi everyone, I'm an engineer from Facebook Login for Gaming. We have landed a fix on our end last week and verified Facebook Login for Gaming now can integrate with our Firebase test App. Could you please help us confirm if the issue has also been resolved for your Apps?

Thank you very much for your patience and help!

"A fix is expected in coming weeks" - from Facebook dev a year ago. And more than a year later you fix this issue?

This is such disrespect to developers using Facebook. And to answer your question: because of this issue we never dared create an app as a gaming app. Once we do, we'll let you know.

flaengel commented 1 year ago

Hi everyone, I'm an engineer from Facebook Login for Gaming. We have landed a fix on our end last week and verified Facebook Login for Gaming now can integrate with our Firebase test App. Could you please help us confirm if the issue has also been resolved for your Apps?

Thank you very much for your patience and help!

Yes, thanks I can confirm is working now.

ferretnt commented 5 months ago

Closing as closed.