Authentication or SignIn with Google new PlayGamesServices 0.11.01

We’re looking for advice or comments related to Unity and the newest version of Google Play Games 0.11.01. It seems the latest Play Games services sdk no longer exposes the player id token, which Nakama needs to authenticate the google profile. Has anyone determined how to properly get the token required to authenticate or sign in with the latest Google sdk? There is a RequestServerSideAccess function in the PGS sdk that returns a token, but the description doesn’t seem to match up, and the token is rejected as invalid by Nakama.

Thanks

Hi, there is an existing issue being tracked on Nakama to enhance the token handling: Google Play Games v0.11.x is incompatible with Nakama 3.13.1 · Issue #915 · heroiclabs/nakama · GitHub

If you cannot wait/avoid upgrading the PGS SDK you should be able to use Google Sign-In SDK to get a compatible token: Sign-in for Android Games  |  Play Games Services  |  Google Developers

thanks for the confirmation.

Any update on this issue?

Getting back to this after a hiatus and living with the GPG v0.10.x plugin for unity. We have updated to v0.11.1 and Nakama 3.17 and after configuring with client access secret, are successfully getting the temporary OAuth token and successfully linking the google account with the nakama user.
How does unlinking work? It seems like an Android user is signed in automatically to Google Play Games with the new SDK without any action on the user’s part and I don’t think we can prevent that in Unity.
Does UnlinkGoogleAsync still work? What do we pass as the token, the same or a refreshed OAuth token?

@oscargoldman Yes it is supposed to work, it will unlink the Nakama account from the respective Google account. The passed token should be your current access token. Please let us know if it does not work for you.

Thanks for the response. Are we supposed to use the temporary OAuth token to unlink or the Google ID that is saved in the Nakama account to unlink? When unlinking successfully, is the google ID deleted from the Nakama account record?
Thanks

we’ve tried both the temp oauth token and the google id, and we get the following nakama error in both cases:
{“level”:“info”,“ts”:“2023-10-11T12:43:49.961-0400”,“caller”:“server/core_unlink.go:295”,“msg”:“Could not authenticate Google profile.”,“error”:“google id token invalid”}
In testing this, the oauth temp token is the same for unlinking as linking, with less than a minute between linking and attempted unlinking.

You will need to pass the same credentials needed on Authenticate, i.e. the server auth code (a new one as it is single-use).

You can also choose not to pass anything (empty token), and Nakama will clear the Google ID from the account record without checking it.

I searched on every forum on internet and eventually end up fixing this by performing a force stop on google play store.