Skip to content

Latest commit

 

History

History
38 lines (27 loc) · 1.8 KB

README.md

File metadata and controls

38 lines (27 loc) · 1.8 KB

mock-jwks-server

Testing JWKS is a pain. This is a simple server that serves a JWKS for testing purposes. It is based on mock-jwks.

Usage

You can run the server directly with bun.

bun run start

Can be used with Docker as well.

docker run -p 3000:3000 sirion182/mock-jwks-server:tagname

When started the server will serve the JWKS at the JWKS_PATH like http://localhost:3000/.well-known/jwks.json.

To sign a token use the /sign endpoint. The endpoint expects a POST request with a JSON body containing the token. It will return a signed token.

curl -X POST \
     -H 'Content-Type: application/json' \
     -d '{ "title":"foo","body":"bar", "id": 1, ' \
     localhost:3000/sign

Configuration

name env arg doc nullable default
jwksPath JWKS_PATH jwksPath The path to the JWKS endpoint false "/.well-known/jwks.json"
jkuHeaderValue JKU_HEADER_VALUE jkuHeaderValue If defined the value for the JKU header will be set to this value. If not defined the header will not be set. true "https://localhost:3000/jwks"
jwksOrigin JWKS_BASE jwksOrigin The origin for the certificate true null