1

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?

Ashish
  • 6,791
  • 3
  • 26
  • 48
hasan_shaikh
  • 1,434
  • 1
  • 15
  • 38
  • Check this link, i think its a configuration error on your part. https://stackoverflow.com/questions/37273145/error-statusstatuscode-developer-error-resolution-null – Okeme Christian Dec 17 '19 at 09:50

1 Answers1

0

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.

Chanaka Weerasinghe
  • 5,404
  • 2
  • 26
  • 39