question

carlgfinity avatar image
carlgfinity asked

GoogleOAuthNoIdTokenIncludedInResponse When Logging In With Google Play

Hey, I am using the very latest build of the Google Play Games SDK for Unity from Github. It appears that it has changed a bit. When I attempt to get the server auth token from Google and pass it through to PlayFab I get a GoogleOAuthNoIdTokenIncludedInResponse error and the login fails. There are numerous threads about this message all saying to add the profile scope. I cant find a way to do that in the latest Google Play Games SDK version, how does this all come together now?

sdks
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.

Seth Du avatar image Seth Du ♦ commented ·

Which PlayFab API do you use currently? Would you also share some code snippets with us so that we can dig into it.

0 Likes 0 ·
Andrey Svershko avatar image Andrey Svershko commented ·

I have same error.

Code:

PlayGamesPlatform.Instance.Authenticate(status =>
{
    PlayGamesPlatform.Instance.RequestServerSideAccess(true, code =>
    {
	PlayFabClientAPI.LoginWithGoogleAccount(new LoginWithGoogleAccountRequest()
	{
    		TitleId = PlayFabSettings.TitleId,
    		ServerAuthCode = code,
    		CreateAccount = false
	}, 

	OnGoogleLoginSuccess, OnGoogleLoginFailure);
   });
});


0 Likes 0 ·
JayZuo avatar image
JayZuo answered

Update: PlayFab supports login/link with Google Play Games Services account now. For the new Google Play Games SDK, please use LoginWithGooglePlayGamesServices, which doesn't require profile scope anymore.

To migrate from Google Sign-in to Google Play Games Sign-in in Unity, please see Migrating from Google Sign-in to Google Play Games Sign-in in Unity.

3 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.

rohitvishwakarma1819 avatar image rohitvishwakarma1819 commented ·

any update @jayZuo ?

Should we migrate to new methods or is there any possibilities ?

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ rohitvishwakarma1819 commented ·

Yeah, we'd recommend migrate to the new methods. For more details, please see Migrating from Google Sign-in to Google Play Games Sign-in in Unity.

0 Likes 0 ·
Thiago Lopes Rosa avatar image Thiago Lopes Rosa commented ·

I understand the solution and it worked fine.

BUT, how about the old users who already logged in with the old method (LoginWithGoogleAccount), how will they recover their accounts?

0 Likes 0 ·
James Battersby avatar image
James Battersby answered

PlayGamesClientConfiguration and GetServerAuthCode() have been removed (or are missing) from the latest Unity Google Play plugin so there's no way to get the appropriate server auth code. The only workaround at the amount is to use version 0.10.14 or earlier ( https://github.com/playgameservices/play-games-plugin-for-unity/tree/563d7ac6c4c9f5994f5dfceef98b5ef0c1d9f935 )


This needs to be resolved between Playfab + Google + Unity.

1 comment
10 |1200

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

Matthew Sanford avatar image Matthew Sanford commented ·

I'm brand new to this. I couldn't find the configuration APIs documented in the SDK package. The PlayGamesClientConfiguration seems to be removed entirely and GetServerAuthCode() is replaced by RequestServerAuthCode().

A call to PlayGamesPlatform.Authenticate() followed by PlayGamesPlatform.RequestServerSideAccess() seems to return a legitimate auth code. The subsequent call to PlayFabClientAPI.LoginWithGoogleAccount() with that code assigned to ServerAuthCode arrives at the same issue though, "GoogleOAuthNoIdTokenIncludedInResponse".

I tried calling PlayGamesPlatform.RequestServerSideAccess() with and without forceRefreshToken set and even tried LoginWithGoogleAccountRequest() just to test, all the same result.

0 Likes 0 ·
Jannick Leismann avatar image
Jannick Leismann answered

This really needs attention since login in with latest google play game services plugin is not working anymore.

10 |1200

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

Bernhard Klemenjak avatar image
Bernhard Klemenjak answered

Same here, I needed to downgrade again :/

10 |1200

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

Gruff avatar image
Gruff answered

Same here. Downgrading to GPGS v10.14 and using the old .Builder() pattern was the only way I could get this to work.

10 |1200

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

James Battersby avatar image
James Battersby answered

Still no change. I've created a UPM package repo for convenience if anybody else wants to use it. Full disclaimer: I won't be maintaining it beyond what I need for my own projects but afaik it should work for all.

When adding the package for a git url enter either:

10 |1200

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

Thiago Lopes Rosa avatar image
Thiago Lopes Rosa answered

Accepted solution doesn't take into account the old players who already logged in with the old method (LoginWithGoogleAccount).

After changing to the new method (LoginWithGooglePlayGamesServices), it is not possible to recover/login to old linked accounts.

10 |1200

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

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.