Skip to content

mocks a jwks server, which can sign a token and provide jwks for such token

Notifications You must be signed in to change notification settings

sengmann/mock-jwks-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

mocks a jwks server, which can sign a token and provide jwks for such token

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published