GenAuth DocsDocuments
Concepts
User Guide
Development Integration
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Concepts
User Guide
Development Integration
Metadata
Development Integration
Multi-tenant (beta)
Console Documentation
Multi-tenant Console
Tenant Console
Saas Application Demo
Old version
Concepts
  • What is GenAuth
  • What is User Pool
  • What is Application
  • What is Authentication
  • What is Federation Authentication
  • What is Zero Trust Network
  • Single Sign-On and Single Sign-Out
  • What is Authorization
  • Authentication vs Authorization
  • What is JWT Token
  • What is ID Token
  • What is Access Token
  • What is Refresh Token
  • Access Token vs Id Token
  • Understanding OIDC and OAuth2.0 Protocol

  • Understanding SAML2 Protocol

  • What is Multi-Factor Authentication
  • Account Lifecycle Management
  • Hosted Login Page vs Embeddable Login Component
  • CIAM and EIAM
  • What is LDAP
  • How QR Code Login Works
  • Basic Concepts of Cryptography
  1. Concepts
  2. /
  3. Access Token vs Id Token

¶ Access Token vs Id Token

Update time: 2025-04-11 11:21:15
Edit

There are two types of identity-related tokens: Access Token and Id Token.

¶ Access Token

Access Token can be in the format of JWT (opens new window) or a random string. Access Token should be carried to access protected API interfaces, and the API interface should check the scope permission items in the Access Token to decide whether to return resources. For example, an application uses Google login and then synchronizes the user's calendar information. Google will return an Access Token to the application. When the application wants to read and write the user's calendar data, the application needs to carry the returned Access Token to access Google's Calendar API.

Never use Access Token for authentication. Access Token itself cannot indicate whether the user has been authenticated.

Access Token only contains the user id in the sub field. In the application you develop, you should treat Access Token as a random string and do not try to parse information from it.

Access Token content example:

{
  "jti": "YEeiX17iDgNwHGmAapjSQ",
  "sub": "601ad46d0a3d171f611164ce", // Abbreviation of subject, which is the user ID
  "iat": 1612415013,
  "exp": 1613624613,
  "scope": "openid profile offline_access",
  "iss": "https://yelexin-test1.genauth.ai/oidc",
  "aud": "601ad382d02a2ba94cf996c4" // Abbreviation of audience, which is the application ID
}

Note that Access Token does not contain any user information except id. It contains scope permission items, which are used to call protected API interfaces. So Access Token is used to call interfaces, not for user authentication.

In many scenarios, you want to get more user information through Access Token. You can call GenAuth's User Information Endpoint (Self-built Application Application Configuration Tab Authentication Configuration Module) with Access Token to get complete user information.

¶ Id Token

The format of Id Token is JWT (opens new window). Id Token is only applicable to authentication scenarios. For example, if an application uses Google login and then synchronizes the user's calendar information, Google will return Id Token to the application. Id Token contains the user's basic information (user name, avatar, etc.). The application can parse Id Token and use the information in it to display the user name and avatar.

Before using Id Token, you should first verify the legitimacy.

It is not recommended to use ID Token for API access authentication.

The audience (aud parameter) of each ID Token is the ID of the application that initiates the authentication and authorization request (or the AK of the programmatic access account).

Example of the content in the Id Token:

{
  "sub": "601ad46d0a3d171f611164ce", // Abbreviation of subject, which is the user ID
  "birthdate": null,
  "family_name": null,
  "gender": "U",
  "given_name": null,
  "locale": null,
  "middle_name": null,
  "name": null,
  "nickname": null,
  "picture": "https://files.authing.co/authing-console/default-user-avatar.png",
  "preferred_username": null,
  "profile": null,
  "updated_at": "2021-02-04T05:02:25.932Z",
  "website": null,
  "zoneinfo": null,
  "at_hash": "xnpHKuO1peDcJzbB8xBe4w",
  "aud": "601ad382d02a2ba94cf996c4", // audience abbreviation, application ID
  "exp": 1613624613,
  "iat": 1612415013,
  "iss": "https://oidc1.genauth.ai/oidc"
}
Previous article: What is Refresh Token Next article: OIDC and OAuth2.0 Overview
  • Access Token
  • Id Token

User identity management

Integrated third-party login
Customized authentication process

Enterprise internal management

Single sign-on
Multi-factor authentication
Permission management

Developer

Development Documentation
GitHub (opens new window)

Company

official@genauth.ai
16th Floor, Building B, Beichen Century Center, Chaoyang District, Beijing (Total)
Room 406, 4th Floor, Block B, No. 200, Tianfu Fifth Street, High-tech Zone, Chengdu (Branch)

© Beijing Steamory Technology Co., Ltd.