Alpha on PyPI
Authentication, inside your FastAPI app.
Install the library, mount the routers, and keep every user, role, and audit event in your Postgres. Start with simple RBAC and grow into org-aware authorization without moving your identity layer.
main.pyFastAPI
from outlabs_auth import SimpleRBAC
auth = SimpleRBAC(
database_url=DATABASE_URL,
secret_key=SECRET_KEY,
)
auth.prime_fastapi_routing()
app.include_router(
get_auth_router(auth, prefix="/auth")
)Mounted
/auth/*
Your database
PostgreSQL
Protected
Typed dependencies
Built for the Python stack you already operate
Own the control plane
Your auth should feel like part of your product
OutlabsAuth runs inside the boundary you already trust. There is no second tenant to reconcile, no remote policy engine in the request path, and no user export waiting in your future.
- Mounted in your appChoose the router prefix and expose only the auth surfaces your product needs.
- Stored in your PostgresUsers, sessions, roles, entities, and audit events stay in infrastructure you operate.
- Enforced in PythonTyped FastAPI dependencies keep authorization beside the code they protect.
One core, two authorization models
Start simple. Keep the headroom.
Choose the model that matches your product today. Both presets share the same authentication, invitation, API key, and dependency patterns.
A complete auth surface
Mount the capabilities your product needs
Every surface is available through composable router factories, so you can start small and add features without changing the foundation.
JWTs & sessions
Access and refresh tokens, optional rotation, and session management for account-security screens.
Read more
OAuth & social login
Provider login and account linking through routers you opt into and configure.
Read more
Invites & passwordless
Email invites, magic links, and phone codes while you keep control of message delivery.
Read more
API keys
Personal and system-integration keys with host-friendly hashing and management APIs.
Read more
Optional operator UI
See the system before you build the admin screens
OutlabsAuth UI connects to any mounted host and adapts to the routers it exposes. Use it as your operator console or as a working reference for a UI of your own.
Operator console
Connected to /auth/config
1,284
Users
12
Roles
48
Entities
326
Active sessions
Documentation
Take the shortest path to working auth
The handbook is organized around the decisions and implementation steps you will make first.
Pick the right preset
Choose flat RBAC or hierarchical authorization without guessing at the trade-offs.
Mount only what you need
Explore every router, prefix, and HTTP surface available to your application.
Put auth inside your app
Install the alpha from PyPI, mount your first router, and keep control of the system from day one.