JWKS

The JWKS endpoint provides public keys for verifying JWT signatures.

JWKS Endpoint

GET /.well-known/jwks.json

Returns the public keys used to sign tokens.

Response

{
  "keys": [
    {
      "kty": "RSA",
      "kid": "authority-key-1",
      "use": "sig",
      "alg": "RS256",
      "n": "0vx7agoebGcQSuuPiLJXZpt...",
      "e": "AQAB"
    }
  ]
}

Key Properties

Property
Description

kty

Key type (RSA)

kid

Key ID (used in JWT header)

use

Key usage (sig for signing)

alg

Algorithm (RS256)

n

RSA modulus (Base64URL)

e

RSA exponent (Base64URL)

Token Verification

JavaScript

Python

Go

Key Matching

JWTs include the key ID in the header:

Match this kid with the key in JWKS.

Caching

JWKS should be cached to avoid excessive requests:

Key Rotation

Authority may rotate keys periodically:

  1. New key added to JWKS

  2. New tokens signed with new key

  3. Old key remains for existing token validation

  4. Eventually old key is removed

Your verification code should:

  • Cache JWKS but refresh periodically

  • Handle multiple keys in the set

  • Match key by kid from token header

Manual Verification

Next Steps

Last updated

Was this helpful?