JWT Validation
FastGateway supports JWT (JSON Web Token) validation to secure your APIs. Tokens are read from the Authorization: Bearer <token> header.
Configure in the UI
- In the route builder, open the Security tab and keep General mode.
- Expand JWT Validation and check Enable JWT Validation.
- Fill in the fields below:
- Issuer: the expected
issclaim, matching your identity provider. - JWKS URL: where the provider publishes its public keys.
- Audiences (optional): type an audience and click Add. Repeat for each one. If set, the token must contain one of these.
- Issuer: the expected
- Submit the route for approval. Once approved, the change deploys.
JWT Settings
| Field | Description |
|---|---|
| Issuer | Expected token issuer (iss claim) |
| JWKS URL | URL to fetch the JSON Web Key Set |
| Audiences | Expected token audiences (aud claim), optional |
Claims to Headers
JWT claims can be forwarded to your backend as request headers (for example sub to X-User-ID). This mapping is part of the route's JWT policy. See the API Reference for the claim-to-header fields.
Request Example
curl -H "Authorization: Bearer eyJhbGciOiJSUzI1NiIs..." \
https://api.example.com/protected
Validation Process
- Extract the token from the
Authorization: Bearer <token>header. - Validate the signature using the JWKS.
- Verify the issuer matches the configured value.
- Verify the audience includes a configured value (when audiences are set).
- Check token expiration (exp claim).
- Forward configured claims as headers.
Client Mode
In Client-Based mode, JWT is configured per client on the client's JWT tab, then enabled when you attach the client to the route. See Client Management.