1
votes

I want to authenticate gmail login with backend server, So I came across this https://developers.google.com/identity/sign-in/android/backend-auth

Gmail signin option,

GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
    .requestIdToken(getString(R.string.server_client_id))
    .requestEmail()
    .build();

here I am requesting for requestIdToken.

server_client_id is Web application auth id generated from google developer console. This works fine when I request only email in GoogleSignInOptions, But when I request for IdToken it is giving developer error

Tried below links, but still developer error only.

Error 12501 authenticating with google sign-in

why is requestIdToken returning null?

1
Check this link, i think its a configuration error on your part. stackoverflow.com/questions/37273145/…Okeme Christian

1 Answers

0
votes

It hapens when your console app SHA mismaches with project SHA

https://github.com/googlesamples/google-services/issues/360#issuecomment-381648685

make sure the web client ID (if you're using it) belongs to the same project where you registered your package name and SHA1.