rhishikeshj / Xamarin.GoogleAuth

Cross platform plugin for doing Google Authentication for Xamarin iOS and Android apps
BSD 2-Clause "Simplified" License
8 stars 4 forks source link

Signin Error: Status Code 12501 #4

Open marcbernal opened 7 years ago

marcbernal commented 7 years ago

Hi Rhishikesh! First of all, thank you for your amazing job doing this !

I'm facing an issue while trying the sample project on Android, and I don't know what I'm doing wrong. In your sample project, I only added my client id from my OAuth client and I run it. When I log in, I am getting always this:

image

Do you know what is happening ?

Thank you !

EdHubbell commented 7 years ago

I believe I've got the same error (although Xamarin is acting up today and not stopping at breakpoints). I get the nice Google window that allows me to choose from either of my 2 google identities, but I get an error as soon as I choose one. Any assistance is appreciated.

Haven't tried iOS yet.

EdHubbell commented 7 years ago

GFL replicating this, but I had the same issue. Then I added .RequestServerAuthCode, and things started to work.

var gsoBuilder = new GoogleSignInOptions.Builder(GoogleSignInOptions.DefaultSignIn)
    .RequestIdToken(_clientId)
    .RequestServerAuthCode(_clientId)
    .RequestEmail();

Then I got rid of that .RequestServerAuthCode line, and things continued to work. I've got clipboard history suggesting I had the correct keys and all that. I'm at a loss. I'm leaving in the .RequestServerAuthCode just because.

Make sure you are using a Web Application token from Google, not an Android token.