Auth0 exposes a JWKS endpoint for each tenant, which is found at
https://{yourDomain}/.well-known/jwks.json. This endpoint will contain the JWK used to verify all Auth0-issued JWTs for this tenant.
Cache the JSON Web Key Set
We recommend that you cache the JWKS your application retrieves from the JWKS endpoint, as this will:- Avoid consuming your tenant’s rate limits with repeated requests.
- Improve performance by avoiding a network request to the JWKS endpoint on every token validation.
- Improve resiliency, so your application can continue validating tokens if the JWKS endpoint is briefly unavailable.
kid and rate limiting refetches. For example, our Quickstarts use libraries that handle this for you.
To avoid the development and maintenance burden, we recommend against implementing caching yourself. However, if your use case requires it, you can follow this guidance:
- Cache the JWKS for 5-10 minutes to avoid fetching it on every request. Longer intervals further reduce requests and latency.
- When you rotate signing keys, Auth0 signs new tokens with the new key. If you receive a token whose key ID (
kid) is not in your cached JWKS, invalidate your cache and fetch the JWKS again to retrieve the new key. Refreshing on an unknownkidrather than the cache lifetime lets your application pick up rotated keys promptly. This way, a longer cache interval does not delay rotation. - Limit how often you refetch on a cache miss (for example, retry only once) so that a batch of tokens signed with unknown keys cannot trigger a flood of requests to the JWKS endpoint and consume your rate limits. Set your cache interval based on how quickly you need to stop accepting tokens signed with a manually revoked key.