Configuration reference
The Traffic Policy configuration reference for this action.Supported phases
on_http_request
Type
jwt-validation
Configuration fields
Configuration object for the Issuer(s) of the JWTs.
Configuration object for the Audience(s) of the JWTs.
Configuration object for the HTTP requests containing JWTs.
Configuration object for signed JWTs (JWS).
Behavior
Request validation
The request is allowed only if it has been correctly signed by the issuer and the defined claims match. For efficient validation of tokens, it is recommended to include the optionalkid claim in your JWTs and JWK payload.
Custom validation can be implemented in Traffic Policies via the
actions.ngrok.jwt_validation.tokens Action Result Variable and its
corresponding properties.
Multiple issuers
You can specify multiple issuers for JWT validation. A request is considered validated if it presents a JWT signed by any of the specified issuers. The issuer must exactly match the one provided in the JWT, including any trailing slashes (/) present in the iss claim.
Multiple audience claims
You can optionally specify one or more audience (aud) claims for JWT validation.
If present, the aud claim must contain at least one of the specified audience claims and
exactly match for validation to succeed.
Multiple signing keys
You can provide multiple JSON Web Key Set (JWKS) URLs and signing algorithms. During JWT validation the list of JWKS and algorithms provided will be used in an attempt to validate the JWT. The list will be tried in order and is cached for performance. The cache is refreshed roughly every 15 minutes.Multiple tokens
If multiple tokens are defined within the HTTP configuration parameter, all tokens must be present in the request. If all tokens are not present, a401 Unauthorized status code will be returned.
Non-terminating action
This is a Non-terminating action. It does not return a response, and will allow Traffic Policy processing to continue to the next Action in the chain. All Cloud Endpoint Traffic Policies must end with a terminating action. This requirement does not apply to Agent Endpoints.Examples
Basic example
The following Traffic Policy configuration is an example configuration of thejwt-validation action. For a
more real-world example, check out the Auth0 guide.
Example Traffic Policy document
Example request
Authorization header with the Bearer prefix and getting back a 200 OK
response.
Action result variables
The following variables are made available for use in subsequent expressions and CEL interpolations after the action has run. Variable values will only apply to the last action execution, results are not concatenated.The list of JSON Web Tokens (JWTs) processed by the action.
A machine-readable code describing an error that occurred during the
action’s execution.
A human-readable message providing details about an error that occurred
during the action’s execution.