firebase / firebase-unity-sdk

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

[FR] Auth supports SAML providers like Firebase Javascript SDK #277

Open Thaina opened 5 years ago

Thaina commented 5 years ago

https://github.com/firebase/firebase-ios-sdk/pull/2127

https://firebase.google.com/support/release-notes/js#5.7.1

stewartmiles commented 5 years ago

@Thaina it's on our list of things to do.

patm1987 commented 5 years ago

I have good news as far as this bug goes, we do have Game Center support in as of 5.6.0!

--Patrick

Thaina commented 5 years ago

Yeah forgot to close this issue

Thaina commented 5 years ago

I think I need to reopen because I don't see documentation about gamecenter. Also SAML still not supported

https://firebase.google.com/docs/auth/unity/start

cynthiajoan commented 5 years ago

Hi @Thaina, we have Game Center supported as beta now, you can take a look at this doc. We are working on adding documentations for C++ and Unity.

Thaina commented 5 years ago

@cynthiajoan I already try to use it but because it has no document it just hard to blindly use it. And also the SAML still not on it. (signin with email link too)

programmermattsrum commented 4 years ago

@Thaina @cynthiajoan @patm1987 @stewartmiles So Game Center auth has support for Unity? Just no documentation on how to use it? The link doc does not have anything about Unity Plugin.

patm1987 commented 4 years ago

There's not a walkthrough like there are for other sign in providers. You can find the Unity and C++ reference pages on our docs site.

You can also search for "GameCenter" in our sample project to see an example implementation.

I hope that helps in the short term, this comment is not intended as a resolution for the missing documentation but a temporary workaround.

--Patrick

programmermattsrum commented 4 years ago

Patrick, Thanks for the reference.  I was able to use the example code and get a GameCenter auth to work, but it shows no identifier in firebase auth.  Is there a way to make it populate it?

Thanks, Matt On Tuesday, October 22, 2019, 10:37:01 AM CDT, patm1987 notifications@github.com wrote:

There's not a walkthrough like there are for other sign in providers. You can find the Unity and C++ reference pages on our docs site.

You can also search for "GameCenter" in our sample project to see an example implementation.

I hope that helps in the short term, this comment is not intended as a resolution for the missing documentation but a temporary workaround.

--Patrick

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

patm1987 commented 4 years ago

By "it shows no identifier in Firebase Auth" do you mean: CurrentUser.UserId is null CurrentUser.ProviderId is null Something's missing in the ProviderData IEnumerable Something missing in the actual Firebase Console Something else?

Thanks, --Patrick

programmermattsrum commented 4 years ago

firebase-screenshot Patrick, So the provider is GameCenter it has a UID and I am able to save/get data from the real-time database fine.  The UserId is not available for the auth as I shown in the screenshot.  I need this so if there is an issue with a user I can fix their data or use their UID to grant them coins, but since there is no UserId it would be pretty difficult to find their auth in firebase.  I followed the sample code for GameCenter and I am not doing anything different.  Any help would be appreciated. Thanks,Matt Sent from Yahoo Mail on Android

On Wed, Oct 23, 2019 at 9:50 AM, patm1987notifications@github.com wrote:
By "it shows no identifier in Firebase Auth" do you mean: CurrentUser.UserId is null CurrentUser.ProviderId is null Something's missing in the ProviderData IEnumerable Something missing in the actual Firebase Console Something else?

Thanks, --Patrick

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

patm1987 commented 4 years ago

Thanks for the clarification.

Then my follow up is: does this occur using the sample app (and if so, can you get us repro steps - this helps a ton to isolate issues like this)? Is there any useful logging around games center (preferably with LogLevel set to Debug like so: Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Debug)? Would you mind sharing your logs? In your continuation, can you confirm that there is not an exception (or incomplete) result for GetCredentialAsync or SignInWithCredentialAsync, and if there is an exception let us know what it is?

