--- id: fastapi-auth0 version: "0.5.0" license: MIT license_treatment: permissive maintenance: dormant --- # fastapi-auth0 — Easy auth0.com integration for FastAPI License: permissive · Maintenance: dormant · Downloads: 130.4K/mo ## What it is and what it does fastapi-auth0 is a lightweight wrapper that connects FastAPI applications to Auth0's identity platform. It handles OAuth2 implicit flow authentication and automatically generates Swagger UI login controls, so users can sign in via social providers directly from the API documentation without requiring custom frontend code. The package provides an Auth0 class that manages authentication state and a Security dependency for protecting routes. It extracts user identity, permissions, and optionally email from Auth0 tokens and makes them available as Auth0User objects in your route handlers. Setup requires configuring your Auth0 tenant with the correct scopes and callback URLs, but once done, adding authentication to a route is a single-line dependency injection. Use it for: - Protect FastAPI endpoints with Auth0 authentication and scope-based authorization without writing custom OAuth2 logic. - Enable users to log in via social providers directly from Swagger UI interactive documentation. - Extract user identity and permissions from Auth0 tokens to enforce fine-grained access control in API routes. - Build applications where Auth0 manages user identity and role assignment across organizations. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates Auth0 authentication into FastAPI applications with automatic Swagger UI support for OAuth2 implicit flow, enabling social provider login without additional code. Yes, if you are already committed to Auth0 and FastAPI and need quick OAuth2 integration with Swagger UI support. No, if you require active maintenance, recent bug fixes, or compatibility with the latest FastAPI versions—the package has been dormant since late 2023 and may lag behind framework updates. Consider it a stable but unsupported tool suitable for mature, low-change applications. ## Install pip install fastapi-auth0 uv add fastapi-auth0 poetry add fastapi-auth0 ## Installing fastapi-auth0 Before you install: Low install friction with only two runtime dependencies (fastapi and python-jose). However, the package is dormant—last release was 2023-09-17 and no commits since 2024-12-16, so maintenance is minimal and bug fixes or compatibility updates are unlikely. License in practice: MIT license is permissive, allowing free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects. Quickstart: pip install fastapi-auth0 from fastapi import FastAPI, Depends, Security from fastapi_auth0 import Auth0, Auth0User auth = Auth0(domain='your-tenant.auth0.com', api_audience='your-api-identifier', scopes={'read:blabla': ''}) app = FastAPI() @app.get("/secure", dependencies=[Depends(auth.implicit_scheme)]) def get_secure(user: Auth0User = Security(auth.get_user, scopes=['read:blabla'])): return {"message": f"{user}"} Auth0 tenant must be configured with correct scopes and callback URL (http://localhost:8000/docs/oauth2-redirect for Swagger UI). Email field requires 'openid profile email' permission and 'Add email to access token' rule in Auth0. Verify before relying: - Whether the package remains compatible with current FastAPI and Auth0 API versions given its dormant maintenance status - Performance characteristics when handling high volumes of concurrent authentication requests - Whether email field extraction works reliably across all Auth0 tenant configurations ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 130.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags auth0 fastapi integration, oauth2 implicit flow fastapi, fastapi authentication auth0, social login fastapi, swagger ui oauth2 fastapi, fastapi auth0 user management, oauth2, identity-management [View on SkillFed](https://skillfed.io/packages/fastapi-auth0) · [View on PyPI](https://pypi.org/project/fastapi-auth0/)