Hello, I'm currently trying to implement authentication with google play services. I have followed this setup, but got stuck on an error.
After installing the test app on an android device and trying the google sign in option, I get the following error at first:
"redirect_uri_mismatch" or "GoogleOAuthError".
If I try agin after this first error, I get the folowing error:
"invalid_grant details: Bad Request"
This is the code to intialize Google:
PlayGamesClientConfiguration config = new PlayGamesClientConfiguration.Builder() AddOauthScope("profile") .RequestServerAuthCode(false) .Build(); PlayGamesPlatform.InitializeInstance(config); PlayGamesPlatform.DebugLogEnabled = true; PlayGamesPlatform.Activate();
And this is the code to link or login with google:
Social.localUser.Authenticate((bool success) => { if (success) { var ServerAuthCode = PlayGamesPlatform.Instance.GetServerAuthCode(); if (PlayFabClientAPI.IsClientLoggedIn()) { PlayfabLinkGoogleAccount(ServerAuthCode); } else { PlayfabSignInWithGoogle(ServerAuthCode); } } });
From there i just pass the Playfab API passing on the server auth code.
Why is this happening?