JWT Cookie Security Scheme¶
- class JWTCookieSecurity(authentication_token: str, scheme_name: str | None = None, *, auto_error: bool = True)[source]¶
Bases:
SecurityBaseFastAPI security scheme for identifying a JWT authentication token.
This scheme extracts the JWT from an HTTP-only cookie. It implements the __call__ protocol to function as a FastAPI dependency and provides necessary metadata for OpenAPI documentation.
—
Public Instances¶
The following instances of app.lib.auth.JWTCookieSecurity are exported for use as FastAPI dependencies:
- app.lib.auth.access_token = JWTCookieSecurity(authentication_token="access_token")¶
- app.lib.auth.refresh_token = JWTCookieSecurity(authentication_token="refresh_token")¶