An ID token is a JSON Web Token (JWT) issued by an OpenID Connect (OIDC) authorization server to a client application upon successful user authentication. It contains a set of claims about the user's identity, such as a unique subject identifier (sub), issuer (iss), audience (aud), and expiration time (exp). The token is cryptographically signed, allowing the client to verify its authenticity and integrity, confirming the user is who they claim to be.
Glossary
ID Token

What is an ID Token?
An ID token is a core component of the OpenID Connect (OIDC) protocol, used to convey identity information about an authenticated user to a client application.
Unlike an access token, which authorizes API calls, the ID token's primary purpose is authentication. It provides the client with verifiable proof that the user has been authenticated by a trusted identity provider. The client validates the token's signature, typically using public keys from the provider's JSON Web Key Set (JWKS), and checks its claims before establishing a local session. This mechanism is foundational for implementing single sign-on (SSO) and federated identity.
Key Characteristics of an ID Token
An ID Token is a core artifact in OpenID Connect, a JWT containing verified claims about an authenticated user. Unlike an Access Token, it is intended for the client application, not the resource server.
JWT Format & Structure
An ID Token is a JSON Web Token (JWT) composed of three Base64Url-encoded parts separated by dots: a Header, a Payload, and a Signature.
- Header: Contains metadata like the token type (
JWT) and the signing algorithm (e.g.,RS256). - Payload: Contains the claims about the user and the authentication event. Standard claims include
sub(subject/user ID),iss(issuer),aud(audience/client ID),exp(expiration time), andiat(issued at time). - Signature: Created by signing the encoded header and payload, allowing the client to verify the token's integrity and authenticity.
Identity Claims Payload
The token's payload contains a set of claims that provide identity information. These are categorized as:
- Standard Claims: Pre-defined by the OpenID Connect specification (e.g.,
name,email,preferred_username). - Custom Claims: Additional claims specific to the identity provider or application.
- Authentication Context Claims: Details about the authentication event itself, such as
auth_time(when authentication occurred) andacr(Authentication Context Class Reference, indicating the method used, like MFA).
Example: {"sub": "12345", "name": "Jane Doe", "email": "[email protected]", "iss": "https://auth.example.com", "aud": "my-client-app"}
Client-Side Validation
The client application (RP - Relying Party) must validate the ID Token before trusting its contents. Critical validation steps include:
- Verify the signature using the issuer's public keys (from the JWKS endpoint).
- Confirm the
aud(audience) claim matches the client's own ID. - Check the
iss(issuer) claim matches the expected authorization server. - Validate the token's timestamps: ensure it is not expired (
exp) and that it was issued in a reasonable timeframe (iat). - Reject tokens that do not pass all checks. This validation is a security requirement to prevent token tampering and replay attacks.
Distinction from Access Token
It is crucial to understand the different roles of ID Tokens and Access Tokens in the OAuth 2.0 / OIDC ecosystem:
- ID Token: Purpose is authentication. It answers "Who is the user?" It contains identity claims, is for the client application, and should not be sent to a resource API.
- Access Token: Purpose is authorization. It answers "What can the client do?" It contains scopes and permissions, is for the resource server (API), and is used to authorize API calls.
Mixing their purposes is a common security anti-pattern. The ID Token proves login; the Access Token grants API access.
Issuance Flow (Authorization Code Flow with PKCE)
The ID Token is typically issued as part of the OIDC Authorization Code Flow, the most secure and common flow for web and mobile apps.
- User authenticates at the Authorization Server.
- Server returns an authorization code to the client.
- Client exchanges the code + PKCE verifier for tokens at the Token Endpoint.
- The Token Endpoint response includes both an Access Token and the ID Token.
This flow keeps the ID Token secure from exposure in browser redirects. The nonce parameter is used during the initial request and must be validated against the nonce claim in the ID Token to prevent replay attacks.
Security & Best Practices
Handling ID Tokens requires adherence to security best practices:
- Always Validate: Never trust a token without full cryptographic and claim validation.
- Use
nonce: Mandatory for public clients (SPAs, mobile apps) to mitigate replay attacks. - Short Lifespan: ID Tokens should have a short expiration (e.g., minutes). They are not for long-term API access.
- Secure Storage: Store ID Tokens securely on the client side (e.g., in HTTP-only, Secure, SameSite=Strict cookies for web apps).
- Follow Standards: Implement the OpenID Connect Discovery and Dynamic Client Registration protocols where possible for robust, maintainable integrations.
- Leverage Standard Libraries: Use well-audited libraries for JWT validation instead of writing custom parsing logic.
ID Token vs. Access Token
A comparison of the two primary token types in the OpenID Connect (OIDC) authentication framework, detailing their distinct purposes, contents, and usage patterns.
| Feature | ID Token | Access Token |
|---|---|---|
Primary Purpose | Conveys identity claims about the authenticated user to the client application. | Grants authorization to access protected resources on a resource server. |
Protocol Standard | Defined by the OpenID Connect Core 1.0 specification. | Defined by the OAuth 2.0 Authorization Framework (RFC 6749). |
Token Format | Always a signed JSON Web Token (JWT). | Format is opaque to the client; often a JWT or a reference token. |
Intended Audience | The client application (the | The resource server (API) protecting the data. |
Key Contents | Claims about the user (e.g., | Authorization metadata (e.g., |
Client Usage | Parsed by the client to log the user in and create a local session. | Sent in the |
Validation Method | Client validates the JWT signature, issuer ( | Resource server validates the token, often via introspection with the authorization server or checking its own signature. |
Lifetime | Typically short-lived (e.g., 5-15 minutes). | Short-lived (e.g., 1 hour); refreshed using a refresh token. |
Required Flows | Issued in OpenID Connect flows (Authorization Code Flow, Implicit Flow, Hybrid Flow). | Issued in all OAuth 2.0 grant types (Authorization Code, Client Credentials, etc.). |
Frequently Asked Questions
An ID token is a core component of modern API authentication, specifically within the OpenID Connect (OIDC) standard. These questions address its purpose, structure, security, and role in enabling secure AI agent interactions with external systems.
An ID token is a JSON Web Token (JWT) issued by an OpenID Connect (OIDC) provider's authorization server upon successful user authentication. It contains claims about the authenticated user's identity and the authentication event itself. The token is digitally signed, allowing the client application (like an AI agent) to verify its authenticity and integrity. Unlike an access token, which is used to call APIs, the ID token is intended for the client to confirm who the user is and how they logged in.
How it works:
- A user authenticates with an Identity Provider (IdP) like Google or Azure AD.
- The IdP's authorization server creates a signed JWT containing standard claims (e.g.,
subfor subject,issfor issuer,audfor audience,expfor expiration). - This ID token is delivered to the client application (often alongside an access token).
- The client validates the token's signature using the IdP's public keys (from a JWKS endpoint), checks the
audclaim matches its own client ID, and verifies it hasn't expired. - The client then uses the verified claims (like
emailorname) to personalize the user session.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
An ID Token operates within a broader ecosystem of authentication and authorization protocols. Understanding these related concepts is essential for implementing secure API access for AI agents.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us