Skip to content

What is ID Token

In the OIDC protocol, you will encounter three types of tokens: id_token, access_token and refresh_token. This article will introduce what is ID Token, you can also read separately:

The most important extension of the OIDC (OpenID Connect) protocol to the OAuth 2.0 protocol is the ID Token data structure. ID Token is equivalent to the user's identity credential. The developer's front-end can carry ID Token when accessing the back-end interface. Developer server can verify the user's ID Token to determine the user's identity. After passing verification, relevant resources are returned.

ID Token is essentially a JWT Token, which contains key/value pairs related to the user's identity information, for example:

json
{
  "iss": "https://server.example.com",
  "sub": "24400320", // Abbreviation of subject, which is the user ID
  "aud": "s6BhdRkqt3",
  "nonce": "n-0S6_WzA2Mj",
  "exp": 1311281970,
  "iat": 1311280970,
  "auth_time": 1311280969,
  "acr": "urn:mace:incommon:iap:silver"
}

ID Token is essentially a JWT Token, which means:

  • The user's identity information is directly encoded into id_token, you don't need to request additional resources to obtain user information;
  • id_token can verify that it has not been tampered with. For details, please see How to Verify ID Token.

ID Token complete field meaning

Field nameTranslation
subAbbreviation of subject, unique identifier, usually user ID
namegiven name
given_namegiven name
family_namesurname
middle_namemiddle name
nicknamenickname
preferred_usernamepreferred name
profilebasic information
pictureavatar
websitewebsite link
emailemail
email_verifiedwhether the email is verified
gendergender
birthdatebirthday
zoneinfotime zone
localeregion
phone_numbermobile number
phone_number_verifiedverified mobile number
addressaddress
formatteddetailed address
street_addressstreet address
localitycity
regionprovince
postal_codezip code
countrycountry
updated_atinformation update time

Refer to OIDC specification

Agent infrastructure for identity, memory, and web action.