Validation and trust
Every check an application makes before it trusts an ID token, and how signing keys are found and rotated.
Start with Validating an ID token
- Validating an ID tokenWork through every check a relying party makes before trusting an ID token, in order, and see how it differs from validating a JWT access token at an API.
- Issuer, audience, and authorized partyCompare the issuer exactly, require the client ID in the audience, reject tokens meant for other clients or shared with untrusted ones, and decide what azp means.
- Expiration and nonce checksCheck exp, iat, and nbf with a small clock tolerance, tell authentication time apart from issue time, and match the nonce to one pending sign-in exactly once.
- Signing keys and rotationFind the provider's signing key in a trusted key set, accept only the algorithms registered for the client, and keep sign-ins working through planned and emergency key changes.
- When validation failsTell configuration mistakes, clock drift, key set outages, and attacks apart, show people a safe message, log what diagnoses the fault, and avoid fixes that remove protection.