Skip to main content
JWT Authentication Middleware with optional RBAC (Role-Based Access Control) for AgentOS.

Import

JWTMiddleware Parameters

TokenSource Enum

Default Excluded Routes

Usage

Basic JWT Validation

JWT with RBAC Authorization

JWT from Cookies

Parameter Injection

Using JWKS File

The JWKS file should have the standard format:

Custom Scope Mappings

Request State

After processing, the middleware stores the following in request.state:

Error Responses

See Also