| Crates.io | jwkserve-cli |
| lib.rs | jwkserve-cli |
| version | 0.8.0 |
| created_at | 2025-10-19 19:17:25.948597+00 |
| updated_at | 2025-10-25 17:10:31.312808+00 |
| description | CLI tool for jwkserve - a fake authentication service for local development |
| homepage | |
| repository | https://github.com/sbstjn/jwkserve |
| max_upload_size | |
| id | 1890813 |
| size | 50,516 |
A fake authentication service to speed up local development for JWT consumers.
This HTTP server provides several endpoints for JWT development:
GET / - Health check and service statusGET /.well-known/openid-configuration - OpenID Connect discoveryGET /.well-known/jwks.json - JSON Web Key SetPOST /sign - Generate JWT tokensAlso available as sbstjn/jwkserve on DockerHub for easy usage. See jwkserve for the library; contribution is possible via sbstjn/jwkserve on GitHub.
$ > cargo install jwkserve-cli
# Start the service
$ > jwkserve
# In another terminal, test the endpoints
$ > curl http://localhost:3000/
$ > curl http://localhost:3000/.well-known/jwks.json
$ > curl http://localhost:3000/.well-known/openid-configuration
When having jwkserve running, you can generate a JWT with matching signature using curl e.g.
$ > curl -X POST http://localhost:3000/sign \
-H "Content-Type: application/json" \
-d '{
"aud": "my-app",
"exp": 1735689600,
"iat": 1704067200,
"iss": "my-issuer",
"nbf": 1704067200,
"sub": "user-12345"
}'
{"token":"eyJ0eXAiOiJKV1QiLCJhbGciOiJSUz …"}
Note: If the
issfield is not set in your request, it will be automatically added matching theWEB_ISSUERenvironment variable.
You can configure the service using environment variables:
APP_HOST - HTTP listener host (default: 0.0.0.0)APP_PORT - HTTP listener port (default: 3000)KEY_FILE - Path to existing PKCS8 private key file (optional)On start, the binary will generate a random 2048-bit RSA private key if no KEY_FILE is provided.
# Basic usage
$ > jwkserve
# With custom host and existing key
$ > KEY_FILE=fixtures/test-key-pkcs8.pem \
jwkserve