JWT claims reference
A JSON Web Token carries its data as claims — name/value pairs inside the JSON payload. Some claim names are registered by RFC 7519 with precise meanings (iss, exp, aud), others are standardized by OpenID Connect for identity (email, nonce, auth_time), and the rest are public or private to your application. Verifying a token is mostly about validating these claims correctly: the wrong skew on exp, a skipped aud check, or trusting an unverified email are all real-world security holes. Search the reference above by claim name or keyword.
How it works
JWT claims live in the second segment (the payload) of a header.payload.signature token, base64url-encoded JSON. After verifying the signature with the issuer’s key, a validator must check the claims: exp and nbf are NumericDate integers (seconds since the Unix epoch) bounding the validity window; iss must match a trusted issuer; aud must include your service; and jti can be tracked to block replay. OpenID Connect layers identity claims on top — nonce ties an ID token to a specific auth request, auth_time supports max_age, and azp names the authorized party. Access tokens (RFC 9068) commonly add scope, client_id, and roles for authorization decisions.
Tips and examples
- Always validate the trio that prevents misuse: signature,
exp/nbf(with small skew), andaud. Skipping any one undermines the others. - Use
subas the stable user key, neveremailorpreferred_username, which can change or collide. - For replay-sensitive flows, persist seen
jtivalues until theirexpso a token cannot be used twice. - Gate identity trust on booleans: rely on
email_verifiedbefore linking accounts, and checkazpequals yourclient_idwhenaudhas multiple values.