# Im trying google login with the Nakama server and unity

**URL:** <https://forum.heroiclabs.com/t/im-trying-google-login-with-the-nakama-server-and-unity/5045>\
**Category:** Local Setup\
**Tags:** server-framework, sdk-unity\
**Created:** [March 12, 2024, 11:18am UTC](https://forum.heroiclabs.com/t/im-trying-google-login-with-the-nakama-server-and-unity/5045 "2024-03-12T11:18:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![developerdinno](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/developerdinno/32/2100_2.png) [@developerdinno](https://forum.heroiclabs.com/u/developerdinno)\
**Post date:** [March 12, 2024, 11:18am UTC](https://forum.heroiclabs.com/t/im-trying-google-login-with-the-nakama-server-and-unity/5045/1 "2024-03-12T11:18:55Z")

</div>

Here i created the account in google developer console and create OAuth2.0 for android and downloaded the secret Json file.

Firstly I’m confusion on how i use that secret Json file.

1. google\_auth:  
credentials\_json: ./data/google\_auth.json

2. google\_auth:  
credentials\_json: |  
{  
“installed”: {  
“client\_id”: " ",  
“project\_id”: " ",  
“auth\_uri”: " ",  
“token\_uri”: " ",  
“auth\_provider\_x509\_cert\_url”: " "  
}  
}

and on unity side why i get the   
please help if you about this issue

---

<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 18, 2024, 10:55am UTC](https://forum.heroiclabs.com/t/im-trying-google-login-with-the-nakama-server-and-unity/5045/2 "2024-03-18T10:55:41Z")

</div>

Hello @developerdinno,

The `credentials_json` value should be the json itself, option 2. is the correct one (assuming it’s formatted correctly and you’re using a .yaml configuration file).

---

<div class="post-metadata">

**Author:** ![developerdinno](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/developerdinno/32/2100_2.png) [@developerdinno](https://forum.heroiclabs.com/u/developerdinno)\
**Post date:** [March 19, 2024, 4:25am UTC](https://forum.heroiclabs.com/t/im-trying-google-login-with-the-nakama-server-and-unity/5045/3 "2024-03-19T04:25:26Z")

</div>

yes sir IM using on YML file thank you

---

<div class="post-metadata">

**Author:** ![developerdinno](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/developerdinno/32/2100_2.png) [@developerdinno](https://forum.heroiclabs.com/u/developerdinno)\
**Post date:** [March 20, 2024, 5:01am UTC](https://forum.heroiclabs.com/t/im-trying-google-login-with-the-nakama-server-and-unity/5045/4 "2024-03-20T05:01:09Z")

</div>

hello @sesposito sir,

i keep the above configuration but i get  
`{"level":"info","ts":"2024-03-20T04:49:51.950Z","caller":"server/core_authenticate.go:630","msg":"Could not authenticate Google profile.","error":"google id token invalid"}`

i try the credentials\_json as option 2 and this way:

```auto
    credentials_json: '{"web": {"client_id": "","project_id": "","auth_uri": "https://accounts.google.com/o/oauth2/auth","token_uri": "https://oauth2.googleapis.com/token","auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs","client_secret": ""}}'

```

any ideas or solution why this occurs

and on unity

```auto
PlayGamesPlatform.Instance.RequestServerSideAccess(true, RequestServerSideAccess);

private void RequestServerSideAccess(string code){
NakamaConnector.AuthenticateWithGoogle(code, authenticatevar);
}

```

---

<div class="post-metadata">

**Author:** ![developerdinno](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/developerdinno/32/2100_2.png) [@developerdinno](https://forum.heroiclabs.com/u/developerdinno)\
**Post date:** [March 20, 2024, 5:40am UTC](https://forum.heroiclabs.com/t/im-trying-google-login-with-the-nakama-server-and-unity/5045/5 "2024-03-20T05:40:52Z")

</div>

Solved  
i update the nakama version  
and above **option 2** is correct of JSON.

```auto
image: registry.heroiclabs.com/heroiclabs/nakama:3.21.0

```
