question

psanchez avatar image
psanchez asked

LoginWithGoogleAccount on Unity

Hello

I've been trying to use this api call with the token provided by the GooglePlayGames plugin GetServerAuthCode and with the access token obtained after exchanging the AuthCode in www.googleapis.com/oauth2/v4/token.

In both cases, I obtained from the PlayFab server the response: "InvalidGoogleToken". Both tokens are very different from the Sample Request in the LoginWithGoogleAccount doc page:
AuthCode: "4/6rjW-tKeGDMIJjQgrOR1PEV2j0ALOH9Psr8iTR9_0lE"

Access Token: "ya29.Ci8dA0H0iIg52Y_6SZiV1NEXe1izVCERLCYIG9ORvIikfDjA2Q93zbzLtEBZcpLlqQ"

I also take a look at your Login Example (now marked as deprecated). The calls that are made in the plugin to GoogleAuthUtil.getToken are now also deprecated by google, and I want to know if the new getToken call will provide the correct token or if it will be like the one obtained by exchanging the AuthCode.

Can you tell me how to obtain the right token from Unity?

Thanks for your help.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

We actually have a thread on the update for Google's new Play Games authentication system here: https://community.playfab.com/questions/966/211567867-Google-Login-support-for-new-Play-Games-Permissions-no-Google-required-.html.

For now, you can continue to use the existing authentication with Google's GoogleAuthUtil.getToken. While they do want new titles to move to using their updated authentication system, the existing system will continue to work as intended for the foreseeable future. That said, we will be updating the Google authentication in PlayFab to use their updated system as soon as we can. Please keep an eye on the original thread (above) for more info on this.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

psanchez avatar image psanchez commented ·

I was able to login with the deprecated GoogleAuthUtil.getToken. I'll follow the other thread to be updated when you change the google authentication.

Thank you.

0 Likes 0 ·
brendan avatar image brendan commented ·

Just making sure all the other threads on this topic have the updated info: We do now support the newer Google authentication (ServerAuthCode) process. Please see this post for more information: https://playfab.com/blog/setting-up-google-sign-in/.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.