question

wowbigmac avatar image
wowbigmac asked

"Google oauth no id token included in response" error using Cross Platform Native Plugins

This is my first time using PlayFab with Unity. I have been trying to resolve the issue described below for over 2 weeks now to no avail.
The problem is regarding PlayFab's LoginUsingGoogle(). The function requires an oAuth code. Fetching the code, however, is not being done using Google's libraries (as described in PlayFab's documentation). I am using a Unity plugin called Cross-Platform Native Plugins. The plugin provides functionality to communicate with both Google and iOS cloud features (including logging in). I, therefore, am getting the oAuth code using CPNPs LoadExternalAuthenticationCredentials().
CPNP's Google Play login works just fine, but when trying to call PlayFab's API to link/login the Google account using the fetched oAuth code the error in the title appears.
I have been through every resource related to the issue on PlayFab's website and have been discussing the issue with CPNP's support for days with no result as the problem appears to be a PlayFab one.

unity3dsdksAuthentication
10 |1200

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

1 Answer

·
marcowilliamspf avatar image
marcowilliamspf answered

@wowbigmac Thanks for your post. I've taken a moment to look at the Cross Platform Native Plugins. The issue you are having is that the "profile" scope is not included and the plugin you are using is not calling RequestServerAuthCode(false) when configuring GPG. Under the hood of Cross Platform Native Plugin (CPNP) they are using GPG. From what I've seen they have AccessToken support and that is not what we support. We support ServerAuthCode and that has to be used in order to use our LoginWithGoogleAccount API.

Under the hood this is what they should be doing just like we are:

PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder()
.AddOauthScope("profile")
.RequestServerAuthCode(false)
.Build();


Unfortunately, it does not look like they are. So unfortunately at this time there is no compatibility for Google Login using CPNP.

If you would like to implement Google Login, then you will need to install Google Play Games and follow the guide.

https://api.playfab.com/docs/tutorials/landing-players/sign-in-with-google

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

ayyappa avatar image ayyappa commented ·

@MarcoWilliamsPF : Really appreciate for diving into the code and analysing it.

I'm, Ayyappa from VoxelBusters, one of the authors for CPNP.

We followed the steps over here for getting the ServerAuthCode (please search for Games.getGamesServerAuthCode). In CPNP, we also get the Server Auth Code only. In one of my testing, I was able to connect to Playfab's login as well (you can check may games log once for details).

I request you to let us know if you still see the approach is wrong. We are happy to correct it.

Thanks,

Ayyappa,

VB Team

0 Likes 0 ·
ayyappa avatar image ayyappa commented ·

Hi,

I'm Ayyappa from Voxel Busters, one of the authors of CPNP Plugin.

Thanks for looking into the plugin and giving details. However, In our plugin we are requesting ServerAuthCode only and this can be passed to external server to continue accessing the details.

I gave a test on PlayFab recently as well and it worked well with the plugin. If you see any mistake related to the plugin, we are happy to correct it. FYI, this is the part of implementation we did for getting ServerAuthCode and that what your platform also expects too. Please confirm.

Reference Page : Please search for "GetServerAuthCode" .

Thanks,

Ayyappa,

VB Team

0 Likes 0 ·
wowbigmac avatar image wowbigmac commented ·

This is from CPNP's Support.

Hi,

I'm Ayyappa from Voxel Busters, one of the authors of CPNP Plugin.

Thanks for looking into the plugin and giving details. However, In our plugin we are requesting ServerAuthCode only and this can be passed to external server to continue accessing the details.

I gave a test on PlayFab recently as well and it worked well with the plugin. If you see any mistake related to the plugin, we are happy to correct it. FYI, this is the part of implementation we did for getting ServerAuthCode and that what your platform also expects too. Please confirm.

Reference Page : Please search for "GetServerAuthCode" .

Thanks,

Ayyappa,

VB Team

0 Likes 0 ·
wowbigmac avatar image wowbigmac commented ·

So the issue was resolved for a small amount of time. then the same error popped up some weeks later. i didnt change anything in the code, please help

0 Likes 0 ·
wowbigmac avatar image wowbigmac wowbigmac commented ·

In case, DB2F this is my TitleId

0 Likes 0 ·
marcowilliamspf avatar image marcowilliamspf wowbigmac commented ·

Can you please verify that you are successfully getting the ServerAuthCode. You should be able to Debug.Log it to the console. If you are not getting a server auth code, but you are passing the variable to our API it could likely be a null value.

0 Likes 0 ·
Show more comments

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.