Skip to content

Examples

The project examples live in the examples/ directory and are embedded into the documentation pages that describe each feature. This index gives you a quick map from example file to the relevant guide.

Example Shows Related guide
examples/basic.py Basic login flow with access-token protection Basic Usage
examples/json_transport.py HTTP JSON body token transport JSON Body Tokens
examples/websocket.py WebSocket auth via headers and query params WebSocket Usage
examples/optional.py Optional protection for mixed anonymous/authenticated routes Partially Protecting
examples/refresh.py Access and refresh token rotation Refresh Tokens
examples/freshness.py Fresh-token checks for sensitive routes Freshness Tokens
examples/denylist.py In-memory denylist callback Revoking Tokens
examples/denylist_redis.py Redis-backed denylist storage Revoking Tokens
examples/additional_claims.py Custom claims in token payloads Additional claims
examples/purpose.py Local vs public token purpose Token Purpose
examples/footer_assertion.py Footers and implicit assertions Footers and Assertions
examples/overrides.py Route-level transport overrides Per-route Overrides
examples/validation.py Issuer, audience, base64, and custom token types Validation and Custom Types
examples/generate_doc.py Manual OpenAPI customization Generate Documentation
examples/multiple_files/ Multi-module application layout Bigger Applications