Base URL
How It Works
The JWT Revoker service:- Connects to KrakenD’s bloomfilter RPC server (running on
krakend:1234) - Uses the
jti(JWT ID) claim by default to identify tokens - Stores revoked token identifiers in a bloomfilter data structure
- Provides HTTP endpoints to add tokens to the revocation list and check if tokens are revoked
- The service constructs a key:
{claim_name}-{claim_value}(e.g.,jti-abc123) - This key is added to the bloomfilter
- KrakenD can check this bloomfilter to reject requests with revoked tokens
Endpoints
Add Token to Revocation List
Add a JWT to the revocation list by submitting itsjti claim value.
Form Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
jti | string | Yes | The JWT ID claim value to revoke |
Implementation Details
The endpoint (/images/jwt-revoker/main.go:28-34):
- Parses the form data to extract the claim value
- Constructs the subject key:
jti-{value} - Adds the key to the bloomfilter via RPC
- Redirects to the home page
Example Request
jti claim value a1b2c3d4-e5f6-7890-abcd-ef1234567890.
Response
Redirects to/ with HTTP status 302 Found.
Check If Token Is Revoked
Check whether a JWT is currently revoked by querying itsjti claim value.
Form Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
jti | string | Yes | The JWT ID claim value to check |
Implementation Details
The endpoint (/images/jwt-revoker/main.go:36-42):
- Parses the form data to extract the claim value
- Constructs the subject key:
jti-{value} - Checks the bloomfilter via RPC
- Returns
trueif revoked,falseotherwise
Example Request
Response
Returns a boolean value as plain text:Configuration
The JWT Revoker service accepts the following command-line flags:| Flag | Default | Description |
|---|---|---|
-server | krakend:1234 | IP:Port of the remote bloomfilter RPC server |
-key | jti | The name of the JWT claim to inspect for revocations |
-port | 8080 | Port to expose the HTTP service |
9000 and connects to the KrakenD bloomfilter on krakend:1234.
Web Interface
The service also provides a simple web interface athttp://localhost:9000/ where you can:
- Add tokens to the revocation list via a form
- Check if tokens are revoked via a form
Integration with KrakenD
To use the JWT Revoker with KrakenD:- Configure KrakenD with the bloomfilter middleware
- Configure the bloomfilter to use RPC mode (listening on port 1234)
- Use the JWT Revoker service to add tokens to the revocation list
- KrakenD will automatically reject requests with revoked JWTs