β‘ Reduce backend load by rejecting unauthorized requests early.
π‘ Protect APIs from unauthorized access without modifying your upstream services.
π What are the benefits of validating JWTs?
JWTs are commonly used in OAuth 2.0, OpenID Connect (OIDC), and API authentication flows. However, simply including a JWT in a request doesnβt improve security. It must be verified to ensure:- The token is properly signed by a trusted provider.
- The token hasnβt expired.
- The token contains the correct claims (for example, roles, permissions).
- Enforcing authentication: Ensure only authenticated users can access protected resources.
- API security & access control: Validate JWT claims to enforce role-based access (RBAC) or tenant restrictions.
- Single sign-on (SSO) support: Accept tokens from OAuth, OpenID Connect (OIDC), or enterprise identity providers.
- Reducing backend load: Offload JWT validation to the network edge, reducing unnecessary authentication checks.
JWT validation examples
The following Traffic Policy configuration is an example configuration of the jwt-validation action. For a more real-world example, check out the Auth0 guide. jwt.io provides a useful tool for working with JWTs. Check out the JWT validation Traffic Policy action page for more details about how it functions and the parameters it accepts.- AgentEndpoint
- CloudEndpoint
- Ingress
- Gateway API