Search code examples
oauth-2.0google-oauth

what is id_token google oauth


I just got the following result when I tried to do oauth2 to googleapi. Only one thing: I couldn't find what is id_token used for in documentation.

{
  "access_token": "xxxx",
  "token_type": "Bearer",
  "expires_in": 3600,
  "id_token": "veryverylongstring",
  "refresh_token": "abcdefg"
}

Solution

  • id_token is a JSON Web Token (JWT). If you decode it, you'll see it contains multiple assertions, including the ID of the user. See this answer for more details.