Can I confirm that you're using Unity for the mac deploying to iOS using IL2CPP and the latest Firebase Plugin (6.6.0 right now)? It would also help to know Unity Editor, OSX, and iOS versions involved.

I'm sorry to be doing this so late in the thread. Normally this would be the first bits of information we collect, but since this started as a feature request we hadn't had a need to do all of this.

programmermattsrum commented 4 years ago

I am using Unity for mac deploying to iOS using IL2CPP but I am not on the latest currently on the 6.3.0 right now. Would upgrading to 6.6 possibly fix this issue?

Looks like 6.4.0 might have fixed this issue maybe? Fixed an issue with updated user info not being persisted.

2018.4.11f1 Unity Editor iOS 9+

Thanks, Matt

patm1987 commented 4 years ago

Awesome, thanks.

If you can upgrade to 6.6, there shouldn't be any breaking or API changes so it should be relatively painless.

programmermattsrum commented 4 years ago

@patm1987 I upgraded to 6.6 but it still doesn't persist the identifier but I did see it in the logs. I set the log level like you said - Firebase.FirebaseApp.LogLevel = Firebase.LogLevel.Debug See the logs here - Logs.txt

Like before I am using the following versions 2018.4.11f1 Unity Editor iOS 9+ Firebase 6.6

GetCredentialAsync- IsComplete Result SignInWithCredentialAsync - IsComplete Result

No Exceptions

programmermattsrum commented 4 years ago

@patm1987 Have you checked out my logs to see what the problem might be?

Thaina commented 4 years ago

@chkuang-g I am not sure but, do we have SAML sign in in unity as of yet? I think I can't find documentation about it

patm1987 commented 3 years ago

Sorry this fell behind! @programmermattsrum , what do you mean that it doesn't persist the identifier? Do you mean FirebaseAuth.DefaultInstance.CurrentUser goes to null between runs (generally you should use this to see if you're still signed in) or are you repeatedly calling Social.localUser.Authenticate every run?

programmermattsrum commented 3 years ago

Just saying the gamer tag is not persisted for identifier but maybe game center doesn't do that like play games.  It just shows a dash for each game center auth like "-" that.  Makes it a little harder to identify a gamer though. Matt

Sent from Yahoo Mail on Android

On Thu, Sep 24, 2020 at 4:34 PM, Patricknotifications@github.com wrote:

Sorry this fell behind! @programmermattsrum , what do you mean that it doesn't persist the identifier? Do you mean FirebaseAuth.DefaultInstance.CurrentUser goes to null between runs (generally you should use this to see if you're still signed in) or are you repeatedly calling Social.localUser.Authenticate every run?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

jalutame commented 3 years ago

Hello, I have enabled Game Center sign in in my firebase project, added the iOS app and downloaded the related plist file. I correctly get the credential by calling Auth.GameCenterAuthProvider.GetCredentialAsync() it returns valid credential with provider "gc.apple.com".

But then, when I call SignInWithCredentialAsync(credential).ContinueWith(task => .....

it stays there forever. The logs do not seem having info to help identifying the problem. Any suggestion what I could check? The same application and the same firebase project work fine with Google Play Games sign in or other authentication methods.

Thanks in advance for any help

Thaina commented 3 years ago

@jalutame Maybe try with ContinueWithOnMainThread ?

jalutame commented 3 years ago

@Thaina thank you so much, you pointed me to the right direction! At first I tried a custom implementation to run the call in the main thread and it did not work, but then I replaced it by using Firebase.Extensions.TaskExtension and it worked nicely.

chkuang-g commented 3 years ago

Hmm, late in this thread. About GameCenter signin, take a look of https://github.com/firebase/quickstart-unity/issues/972#issuecomment-791210742

And as @Thaina recommended, ContinueWithOnMainThread() is usually better than ContinueWith() since the continuation function passed into ContinueWith() is called from a non-main thread. And Unity usually does not stomach well if any exception is thrown in that function.

Did not hear anything back about SAML yet. Let me change the title a bit for task management sake.