Authentication Made Simple
Add a fully featured authentication and authorization system to your FastAPI project with JWT tokens, refresh tokens, scopes, and CSRF protection built-in.
Quick start
Get up and running with AuthX in minutes. Install the package and add authentication to your FastAPI app.
Configure AuthX
AuthXConfig instance with your JWT secret key and token location preferences.Explore by topic
Learn about AuthX features and how to integrate them into your application.
Token authentication
Scopes & permissions
Cookie authentication
Token revocation
Fresh tokens
Custom callbacks
Features
Everything you need for production-ready authentication.
JWT authentication
Secure token-based authentication with access and refresh tokens, customizable expiration, and multiple token locations.
Scope-based authorization
Fine-grained permission control with scopes, including wildcard matching and AND/OR logic for complex access rules.
Multiple token locations
Store tokens in headers, cookies, query parameters, or JSON body. Mix and match for different endpoints.
CSRF protection
Built-in CSRF protection for cookie-based authentication with customizable methods and verification.
Implicit refresh
Automatic token refresh middleware keeps users authenticated without manual refresh token handling.
Extra features
Extend with authx-extra for Redis caching, Prometheus metrics, and performance profiling integration.
Resources
Additional resources to help you build with AuthX.
Examples
API reference
GitHub
Ready to get started?
Add secure authentication to your FastAPI application in minutes with AuthX.
Get Started →