Skip to main content

FastAPIOAuthRBAC

PyPI version Downloads Downloads Month

A comprehensive FastAPI library for Authentication and NIST-style Role-Based Access Control (RBAC).


📖 Complete Documentation

The documentation has been significantly improved and split into easy-to-digest resources:


🛠️ Examples

Check out the examples/ directory for practical implementations:

  • basic_app.py: Standard implementation.
  • multi_tenancy.py: [NEW] Scoping users and roles to tenants.
  • advanced_extension.py: [NEW] Custom User models, Hooks, and Email services.
  • testing_example.py: [NEW] How to test your protected routes.

Quick Start (Minimal)

from fastapi import FastAPI
from fastapi_oauth_rbac import FastAPIOAuthRBAC

app = FastAPI()

# Initialize with default settings or your own Settings object
auth = FastAPIOAuthRBAC(app)

# Explicitly include the routes you want
auth.include_auth_router()
auth.include_dashboard()

📦 Installation Extras

# For PostgreSQL support
pip install "fastapi-oauth-rbac[postgres]"

# For SQLite support (async)
pip install "fastapi-oauth-rbac[sqlite]"

Features

  • Asynchronous: Full support for aiosqlite, asyncpg, etc.
  • NIST RBAC: Advanced Role-Based Access Control with hierarchy.
  • Full Auth Flow: Login, Signup, OAuth (Google), and Global Logout.
  • Premium Dashboard: Manage users and roles through a beautiful glassmorphism UI.

License

MIT

Metadata

Release files for fastapi-oauth-rbac 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapi-oauth-rbac 0.2.0
File Size Uploaded Provenance Actions
fastapi_oauth_rbac-0.2.0.tar.gz 29.7 kB Without provenance Details for fastapi_oauth_rbac-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-oauth-rbac 0.2.0
File Interpreter ABI Platform Actions
fastapi_oauth_rbac-0.2.0-py3-none-any.whl Python 3 none any Details for fastapi_oauth_rbac-0.2.0-py3-none-any.whl

Total release size: 72.2 kB

Release files / fastapi_oauth_rbac-0.2.0.tar.gz

Download URL fastapi_oauth_rbac-0.2.0.tar.gz
Size 29.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6d29b459eed5831c0998d242b2631b9530ef405c46d3ab12c97376fdd427318c
BLAKE2b-256 checksum
How to use checksums
ab9264ce4296a69906ea0b1fc4c397c46c94f595c554ec5e25a2303dd196ac0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Release files / fastapi_oauth_rbac-0.2.0-py3-none-any.whl

Download URL fastapi_oauth_rbac-0.2.0-py3-none-any.whl
Size 42.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
51cd24a335d0db2b3cf8b52839e9ebbf76092d7606dcbcad3ea28e6a8c1b78d9
BLAKE2b-256 checksum
How to use checksums
922cf0438e9bef42fcb95126a8ad2d6bb5a1cf0ab3e96e2f7f0c0e3f79c32478
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.2

Security for fastapi-oauth-rbac 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page