Validate OIDC ID tokens via JWKS discovery

domain: openid.net · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Fetch the provider's OpenID Connect discovery document from the well-known configuration URL (typically /.well-known/openid-configuration) to obtain the jwks_uri and issuer values
  2. Download the JSON Web Key Set from jwks_uri and cache it with a short TTL; implement cache-busting by re-fetching when a token arrives with an unrecognized kid
  3. Decode the ID token header (without verifying) to extract the kid and alg fields, then locate the matching key in the cached JWKS
  4. Verify the token signature using the selected public key and the algorithm declared in the header; reject tokens with alg=none or unexpected algorithms
  5. Validate standard claims: iss must equal the issuer from discovery, aud must contain your client_id, exp must be in the future, and iat must be reasonably recent
  6. If using nonce-based replay protection, verify the nonce claim matches the value you sent in the authorization request

Known gotchas

Related routes

Validate an LTI 1.3 id_token JWT from a platform using the platform's JWKS endpoint
imsglobal.org · 6 steps · unrated
Implement the LTI 1.3 platform-side OIDC login initiation endpoint and the tool's redirect_uri handler to validate the id_token JWT and extract custom claims
imsglobal.org · 6 steps · unrated
Implement and validate webhook signature verification for multiple IDV providers
identity-general · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans