hippogamesunity/SimpleGoogleSignIn

UWP login not working

Closed this issue · 2 comments

First, thank you for the great plugin. The PC google login works great, but I could not make the UWP build to login.

This is my code:

#if UNITY_WSA_10_0 
            GoogleAuth.Auth("XXXXXXXXXXXX-XXXXXXXXXXXXXXXX.apps.googleusercontent.com", "rentouwp", AuthCallback);
#elif UNITY_STANDALONE
            GoogleAuth.Auth("XXXXXXXXXXXX-XXXXXXXXXXXXXXXX.apps.googleusercontent.com", "MY-SECRET-XXXX", AuthCallback);        
#endif 

And I've set my deeplink ID "rentouwp" here:
image

My credentials screen is iOS app as per your instructions:
image

Trying to login from Unity Editor gives this error:
image

Trying to login from VS local build throws this exception on when trying to login with GoogleAuth.Auth:

OpenURL failed with url https://accounts.google.com/o/oauth2/v2/auth?response_type=code&scope=openid%20email%20profile&redirect_uri=rentouwp%3A%2Foauth2callback&client_id=XXXXX-XXXXXXXXXXXXXXXXXXXXXXXX.apps.googleusercontent.com&state=YYYYYYYYYYYYYYY&code_challenge=ZZZZZZZZZZ&code_challenge_method=S256
[12.596194 / 67.275658] - OnWindowActivated event - Deactivated.
onecoreuap\windows\wgi\winrt\display\displaycommon.cpp(411)\Windows.Graphics.dll!00007FF950F407D0: (caller: 00007FF950F4049A) ReturnHr(15) tid(80e8) 80070490 Element not found.

and the AuthCallback callback is never called.
I tried opening this URL in my browser and I only got this error:

image

Is there any way I can test the UWP login before uploading my game to windows store?

Note: I tried replacing UNITY_WSA in GoogleAuth.cs with UNITY_WSA_10_0 as this is the correct preprocessor directive for my game setup..but it still failed the same way

I'm hoping for your help.
Thank you

Update on my issue: It turns out my UWP deeplink id had to contain a dot (.) and be present in the Credentials API iOS settings as well:

image

So now google displays the login windows (showing google user to select) but when I choose the user, it calls AuthCallback with error: 401 Unauthorized.

Any ideas?
Thanks

OK, it finally worked. I cleared some caches and added my Windows Store App ID to "App Store ID" field in credentials page and it is working now.
Cheers