$npx skillfedfor your agent

fastapi-login

Flask-Login like package for FastAPI

With conditionsPyPI Dynamic ContentReleased Dec 202485.1K downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — fastapi_login-1.10.3-py3-none-any.whl
v1.10.3 · released 2024-12-14 · Python <4.0,>=3.8 · 3 runtime deps: typing-extensions, fastapi, pyjwt

Yes, if you need straightforward JWT or cookie-based authentication in FastAPI without building token logic from scratch. The low install friction, permissive license, and stable API make it a practical choice. However, note the aging maintenance status—verify compatibility with your fastapi version and consider whether the package receives updates for security patches or breaking changes in its dependencies.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a secret key (generate via `import secrets; print(secrets.token_hex(24))`).
  • For OAuth2PasswordRequestForm, the python-multipart package is required.
  • Low install friction with a pure-Python wheel.

License · maintenance · safety

MIT (permissive) — MIT license is permissive; you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.

last release 2024-12-14 (608 days) · last repo commit 2025-05-20 · 820 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 85,141 downloads/mo, #13,946 on PyPI

Verify before relying

pip install fastapi-login

from fastapi import FastAPI, Depends
from fastapi_login import LoginManager

app = FastAPI()
manager = LoginManager('your-secret-key', token_url='/auth/token')

@manager.user_loader()
def load_user(email: str):
    return {'email': email}  # return user or None

@app.get('/protected')
def protected(user=Depends(manager)):
    return {'user': user}
  • Whether the aging maintenance status affects compatibility with the latest fastapi versions.
  • Performance characteristics under high-concurrency token validation loads.
  • Whether cookie-based auth is suitable for your deployment model (SPA vs. traditional server-rendered).
Same gist for agents: .md · .json

What it is and what it does

FastAPI-Login provides a Flask-Login-like authentication layer for FastAPI, handling JWT token creation, validation, and user session management. It wraps FastAPI's OAuth2 security model to let you protect routes with a simple dependency injection pattern, supporting both header-based bearer tokens and cookie-based sessions. The core workflow is: define a user loader callback, create tokens on login, then use the LoginManager as a route dependency to enforce authentication.

The package depends on fastapi, pyjwt, and typing-extensions. It supports Python 3.8 through 3.13 and runs on any OS. You provide the user lookup logic (database, in-memory store, etc.) and the package handles token lifecycle—encoding, decoding, expiration, and optional cookie management with HTTPOnly flags.

Use it for

  • Protect FastAPI routes with JWT bearer tokens, requiring users to authenticate before accessing sensitive endpoints.
  • Implement cookie-based login flows for traditional web applications served by FastAPI, with automatic HTTPOnly flag handling.
  • Build multi-user APIs where each request carries a user identity decoded from a signed token.
  • Add custom exception handling for unauthenticated requests, e.g., redirecting to a login page.
  • Manage token expiration policies per-request, e.g., short-lived access tokens with longer refresh windows.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

Yes, if you need straightforward JWT or cookie-based authentication in FastAPI without building token logic from scratch.

The low install friction, permissive license, and stable API make it a practical choice. However, note the aging maintenance status—verify compatibility with your fastapi version and consider whether the package receives updates for security patches or breaking changes in its dependencies.

Install

fastapi-login on PyPI

Before you install

Low install friction with a pure-Python wheel. Maintenance status is aging—last commit was 2025-05-20, with the latest release on 2024-12-14, though the repository remains active and not archived.

Requires a secret key (generate via `import secrets; print(secrets.token_hex(24))`). For OAuth2PasswordRequestForm, the python-multipart package is required.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in both open-source and commercial projects with minimal restrictions.

Quickstart

pip install fastapi-login

from fastapi import FastAPI, Depends
from fastapi_login import LoginManager

app = FastAPI()
manager = LoginManager('your-secret-key', token_url='/auth/token')

@manager.user_loader()
def load_user(email: str):
    return {'email': email}  # return user or None

@app.get('/protected')
def protected(user=Depends(manager)):
    return {'user': user}

Verify before relying

  • Whether the aging maintenance status affects compatibility with the latest fastapi versions.
  • Performance characteristics under high-concurrency token validation loads.
  • Whether cookie-based auth is suitable for your deployment model (SPA vs. traditional server-rendered).

Package facts

LicenseMIT permissive
Python supportSupports the current Python release <4.0,>=3.8
Install frictionLow. Pure-Python wheel
Runtime dependencies
3 packages
typing-extensionsfastapipyjwt
MaintenanceAging 608 days since the last release
Last repo commit
First released
Downloads85,141 / month, #13,946 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Evidence: fastapi_login-1.10.3-py3-none-any.whl

Tags

Capabilities
fastapi authenticationjwt token loginfastapi user sessionsbearer token authfastapi oauth2 loginfastapi cookie authenticationlogin manager fastapi
Topics
authenticationjwtsession-management

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “jwt token login”

  • fastapi-loginAdds session and token-based user authentication to FastAPI…
  • Flask-JWT-ExtendedAdds JSON Web Token (JWT) authentication to Flask applications,…
  • drf-jwtAdds JSON Web Token (JWT) authentication to Django REST Framework…

Give your agent the search over MCP, or paste the wish link into any chat.

More Dynamic Content packages

MarkupSafe Worth it
PyPI · Dynamic Content · released Sep 2025

MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.

BSD-3-Clausecompiled wheel · 3.9+aging
797.1Mdownloads / mo
Jinja2 Worth it
PyPI · Dynamic Content · released Mar 2025

Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.

BSD-3-Clausepure Python · 3.7+aging
718.6Mdownloads / mo
soupsieve Worth it
PyPI · Python Modules · released Aug 2026

Soupsieve is a CSS selector library designed to work with Beautiful Soup 4 to select, match, and filter HTML and XML elements using modern CSS selectors from CSS level 1 through CSS level 4 specifications.

Install it if you use Beautiful Soup for HTML or XML parsing and want modern CSS selector support.

MITpure Python · 3.10+
428.6Mdownloads / mo
Werkzeug Worth it
PyPI · Application Frameworks · released Apr 2026

Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.

BSD-3-Clausepure Python · 3.9+
268.1Mdownloads / mo
Flask Worth it
PyPI · Application Frameworks · released Feb 2026

Flask is a lightweight WSGI web application framework for building web applications in Python, from simple single-page sites to complex multi-route applications.

BSD-3-Clausepure Python · 3.9+
211.4Mdownloads / mo
Mako Worth it
PyPI · Dynamic Content · released Aug 2026

Mako compiles Python-embedded templates into Python modules for fast rendering, supporting layout inheritance, custom functions, and direct Python expressions within template syntax.

MITpure Python · 3.10+
201.7Mdownloads / mo

See also fastapi-auth0 · Flask-Login · fastapi-cloudauth · fastapi-users · propelauth-fastapi · fastapi-sessions · axioms-fastapi · fastapi-cognito · fastapi-sso · fastapi-csrf-protect