I’m having an issue in our game where the Google linking is not working as expected in our account linking workflow and I am unsure as what is going wrong.
We are using the following:
The game currently has this workflow:
1 - Login to PlayFab with the Device ID
2 - Authenticate with Google Play Games platform
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder().AddOauthScope("profile").RequestServerAuthCode(false).Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate();
3 - If GooglePlay authenticates successful, look up for existing accounts on that platform:
GetPlayFabIDsFromGoogleIDsRequest request = new GetPlayFabIDsFromGoogleIDsRequest() { GoogleIDs = new List<string>() { Social.localUser.id } }; PlayFabClientAPI.GetPlayFabIDsFromGoogleIDs(request, (GetPlayFabIDsFromGoogleIDsResult obj) => { /* evaluate existing links to this ID */ }, (PlayFabError err) => {...});
4 - If no existing link found then prompt the user to link the account and do the following:
GooglePlayGames.PlayGamesPlatform platform = (GooglePlayGames.PlayGamesPlatform)Social.Active; serverAuthCode = platform.GetServerAuthCode(); LinkGoogleAccountRequest request = new LinkGoogleAccountRequest() { ForceLink = true, S erverAuthCode = serverAuthCode }; PlayFabClientAPI.LinkGoogleAccount(request, HandleAccountLinkSuccess, HandleAccountLinkError);
The Problem
PlayFabClientAPI.LinkGoogleAccount() is returning successful but the link doesn't seem right. First we noticed that PlayFabClientAPI.GetPlayFabIDsFromGoogleIDs() would never actually the PlayFab ID of the player that was linked. I looked up the player in the developer console but there is no Google account visible on the Overview page.
I added a PlayFabClientAPI.GetAccountInfo() call to do some debugging and it seems that the Google ID that is associated with the PlayFab account doesn't actually match the value returned by Social.localUser.id.
When I print out all the data I can see
PlayFab ID = 431FFA7AE5DE41BA
GoogleId linked on PlayFab = 108497095532356099240
Social.localUser.id = g09647207943146822087
I have printed out all the Google user data I have access through the GPGS plugin on the client but nothing seems to match the Google ID PlayFab has linked to the player's account. Where is the value 108497095532356099240 coming from? Does anyone know why it would not match the Google ID I am getting on the client?
I'm not sure what I'm exactly doing wrong as the same workflow works great for GameCenter account linking.
Answer by 1807605288 · Jan 16, 2018 at 11:30 PM
Google Account IDs:
This is a new issue that I haven't heard before. I will kick off an investigation, and try to get back to you. In the past, issues with Google sign in have taken a while to resolve, so it could be several weeks or more before we have any kind of answer for you. (sorry)
Game Center:
Please see our Login Best Practices, and scroll to the section near the end:
Insecure Recoverable Login Mechanisms
There are pretty significant restrictions on using GameCenter, and maintaining the security of your players accounts.
Were there any updates on this? I was the same team as Chris, but he doesn't work here anymore so I might have missed any follow up.
Any updates on this? I'm also having the exact same issue here. Already searched everywhere but can't find a solution.
Running into this same exact issue. Anyone find a cause or workaround? Is this expected behavior?
This is a expected behavior, Google returns a different ID other than the g*** one from GPG for PlayFab to link to, as discussed in this thread: https://community.playfab.com/questions/11022/google-player-id-problem-and-possible-getplayfabid.html
Get Language List fails at Entity Authentication 2 Answers
Deny CreateAccount in LoginWithCustomIDRequest 1 Answer
Email registration across different titles 1 Answer
Best practice for caching a previously authenticated user? 2 Answers
Server API for AddGenericId and GetPlayFabIDsFromGenericIDs 1 Answer