Skip to main content

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.

Documentation · PyPI


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 tokensjti, 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 setupBluefoxAuth(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/

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bluefox_auth-0.9.0.tar.gz (98.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bluefox_auth-0.9.0-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

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

Hashes for bluefox_auth-0.9.0.tar.gz
Algorithm Hash digest
SHA256 ea167b0c18b5428e8e8cabeb2a9509ffd87507e64369aa56d89d1c33ed866ea0
MD5 0d6edbad7319d27693a22c0327ccadc9
BLAKE2b-256 7f9fe7c42aec2801fe77af0af29697b86803e20a44bbb815a6ccf42fdf51fa53

See more details on using hashes here.

Provenance

The following attestation bundles were made for bluefox_auth-0.9.0.tar.gz:

Publisher: publish.yml on blue-fox-software/bluefox-auth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for bluefox_auth-0.9.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d2d4ceb9a44465720bb17515928b0d89de68bf8e9aa4f39f7224f6d193e8935
MD5 3e3689605fc4c830e38e98dd61fd2714
BLAKE2b-256 ddf8177d4a6dc527a821f6f9e048c4bdcf23d7eb4c1e778ca90295d31f68ce25

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page