AuthenticateGoogleAsync fails with Google Play 0.11.01 in Unity

I’ve upgraded to GooglePlayGamesPlugin-0.11.01 and modified my code to request a token by calling PlayGamesPlatform.Instance.RequestServerSideAccess instead of
PlayGamesPlatform.Instance.GetUserId() which is deprecated.

However, this token is not being accepted by AuthenticateGoogleAsync.

The following is logged by the server:

{"level":"info","ts":"2022-09-23T17:20:29.337Z","caller":"server/core_authenticate.go:630","msg":"Could not authenticate Google profile.","error":"google id token invalid"}

I have upgraded the client library to 3.5.0 and the server to Nakama 3.13.1+2000e4b8 but the error persists.

Is this an incompatibility and do I need to revert to Google Play 0.10.x?

Thanks.

Hi, we are not aware of that incompatibility at the moment.
If you can, please open an issue/pull request for this error you’re facing.

1 Like

Hi,

we are also trying to use Unity 2021.3.20 together with GooglePlayGamesPlugin-0.11.01 and have encountered the same issue as Dave.

Digging around a bit I found that in 0.10.14 the google API had a method called GetIdToken which is now replaced by RequestServerSideAccess. This new method also returns a string but this is not a jwt token like the previous method returned. So if I call AuthenticateGoogleAsync and pass the string from RequestServerSideAccess it’s failing because it’s not a valid jwt token.

The documentation here gives some more information about the changes needed on the server to convert this Server Auth Code to a Token which can then be used: Enabling Server-Side Access to Google Play Games Services  |  Google Developers

The last message mentioned opening a issue. Do you know if there is something open already?

Thanks
Andre

An issue has been created and is being tracked: Google Play Games v0.11.x is incompatible with Nakama 3.13.1 · Issue #915 · heroiclabs/nakama · GitHub