A Singapore Government Agency Website

Creating JWKS Endpoint

This is a prerequisite for creating an OAuth 2.1 Client or JWT-Auth Application.

Setting up JWT Auth? The interactive walkthrough shows this step and the ones that follow.

Setting up OAuth 2.1? The OAuth 2.1 interactive walkthrough covers this step and the ones that follow.

The JWKS is a set of keys containing the public keys used to verify any JSON Web Token (JWT). Generate a set of asymmetric private and public keys for signing of claims for connecting to Authorization Server using EC (P-256).

An example of an online key generator can be found with this tool, and sample code can be found in this section. Save the private key. You will need it for JWT signing in later steps.

Host the JWKS generated in the previous step on a publicly accessible URL. You will use the key-id (‘kid’) in later requests. Information on JWK Set format and JWK formats can be found in RFC7517. The keys ‘kid’ and ‘use’ may have to be manually added.

Sample JWKS Endpoint

(eg. https://{consumer_domain}/.well-known/keys.json)

{
 "keys": [
  {
   "kty": "EC",
   "kid": "my-key-id-1",
   "crv": "P-256",
   "alg": "ES256",
   "use": "sig",
   "x": "<x-coordinate>",
   "y": "<y-coordinate>"
  }
 ]
}
Chat with me!
Bot Launcher