A FastAPI extension that simplifies integration with AWS Cognito, Auth0, and Firebase Authentication for token verification and user management.
FastAPI Cloud Auth is a Python library that provides standardized, dependency-injected authentication for FastAPI applications using major cloud identity providers. It handles JWT validation, scope-based authorization, and user information extraction, reducing boilerplate code for securing APIs.
Python developers building FastAPI applications that require authentication with AWS Cognito, Auth0, or Firebase Authentication.
Developers choose this library because it abstracts the complexity of cloud authentication services behind a clean, consistent interface, allowing for minimal configuration and seamless integration via FastAPI's dependency injection system.
Simple integration between FastAPI and cloud authentication services (AWS Cognito, Auth0, Firebase Authentication).
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Handles JWT validation for signatures, expiration, and audience checks across supported providers, reducing manual verification code as shown in the README examples.
Uses FastAPI's Depends for dependency injection, allowing seamless endpoint security with minimal boilerplate, evidenced by the clean endpoint decorators in the examples.
Supports both 'all' and 'any' operators for scope-based authorization, enabling fine-grained permission control without custom logic, as detailed in the additional scopes section.
Allows custom Pydantic models to extract and validate user claims from tokens, with options for raw payload access, demonstrated in the custom claims examples.
Only works with AWS Cognito, Auth0, and Firebase Authentication, and Firebase is restricted to ID tokens only, which limits flexibility for other cloud services or custom setups.
Requires separate, detailed setup for each provider (e.g., region, userPoolId for Cognito), which can be complex and error-prone, as seen in the pre-requirements sections.
The README focuses on token validation but doesn't address token refresh flows, leaving developers to implement renewal logic manually for long-lived sessions.