question

gamyostudio avatar image
gamyostudio asked

Redirect_uri_mismatch on google link

Hi,

I have been trying the updated way to login/link a google account with the Release: 170130 of the unity SDK , but I can't figure how to make it work.

I created my web application on the google play developer console and set the Google OAuth Client ID and secret in the google add-on, but I always have the same error : "Google API error code : redirect_uri_mismatch".

Is it because of an incorrect launch URL ? I use https://PROJECTID.playfabapi.com, and the same URI for Authorised JavaScript origins and https://PROJECTID.playfabapi.com/oauth2callback for Authorised redirect URIs

Thanks in advance

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

·
brendan avatar image
brendan answered

We're working on a blog post right now to walk you through the process of how to correctly set up your title in Google so that you can get the new info set up in our service and use the updated Google authentication system. We'll have that posted as soon as we can, but we want to make very sure it's accurate - the Google setup part is easy to get confused on, so we want to make it as clear as possible.

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

gamyostudio avatar image gamyostudio commented ·

Ok thanks I'll wait for the post :)

0 Likes 0 ·
gamyostudio avatar image gamyostudio commented ·

Ok, so I managed to link the google account with the information in your blog post, which was very clear.

However I have a few remarks :
- Why do we need the "profile"auth scope? Is it because you use the google+ id for the google id, instead of the "player id" (starting with g) , which is returned in the GPG plugin?
- Concerning the player id, it would be very cool to have it stored somewhere in the google info (instead the google id or in addition). To check that the play games account the user is logged in with is the same that the linked google account for example.
- Is it normal that the link does not appear in the "Linked Accounts" of the player?

Thank you

0 Likes 0 ·
marcowilliamspf avatar image marcowilliamspf gamyostudio commented ·

You need the profile scope in order for the GetServerAuthCode API to work and return a result in Google Play Games. Without it it will not return a server auth code and you might even get an exception thrown from GPG.

1 Like 1 ·
gamyostudio avatar image gamyostudio marcowilliamspf commented ·

Ok thank you for the information.

0 Likes 0 ·
brendan avatar image brendan gamyostudio commented ·

It sounds like your second and third questions both have to do with not seeing the Google account info. That info does show up both in the user account info returned by our API calls, as well as in the Game Manager. If you're not seeing it, can you tell us the Title ID and PlayFab ID in question?

0 Likes 0 ·
gamyostudio avatar image gamyostudio brendan commented ·

The Title ID is B1FC and the user ID is F95A099B7F894C0D. I linked the account with google using the previous way (access token) during tests. Although I unlinked with google before linking again with the new way, maybe it is linked

0 Likes 0 ·
Show more comments
Show more comments
gamyostudio avatar image gamyostudio commented ·

Thanks for your answer.

Concerning the google ids, do you know if there is any way to get the former user id (aka the global google user id I guess) in the google play games unity plugin?

It is only returning an id starting with "g" (I guess that's a special id linked to google play games)...

Actually my goal was to know if the google account the user was logged with was the same as the google account that the playfab account was linked with. Maybe there is another way to know that?

0 Likes 0 ·
brendan avatar image brendan gamyostudio commented ·

It sounds like what you're looking to get is the more global-permission account info, which is what we used to support (and which, technically, you can still use the API call to do, using the AccessToken route, rather than the ServerAuthCode). But we really can't recommend using that, as Google has updated to use the newer, more limited-permission auth model (using the old AccessToken actually causes the client device to pop a warning to the user about the permissions the title is requesting). That's not a supported route at this point, so I'm afraid we cannot recommend it.

0 Likes 0 ·

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.