# AuthenticateGoogleAsync fails with Google Play 0.11.01 in Unity

**URL:** <https://forum.heroiclabs.com/t/authenticategoogleasync-fails-with-google-play-0-11-01-in-unity/3075>\
**Category:** Client Libraries\
**Created:** [September 23, 2022, 5:47pm UTC](https://forum.heroiclabs.com/t/authenticategoogleasync-fails-with-google-play-0-11-01-in-unity/3075 "2022-09-23T17:47:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![DaveOak](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/daveoak/32/377_2.png) [@DaveOak](https://forum.heroiclabs.com/u/DaveOak)\
**Post date:** [September 23, 2022, 5:47pm UTC](https://forum.heroiclabs.com/t/authenticategoogleasync-fails-with-google-play-0-11-01-in-unity/3075/1 "2022-09-23T17:47:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ftkg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/ftkg/32/1180_2.png) [@ftkg](https://forum.heroiclabs.com/u/ftkg)\
**Post date:** [September 26, 2022, 1:53pm UTC](https://forum.heroiclabs.com/t/authenticategoogleasync-fails-with-google-play-0-11-01-in-unity/3075/2 "2022-09-26T13:53:35Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![AndreParodi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/andreparodi/32/1744_2.png) [@AndreParodi](https://forum.heroiclabs.com/u/AndreParodi)\
**Post date:** [March 16, 2023, 6:14pm UTC](https://forum.heroiclabs.com/t/authenticategoogleasync-fails-with-google-play-0-11-01-in-unity/3075/3 "2023-03-16T18:14:25Z")

</div>

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 &nbsp;|&nbsp; Google Developers](https://developers.google.com/games/services/android/offline-access#exchange_the_server_auth_code_for_an_access_token_on_the_server)

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

Thanks  
Andre

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [March 17, 2023, 1:56pm UTC](https://forum.heroiclabs.com/t/authenticategoogleasync-fails-with-google-play-0-11-01-in-unity/3075/4 "2023-03-17T13:56:50Z")

</div>

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](https://github.com/heroiclabs/nakama/issues/915)
