I was using access_token after sign in with Google, but the Google login has changed and I am trying to use it as id_token.
I received the email and id through the existing code below.
const userInfoClient = google.oauth2('v2').userinfo;
this.oauthClient.setCredentials({
access_token: tokenData.token,
});
const userInfoResponse = await userInfoClient.get({
auth: this.oauthClient,
});
The changed code is as follows.
I receive various values through the payload.
I need email and id, but id value does not exist. Is nbf equal to id in access_token?
const ticket = await client.verifyIdToken({
idToken: tokenData.token,
audience: process.env.GOOGLE_CLIENT_ID,
});
payload has values such as iss,nbf,aud,sub,email,azp,name,picture,iat,exp,jti