playgameservices / play-games-plugin-for-unity

Google Play Games plugin for Unity
Other
3.46k stars 965 forks source link

Sign in box not showing at all: ("Authentication Failed - Developer Error") #2957

Closed TheTobias1 closed 4 years ago

TheTobias1 commented 4 years ago

I've been struggling with this for a while and I can't seem to find a solution that works for me.

I've triple checked my SHA1. I've tried using the App signing cert when downloading from Google play and using the Upload cert when installing from Unity. Neither have worked atm. My resources are copied exactly. I've tried Force Resolving. I've set my environment variables. My IDs are all consistent. Downloaded pretty much everything from the SDK manager in Android studio.

My Login Code, runs on start (if it hasn't been run previously)

Debug.Log("Logging in");
PlayGamesClientConfiguration clientConig = new PlayGamesClientConfiguration.Builder().RequestIdToken().Build();
PlayGamesPlatform.InitializeInstance(clientConig);
PlayGamesPlatform.Activate();
PlayGamesPlatform.DebugLogEnabled = true;

Social.localUser.Authenticate((bool success) =>
{
       if (success)
       {
             login = true;
             Debug.Log("Login complete");
             if (LoginComplete != null)
             {
                   LoginComplete(true);
             }
        }
        else
        {
              Debug.Log("Login fail");
              if (LoginComplete != null)
              {
                   LoginComplete(false);
              }
        }
});

I really don't know what the problem is.

Unity Version: 2020.1.6f

Any help is appreciated

ozdemir08 commented 4 years ago

Could you share the logs that you see in logcat?

TheTobias1 commented 4 years ago

Hey, thanks for the reply. I will be able to soon (projects recompiling atm). The Log stated Sign in failed with Error code 10, which confuses me because my SHA1s are consistent (I've tried with both upload and signing certs in the console). The only thing that come to mind are that my projects currently in rejected state (due to screenshots), but surely I should be able to test, or that maybe I'm getting errors due to SDK, but I've installed almost every component available in Android studio.

TheTobias1 commented 4 years ago

image

Here are the Sign in request messages

image

And here's the full log

Only4Gamers commented 4 years ago

I've been struggling with this for a while and I can't seem to find a solution that works for me.

I've triple checked my SHA1. I've tried using the App signing cert when downloading from Google play and using the Upload cert when installing from Unity. Neither have worked atm. My resources are copied exactly. I've tried Force Resolving. I've set my environment variables. My IDs are all consistent. Downloaded pretty much everything from the SDK manager in Android studio.

My Login Code, runs on start (if it hasn't been run previously)

Debug.Log("Logging in");
PlayGamesClientConfiguration clientConig = new PlayGamesClientConfiguration.Builder().RequestIdToken().Build();
PlayGamesPlatform.InitializeInstance(clientConig);
PlayGamesPlatform.Activate();
PlayGamesPlatform.DebugLogEnabled = true;

Social.localUser.Authenticate((bool success) =>
{
       if (success)
       {
             login = true;
             Debug.Log("Login complete");
             if (LoginComplete != null)
             {
                   LoginComplete(true);
             }
        }
        else
        {
              Debug.Log("Login fail");
              if (LoginComplete != null)
              {
                   LoginComplete(false);
              }
        }
});

I really don't know what the problem is.

Unity Version: 2020.1.6f

Any help is appreciated

Are you uploading it first to Google Play or directly installing it on your device? If you are installing directly on your device then it not gonna work.

TheTobias1 commented 4 years ago

I've tried both (and I've tried each using both SHA1 keys) and so far neither have worked

antonitor commented 4 years ago

I'm stuck with the same problem, in my case trying to get the authcode, but I've tried to get the tokenId and the result is the same. Right now I'm investigating if verifying oauth consent screen for openID scope is a requirement to obtain the authcode or tokenId. If anyone knows, will appreciate it.

Some requests require an authentication step where the user logs in with their Google account. After logging in, the user is asked whether they are willing to grant one or more permissions that your application is requesting. This process is called user consent.

If the user grants at least one permission, the Google Authorization Server sends your application an access token (or an authorization code that your application can use to obtain an access token) and a list of scopes of access granted by that token. If the user does not grant the permission, the server returns an error.

TheTobias1 commented 4 years ago

So, I managed to solve the issue for me. My Android manifest had a space in the ID causing it to go haywire. For reference this is how my manifest looks now: image

ErcinDedeoglu commented 3 years ago

I have same problem