A FastAPI extension providing user session management and authentication similar to Flask-Login.
FastAPI-Login is a lightweight authentication library for the FastAPI web framework. It simplifies user session management and login flow by providing JWT-based authentication and route protection with minimal setup, bringing Flask-Login-like functionality to FastAPI.
FastAPI developers who need to add secure, stateless user authentication to their web applications or APIs without heavy dependencies. It's particularly suited for those familiar with Flask-Login seeking similar simplicity in the FastAPI ecosystem.
Developers choose FastAPI-Login for its minimalistic design and ease of integration, offering essential features like JWT handling, cookie support, and OAuth2 compatibility with FastAPI's dependency injection system, reducing boilerplate code compared to building authentication from scratch.
FastAPI-Login tries to provide similar functionality as Flask-Login does.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides easy JWT creation and validation with configurable expiration via the create_access_token method, as shown with timedelta for custom durations.
Secures endpoints using FastAPI's dependency injection, requiring only Depends(manager) to access user data, reducing boilerplate code.
Allows custom user_loader callbacks to integrate with any database, demonstrated with a fake dictionary example for retrieval logic.
Enables secure cookie-based tokens with HTTPOnly flags and set_cookie method, ideal for browser-based login flows.
Primarily supports the password flow and lacks built-in handling for other grant types or social logins, requiring additional implementation.
Requires custom exception setup, such as defining NotAuthenticatedException and adding handlers, adding complexity beyond core authentication.
Missing advanced features like password hashing, rate limiting, or audit logging, forcing developers to implement these separately.
FastAPI Login is an open-source alternative to the following products: