Antonio Braccolino, Identity & Access, home
EN · Language: English
← All terms

IAM glossary

What is JWKS?

JSON Web Key Set

The public keys of an identity provider, published as JSON. Apps use the kid in the token header to pick the right key and verify the signature.

How it works

A JSON Web Key Set is a JSON document with the public keys an issuer uses to sign its tokens. It is published at the jwks_uri listed in the discovery document. Each key has an id (kid), a type (kty, for example RSA or EC) and its public values.

When a token arrives, the receiver reads the kid in the token header, finds the matching key in the JWKS and verifies the signature. Publishing several keys at once lets the issuer rotate keys without downtime: the new key is added before it is used, the old one removed after tokens signed with it have expired.

A simple example

An API receives a token whose header says "kid": "2026-10". Its cached JWKS has keys 2026-07 and 2026-10, so it verifies with the second. The next week a token arrives with "kid": "2027-01", unknown: the API downloads the JWKS again, finds the new key and carries on.

Common mistakes

  • Downloading the JWKS on every request (slow) or never refreshing it (breaks at rotation).
  • Accepting a key URL taken from the token itself (jku, x5u) without checking it belongs to the trusted issuer.
  • Publishing private key parameters by mistake.

See it at work