skillfed

propelauth-fastapi

A FastAPI library for managing authentication, backed by PropelAuth

propelauth-fastapi v4.4.0 196.2K downloads/30d#9,794 on PyPI18
Permissive license MIT Active released

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 on this page — 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

propelauth-fastapi on PyPI

pip

pip install propelauth-fastapi

uv

uv add propelauth-fastapi

poetry

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 the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 4 — fastapi, httpx, propelauth-py, requests
Maintenance actively maintained — 113 days since the last release
Last repo commit
First released
Downloads 196,181/month — #9,794 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: propelauth_fastapi-4.4.0-py3-none-any.whl

Tags

fastapi authenticationpropelauth integrationfastapi user verificationtoken validation fastapifastapi authorization rolesmulti-tenant auth fastapifastapi access control
authenticationmulti-tenantfastapi-integration

More WWW/HTTP packages