Unity Google Sign-In Firebase Auth using PlayGamesPlatform.Instance.GetAccessToken()

977 views
Skip to first unread message

Nicklas Ruiterman

unread,
Dec 7, 2016, 1:44:58 AM12/7/16
to Firebase Google Group
wondering if there's a way to use PlayGamesPlatform.Instance.GetAccessToken() with GoogleAuthProvider.GetCredential() without causing this exception
"No pending exception expected: java.lang.IllegalArgumentException: Must specify an idToken or an accessToken.'"
which crashes the app

using this PlayGamesPlatform.Instance.GetIdToken() works, but prompts the user again to specify an email


seems odd to me that sign-in providers don't permit developers to use them with no permissions
don't most users prefer using the provider that requires the least access?

Stewart Miles

unread,
Dec 7, 2016, 12:59:39 PM12/7/16
to fireba...@googlegroups.com
Hi Nicklas,

This is an issue with the Google Play Games plugin, if you file a bug on their project (https://github.com/playgameservices/play-games-plugin-for-unity) you may get a quicker response.

Cheers,
Stewart

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/71f81825-6bec-4491-8d77-c6eb621c98ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nicklas Ruiterman

unread,
Dec 8, 2016, 1:13:57 AM12/8/16
to Firebase Google Group
Hey Stewart, Thanks, I posted there now.
Is there a nicer way of handling the exception tho?

Cheers,
Nicklas


On Thursday, December 8, 2016 at 6:59:39 AM UTC+13, Stewart Miles wrote:
Hi Nicklas,

This is an issue with the Google Play Games plugin, if you file a bug on their project (https://github.com/playgameservices/play-games-plugin-for-unity) you may get a quicker response.

Cheers,
Stewart
On Tue, Dec 6, 2016 at 3:22 PM, Nicklas Ruiterman <avol...@gmail.com> wrote:
wondering if there's a way to use PlayGamesPlatform.Instance.GetAccessToken() with GoogleAuthProvider.GetCredential() without causing this exception
"No pending exception expected: java.lang.IllegalArgumentException: Must specify an idToken or an accessToken.'"
which crashes the app

using this PlayGamesPlatform.Instance.GetIdToken() works, but prompts the user again to specify an email


seems odd to me that sign-in providers don't permit developers to use them with no permissions
don't most users prefer using the provider that requires the least access?

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.

Nicklas Ruiterman

unread,
Dec 10, 2016, 1:02:28 AM12/10/16
to Firebase Google Group
sorry, didn't realize the GetAccessToken() was passing me a null string without any error message

Stewart Miles

unread,
Dec 12, 2016, 11:21:16 AM12/12/16
to fireba...@googlegroups.com
Yep that's right if you want to handle this exception you'll need to patch the GPG plugin.  I'm sure Clayton - the maintainer - would be happy to receive a pull request :)

Cheers,
Stewart

To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.

To post to this group, send email to fireba...@googlegroups.com.

Piotr Brzostowski

unread,
Jan 5, 2017, 10:01:17 AM1/5/17
to Firebase Google Group
It looks like using PlayGamesPlatform.Instance.GetServerAuthCode(...) don't prompt user for additional account check. Then use that code with sign in (getting credential for google and pass code as accessToken (IdToken can be null). Be sure to check if you have configured proper clienId for firebase web app in Google Play Games configuration window.

cheers,

p.

Piotr Brzostowski

unread,
Jan 5, 2017, 3:43:55 PM1/5/17
to Firebase Google Group
Sorry, it's stops working (now accessToken as codeAuth is invalid). It's strange, it's look like something was cached and few times i had success login to firebase. Now it's not working. It's sad that in order to sign in to Firebase from Google Provider we need to ask 2 times (in first login to google play games plugin) for account permission and the worst is that second time user can pickup other account (other then first used to login to Google Play Games Services).

I know, that it's more of a GPGS Plugin to handle this better. But some nicer SDK/API for unity to login to Google (not through GPGS) would be nice. For now we need to ask 2 times or implement Google Sign in by invoking the underlay Platform's methods. This should be doable but i didn't try yet.

If someone have an answer to successfully obtain google access token with asking user for permission just once, would be nice get to know how.

p.
Reply all
Reply to author
Forward
0 new messages