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

[FR] Auth supports SAML providers like Firebase Javascript SDK

Open Thaina opened this issue 6 years ago • 24 comments

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

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

Thaina avatar Dec 24 '18 04:12 Thaina

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

stewartmiles avatar Jan 26 '19 00:01 stewartmiles

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

--Patrick

patm1987 avatar Apr 22 '19 22:04 patm1987

Yeah forgot to close this issue

Thaina avatar Apr 23 '19 03:04 Thaina

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

Thaina avatar Jun 06 '19 10:06 Thaina

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.

cynthiajoan avatar Jun 10 '19 23:06 cynthiajoan

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

Thaina avatar Jun 11 '19 01:06 Thaina

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

programmermattsrum avatar Oct 03 '19 19:10 programmermattsrum

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

patm1987 avatar Oct 22 '19 15:10 patm1987

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 [email protected] 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.

programmermattsrum avatar Oct 23 '19 04:10 programmermattsrum

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

patm1987 avatar Oct 23 '19 14:10 patm1987

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, patm1987[email protected] 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.

programmermattsrum avatar Oct 23 '19 15:10 programmermattsrum

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.

patm1987 avatar Oct 23 '19 16:10 patm1987

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

programmermattsrum avatar Oct 23 '19 16:10 programmermattsrum

Awesome, thanks.

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

patm1987 avatar Oct 24 '19 15:10 patm1987

@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 avatar Oct 26 '19 01:10 programmermattsrum

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

programmermattsrum avatar Nov 01 '19 19:11 programmermattsrum

@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

Thaina avatar Sep 16 '20 13:09 Thaina

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?

patm1987 avatar Sep 24 '20 21:09 patm1987

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, Patrick[email protected] 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.

programmermattsrum avatar Sep 25 '20 00:09 programmermattsrum

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

jalutame avatar Mar 02 '21 05:03 jalutame

@jalutame Maybe try with ContinueWithOnMainThread ?

Thaina avatar Mar 02 '21 05:03 Thaina

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

jalutame avatar Mar 02 '21 06:03 jalutame

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.

chkuang-g avatar Mar 05 '21 07:03 chkuang-g