--- id: propelauth-fastapi version: "4.4.0" license: MIT license_treatment: permissive maintenance: active --- # propelauth-fastapi — A FastAPI library for managing authentication, backed by PropelAuth License: permissive · Maintenance: active · Downloads: 196.2K/mo ## What it is and what it does This package bridges PropelAuth's cloud-hosted authentication service with FastAPI applications. It provides FastAPI dependency functions that verify access tokens locally (without external requests) and extract user identity and organization membership information. The library handles both required and optional user authentication, and exposes methods to check organization membership, user roles, and permissions within organizations. The package is designed for B2B and multi-tenant applications where you want to offload authentication UI and credential management to PropelAuth while keeping authorization logic in your FastAPI code. It wraps the underlying propelauth-py client and integrates it with FastAPI's dependency injection system, so you protect routes by adding a dependency parameter rather than writing custom middleware. Use it for: - Protect FastAPI routes by requiring a valid user token and extracting the User object for authorization checks. - Build multi-tenant SaaS applications where you verify users belong to specific organizations and have required roles. - Implement fine-grained access control by checking user permissions within an organization before allowing an action. - Create optional authentication endpoints that return user info if a token is present, or an empty response if not. - Call PropelAuth backend APIs directly (e.g., create magic links, fetch users) from your FastAPI application. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Integrates PropelAuth's authentication and authorization service into FastAPI applications, providing user verification, token validation, and role/permission checking through FastAPI dependencies. Yes, if you are building a FastAPI application and have committed to using PropelAuth for authentication. The package is actively maintained, has no known vulnerabilities, and low install friction. It is not suitable if you need a self-hosted or alternative authentication provider. ## Install pip install propelauth-fastapi uv add propelauth-fastapi poetry add propelauth-fastapi ## Installing propelauth-fastapi Before you install: Low friction installation with a pure Python wheel. The package is actively maintained with a recent release (113 days ago) and no known vulnerabilities. Requires current Python versions (3.9+). License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and proprietary projects with minimal obligations. Quickstart: pip install propelauth_fastapi from fastapi import FastAPI, Depends from propelauth_fastapi import init_auth, User app = FastAPI() auth = init_auth("YOUR_AUTH_URL", "YOUR_API_KEY") @app.get("/") async def root(current_user: User = Depends(auth.require_user)): return {"user_id": current_user.user_id} Requires a PropelAuth account and valid AUTH_URL and API_KEY credentials to initialize. Verify before relying: - Performance characteristics of token verification at scale or under high request volume. - Compatibility with specific FastAPI versions or async patterns beyond the documented examples. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 196.2K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags fastapi authentication, propelauth integration, fastapi user verification, token validation fastapi, fastapi authorization roles, multi-tenant auth fastapi, fastapi access control, authentication, multi-tenant, fastapi-integration [View on SkillFed](https://skillfed.io/packages/propelauth-fastapi) · [View on PyPI](https://pypi.org/project/propelauth-fastapi/)