0
votes

I'm having trouble trying to authenticate on my android game, I use playfab + google play services to authenticate on google, but I cant even reach the part where I authenticate on playfab with the google account, the Social.localUser.Authenticate never succeeds and the message it returns in the callback is "Authentication canceled", the only useful log messages I get is

[Play Games Plugin DLL] Application is pausing, which disconnects the RTMP client. Leaving room. Authentication canceled [Play Games Plugin DLL] DEBUG: Invoking user callback on game thread

sometimes it throws

[Play Games Plugin DLL] Starting Auth Transition. Op: SIGN_IN status: ERROR_TIMEOUT

or

[Play Games Plugin DLL] Starting Auth Transition. Op: SIGN_IN status: ERROR_NOT_AUTHORIZED

but thats about it. The weirdest thing is that it opens up the Google Play Games popup, it asks for the permissions, I accept it and everything goes as it supposed to be but in the application it never succeeds. I already registered the platform addon on the Playfab, added a web app linked on the google developer console, copied the client oauth id and secret to playfab, configured the redirected uri and the endpoint link (refs.: https://www.youtube.com/watch?v=FIse9VOk-FE, https://api.playfab.com/docs/tutorials/landing-players/sign-in-with-google). But none of this works, I cant authenticate with it, wether it is installed through the playstore or not, the only thing that I have not tried yet it testing it as an alpha release on the playstore, it is on internal tests at the moment.

[Update 1:] Code I'm using on awake:

PlayGamesClientConfiguration config = new 
PlayGamesClientConfiguration.Builder()
        .AddOauthScope("profile")
        .WithInvitationDelegate(GoogleInvitation)
        .WithMatchDelegate(GoogleMatch)
        .RequestEmail()
        .RequestServerAuthCode(false)
        .RequestIdToken()
        .Build();
    PlayGamesPlatform.InitializeInstance(config);
    PlayGamesPlatform.DebugLogEnabled = true;
    PlayGamesPlatform.Activate();

Code I'm using to login:

Social.localUser.Authenticate((success, message) =>
    {
        Debug.Log("Authentication Message: " + message);

        if (success)
        {
            var serverAuthCode = PlayGamesPlatform.Instance.GetServerAuthCode();
            _AuthService.AuthTicket = serverAuthCode;
            _AuthService.Authenticate(Authtypes.Google);
        }
        else
        {

            Debug.Log("Failed  authenticating with google");
        }
    });
3

3 Answers

1
votes

Can you provide some code ? First of all i think you need to call

PlayGamesPlatform.Activate()

After that all social features should work.

Also to actually test google play services you need to deploy your app to alfa/beta test or release in Play Market and download it from market, without this it won't actually work.

0
votes

Turns out I wasnt on the testing access list of the app's game services since I wasnt the owner I didnt found out about it. This is solved now.

0
votes

I was getting "Authentical Cancelled" and solved it via this post:

basically, it occured because I allowed google to sign the application with its own key. It was apparent after I went to GooglePlayConsole-> Release Management --> App Signing.

"App Signing by Google Play is enabled for this app".

Because it was enabled, I had to bother about another web page "Google APIs". In there, I had to choose "My Game" from the dropdown in the ribbon, went into Credentials Tab and created a new credential with the appropriate SHA-1.

But the link (in this answer) explains it in more detail.