JWT authentication, user management, and authorization for Bluefox apps
Project description
bluefox-auth
JWT authentication, user management, and authorization for Bluefox apps.
Part of the Bluefox Stack.
Install
uv add bluefox-auth
One-liner setup
from bluefox_core import BluefoxSettings, create_bluefox_app
from bluefox_auth import BluefoxAuth
settings = BluefoxSettings()
app = create_bluefox_app(settings)
BluefoxAuth(app, settings)
This mounts all auth routes under /auth, configures JWT tokens, sets up cookie + Bearer authentication, and wires CSRF protection.
Protect routes
from fastapi import Depends
from bluefox_auth import current_active_user, BluefoxUser
@app.get("/dashboard")
async def dashboard(user: BluefoxUser = Depends(current_active_user)):
return {"message": f"Hello, {user.email}"}
What you get
- User registration and login — bcrypt password hashing with timing-safe verification
- JWT access + refresh tokens —
jti,iat, audience claims, configurable expiry - Dual transport — Bearer header and HttpOnly cookies, auto-detected per request
- Refresh token rotation — family-based reuse detection revokes entire session on replay
- CSRF protection — plain double-submit cookie pattern, skipped for Bearer requests
- Password reset — stateless one-time-use tokens via async email hook
- Email verification — stateless one-time-use tokens via async email hook
- One-liner setup —
BluefoxAuth(app, settings)wires everything
Endpoints
| Endpoint | Method | Description |
|---|---|---|
/auth/register |
POST | Create a new user |
/auth/login |
POST | Authenticate and get tokens |
/auth/refresh |
POST | Rotate refresh token |
/auth/logout |
POST | Revoke token family |
/auth/me |
GET | Current user profile |
/auth/password-reset |
POST | Request password reset email |
/auth/password-reset/confirm |
POST | Confirm password reset |
/auth/email-verification |
POST | Request verification email |
/auth/email-verification/confirm |
POST | Confirm email verification |
Documentation
Full docs at bluefox-auth.bluefox.software/docs/
- Getting started — install and configure
- Security — how authentication and authorization work
- API auth guide — Bearer token flow
- Cookie auth guide — browser cookie flow
- Reference — API documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bluefox_auth-0.9.0.tar.gz.
File metadata
- Download URL: bluefox_auth-0.9.0.tar.gz
- Upload date:
- Size: 98.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea167b0c18b5428e8e8cabeb2a9509ffd87507e64369aa56d89d1c33ed866ea0
|
|
| MD5 |
0d6edbad7319d27693a22c0327ccadc9
|
|
| BLAKE2b-256 |
7f9fe7c42aec2801fe77af0af29697b86803e20a44bbb815a6ccf42fdf51fa53
|
Provenance
The following attestation bundles were made for bluefox_auth-0.9.0.tar.gz:
Publisher:
publish.yml on blue-fox-software/bluefox-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bluefox_auth-0.9.0.tar.gz -
Subject digest:
ea167b0c18b5428e8e8cabeb2a9509ffd87507e64369aa56d89d1c33ed866ea0 - Sigstore transparency entry: 1103130723
- Sigstore integration time:
-
Permalink:
blue-fox-software/bluefox-auth@216df2b90cc94230fa92be324e0ec028e69533ce -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/blue-fox-software
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@216df2b90cc94230fa92be324e0ec028e69533ce -
Trigger Event:
push
-
Statement type:
File details
Details for the file bluefox_auth-0.9.0-py3-none-any.whl.
File metadata
- Download URL: bluefox_auth-0.9.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d2d4ceb9a44465720bb17515928b0d89de68bf8e9aa4f39f7224f6d193e8935
|
|
| MD5 |
3e3689605fc4c830e38e98dd61fd2714
|
|
| BLAKE2b-256 |
ddf8177d4a6dc527a821f6f9e048c4bdcf23d7eb4c1e778ca90295d31f68ce25
|
Provenance
The following attestation bundles were made for bluefox_auth-0.9.0-py3-none-any.whl:
Publisher:
publish.yml on blue-fox-software/bluefox-auth
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
bluefox_auth-0.9.0-py3-none-any.whl -
Subject digest:
2d2d4ceb9a44465720bb17515928b0d89de68bf8e9aa4f39f7224f6d193e8935 - Sigstore transparency entry: 1103130846
- Sigstore integration time:
-
Permalink:
blue-fox-software/bluefox-auth@216df2b90cc94230fa92be324e0ec028e69533ce -
Branch / Tag:
refs/tags/v0.9.0 - Owner: https://github.com/blue-fox-software
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@216df2b90cc94230fa92be324e0ec028e69533ce -
Trigger Event:
push
-
Statement type: