https://github.com/evertras/jwt-issuer
A bare minimum service that issues JWTs with a JWKS endpoint for validation
https://github.com/evertras/jwt-issuer
Last synced: about 1 year ago
JSON representation
A bare minimum service that issues JWTs with a JWKS endpoint for validation
- Host: GitHub
- URL: https://github.com/evertras/jwt-issuer
- Owner: Evertras
- License: mit
- Created: 2020-01-17T06:23:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-01-17T08:54:42.000Z (over 6 years ago)
- Last Synced: 2025-02-12T06:38:02.062Z (over 1 year ago)
- Language: Go
- Size: 13.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jwt-issuer
A bare minimum service that issues JWTs with a JWKS endpoint.
This is meant for simple testing/demo, not production, so everything is as simple
and self-contained as possible with as little fluff as possible.
Generates a fresh ECDSA key pair on every execution.
## Docker
This has been built/pushed as `evertras/jwt-issuer`. Expose port 8080 when using.
```bash
docker run --rm -it -p 8080:8080 evertras/jwt-issuer
```
## Endpoints
### /generate
Generates a new token. A private claim of "UserID" is added.
```bash
# Generates a new token
curl -s localhost:8080/generate
# Generates a new token and stores the token in TOKEN
export TOKEN = $(curl -s localhost:8080/generate)
# Generates a new token with the username myfakeid
curl -s -H "X-User-ID: myfakeid" localhost:8080/generate
```
### /check
Checks a token given in the Authorization header as a bearer token. Returns 200
if valid and writes the token data in the response body, returns 401 otherwise.
### /jwks
Returns the JSON jwks object for the generated public key.