Use this when an OIDC client needs to know who signed in.
ID Token
An ID token is an OpenID Connect JWT that tells the client who the user is and how they authenticated, with claims like sub, iss, aud and exp. It is for the client, not for calling APIs.
1. ID token proves authentication to the client.
2. Not for calling APIs.
3. Validate nonce to prevent replay.
4. sub is the stable user ID.
5. Check auth_time/acr if needed.
IdP → ID token → client validates → user session
Context & applicabilityCommon mistakes · platform/version boundaries
- Using the ID token to call APIs — that is the access token's job.
- Skipping
noncevalidation, allowing replay. - Not checking
audequals your client ID. - Accepting tokens signed with keys not from the IdP's JWKS endpoint.
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Verification path Verify boundary
# Decode header and payload of the ID token received at login
python3 -c 'import sys,json,base64; [print(json.dumps(json.loads(base64.urlsafe_b64decode(p+"="*(-len(p)%4))),indent=1)) for p in sys.argv[1].split(".")[:2]]' "$ID_TOKEN"
# The issuer and keys the client should trust
curl -s https://login.example.com/.well-known/openid-configuration | jq '{issuer, jwks_uri, id_token_signing_alg_values_supported}'
Compare iss with the discovery issuer, aud with the client ID, nonce with the value stored in the login session, exp/iat with the current time, and the header kid with the published keys. A validation library should do these checks; the decode is for diagnosis.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- ID tokens are for the client, not for APIs.
- Contains sub, iss, aud, exp and auth time.
- Validate nonce to stop replay.
- ID token claims: iss, aud, exp, iat, nonce, sub — required checks
curl -s <jwks_uri>— keys- Client validation library — maintained
ReferenceWhat it is1 section · depth on demand
Direct Answer
An ID token is the OpenID Connect JWT that tells the client application who signed in and how. The client must validate signature, iss, aud (its client ID), exp and nonce, then identify the user by iss + sub. It is not meant for calling APIs — that is the access token's job.
ReferenceWhy it matters1 section · depth on demand
Validating an ID token
The client must check: signature (JWKS from the IdP), iss, aud equals its client ID, exp/iat, and the nonce it sent. The ID token tells the client who logged in; it should not be sent to APIs as an access token. Inspect a token with a JWT decoder locally (never paste production tokens into public websites).
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
An ID token (OpenID Connect) is a JWT issued to the client application to tell it who the user is and how they authenticated: subject ID, issuer, audience, authentication time, and optionally name, email and authentication methods (amr).
{ "iss": "https://login.example.com", "sub": "248289761001", "aud": "netportal",
"exp": 1793870400, "iat": 1793866800, "nonce": "n-0S6_WzA2Mj",
"email": "ahansen@example.com", "amr": ["pwd", "mfa"] }
Documented example, not captured output.
The client must validate signature, issuer, audience, expiry and nonce. The ID token is for the client only — APIs should receive access tokens. Decode tokens for troubleshooting with local tools; avoid pasting production tokens into public websites.
Key claims
| Claim | Check |
|---|---|
iss | Equals the expected IdP issuer |
aud | Equals your client ID |
exp, iat | Not expired, issued recently |
nonce | Matches the value sent in the request |
sub | Stable user ID — use it as the key |
azp | Authorised party when several audiences exist |
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Single Sign-On & Federation → ID Token. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://www.rfc-editor.org/rfc/rfc7522 · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Deep reference
Healthy vs suspicious evidence
Output interpretation
| Observation | Meaning |
|---|---|
aud is another client ID | Token issued for a different application — wrong client configuration |
iss differs by a path or trailing slash | Client configured with the wrong issuer/authority URL |
nonce missing or different | Session lost the nonce between redirect and callback, or a replay |
exp already passed on arrival | Clock skew or the token is being reused |
amr lacks mfa / acr lower than required | User did not complete the required authentication strength |
No email/groups claims | Scopes or optional claims not requested/configured |