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.1.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.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file bluefox_auth-0.9.1.tar.gz.

File metadata

  • Download URL: bluefox_auth-0.9.1.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.1.tar.gz
Algorithm Hash digest
SHA256 f9f0f3f662f3a6ae3ccf4e5f57fbc3cc1f036145ca1964a9dfb19ea835d5a5e7
MD5 bc12e26471b5c21370fd39fed957140d
BLAKE2b-256 2a13b432c2e6b82bee9e2dd51320f946d35ac10bb9a8694d318802c4ad4a6e2a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bluefox_auth-0.9.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: bluefox_auth-0.9.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 03b8a9c22896665a3b954c1481c486a64e80a0e9c2329c3883aede61cbfb63a6
MD5 c0220ed282b15cb84d7b04adc4a4fb50
BLAKE2b-256 0d7cf264412e971831c370035eb18cf0d027fb8f8799ae135745044decbfa236

See more details on using hashes here.

Provenance

The following attestation bundles were made for bluefox_auth-0.9.1-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