1
votes

I have an android app with Google sign in. I'm getting a Token ID like so:

GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data);
GoogleSignInAccount acct = result.getSignInAccount();
String idToken = acct.getIdToken();

I'm sending this to my server, and verifying it's a valid token with the following service: https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=ID_TOKEN_FROM_APP

This returns some data including email, family name, etc. Once I verify this is a valid token, I want to grab the user's user ID. Could someone point me in the right direction? Thanks!

1

1 Answers

0
votes

For anyone else who this might help:

The service I was using (https://www.googleapis.com/oauth2/v3/tokeninfo?id_token=ID_TOKEN_FROM_APP) DOES return the userId - it's returned as "sub" (short for subscriber)