Start
Quick start
A complete app with login, refresh tokens, registration, roles, and protected routes, in three steps.
What you will have at the end: a running FastAPI app with 19 auth
endpoints, password hashing, an admin account, and a protected route — in one
file, in about five minutes. Every endpoint will be visible and testable at
/docs.
First time building auth, or FastAPI itself is new to you? Take the easy mode guide: one file, five minutes, every step checked.
Install the package
Wire FastAuth into your app
Protect your routes
Run uv run fastapi dev main.py and open /docs. Every endpoint is there,
documented and ready to try.
Where to go next#
- Authentication covers tokens, protected routes, and cookies in depth
- Roles explains the six standard roles and the role management API
- Production is the checklist to work through before you deploy