cloudflare / cloudflare/serverless-registry

Feature: Add support for JWKS

Open
#105 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
1.5k
Forks
122
PR merge metrics
No merged PRs in 30d

Description

Right now, you can use a single JWT public key to validate access tokens, which is an improvement over plain credentials already. What would be even better (and aligned with web standards), would be support for [JSON Web Key Sets (JWKS)](https://auth0.com/docs/secure/tokens/json-web-tokens/json-web-key-sets).
Such a key set is an array of public keys used to issue tokens; on its own, that allows rotating the public keys already. More importantly though, the JWKS is usually available on a public URL, which in turn can be located using the `jwks_uri` property returned by the [standardised OpenID Discovery Endpoint](https://swagger.io/docs/specification/v3_0/authentication/openid-connect-discovery/) (specified as `{host}/.well-known/openid-configuration`.)

In practice, this means users could configure their authorization server host or discovery URL, the service retrieves (and caches) the metadata document from the endpoint, reads the JWKS URI from the response, retrieves (and caches) the public keys from this URI, and validates tokens against each key in the set.

JWKS and OpenID Discovery is supported by all major authentication providers and client libraries, so this would enable a lot of people to configure the URL once, and don't have to worry about key rotations and expiration anymore.

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by locating the existing single-JWT-public-key validation and configuration, then trace how discovery metadata, JWKS retrieval, caching, key rotation, and token validation would fit together; done means users can configure a host or discovery URL and validate tokens against the discovered key set.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, authentication, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.