Skip to content

Open Source Authentication

Auth for Python,
built for production.

pip install authfort
pip install authfort-service
npm install authfort-client
Python

authfort

Full auth server — user management, JWT tokens, OAuth providers, roles, sessions, JWKS, and event hooks.

pip install authfort
Python

authfort-service

Lightweight JWT verifier for microservices. Validates tokens via JWKS without database access.

pip install authfort-service
TypeScript

authfort-client

TypeScript SDK for browsers and mobile. Token refresh, 401 retry, and auth state with React, Vue, and Svelte integrations.

npm install authfort-client
🔐

JWT RS256

Stateless access tokens with automatic RSA key management and rotation.

🔗

OAuth 2.1 + PKCE

Built-in and generic providers with automatic account linking by email.

🛡️

Role-Based Access

Add, remove, and require roles. Works as FastAPI dependencies.

📋

Session Management

List sessions, revoke individual or all. "Sign out other devices" built in.

📡

Event Hooks

15 event types — user_created, login, password_reset, role_added, and more.

🗄️

Multi-Database

PostgreSQL, SQLite, and MySQL via SQLAlchemy. Zero config migrations.

main.py
from authfort import AuthFort, CookieConfig
from fastapi import FastAPI, Depends

auth = AuthFort(
    database_url="postgresql+asyncpg://user:pass@localhost/mydb",
    cookie=CookieConfig(),
)

app = FastAPI()
app.include_router(auth.fastapi_router(), prefix="/auth")
app.include_router(auth.jwks_router())

@app.get("/api/profile")
async def profile(user=Depends(auth.current_user)):
    return {"email": user.email, "roles": user.roles}
from authfort import AuthFort, CookieConfig
from fastapi import FastAPI, Depends

auth = AuthFort(
    database_url="postgresql+asyncpg://user:pass@localhost/mydb",
    cookie=CookieConfig(),
)

app = FastAPI()
app.include_router(auth.fastapi_router(), prefix="/auth")
app.include_router(auth.jwks_router())

@app.get("/api/profile")
async def profile(user=Depends(auth.current_user)):
    return {"email": user.email, "roles": user.roles}

This gives you /auth/signup, /auth/login, /auth/refresh, /auth/logout, /auth/me, OAuth endpoints, /.well-known/jwks.json, and /introspect — all out of the box.