Flask-AWSCognito
Authenticate users with AWS Cognito
What it is and what it does
Flask-AWSCognito is a Flask extension that wraps AWS Cognito authentication into decorators and helper methods. It handles the OAuth redirect flow with Cognito, retrieves and validates access tokens, and exposes user claims to route handlers. The package depends on Flask, python-jose for JWT validation, and requests for HTTP calls to Cognito endpoints.
The extension is configured via Flask's app.config with your Cognito domain, user pool ID, and client credentials. Routes are protected with the @authentication_required decorator, which enforces that a valid token is present before the handler runs. Claims are then available as aws_auth.claims or via Flask's g object. However, the package has been abandoned since its last commit on 2021-04-29 and will not track changes to Flask, AWS Cognito's token formats, or its dependencies.
Use it for:
- Protect Flask routes with AWS Cognito user authentication without building OAuth redirect flow logic from scratch.
- Extract and validate JWT claims from Cognito tokens to authorize requests based on user attributes.
- Implement sign-in redirects and token exchange callbacks in a Flask app backed by a Cognito user pool.
- Add role or group-based access control by inspecting Cognito claims in protected route handlers.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates AWS Cognito user authentication into Flask applications, handling sign-in redirects, token retrieval, and request-level claim validation.
No. The package is abandoned (last commit 2021-04-29) and will not receive updates for new Flask versions, modern dependency versions, or changes to AWS Cognito's token formats. For new projects, use a maintained alternative. For existing projects still on older Flask versions with frozen dependencies, it may work, but you assume all maintenance risk.
Install
flask-awscognito on PyPI
pip
pip install flask-awscognitouv
uv add flask-awscognitopoetry
poetry add flask-awscognitoInstalling Flask-AWSCognito
Before you install
Low install friction with three common dependencies. However, the package is abandoned—last release was 2019-12-16 and last commit 2021-04-29—so it will not receive security updates or bug fixes for new Flask or dependency versions.
License in practice
MIT license is permissive; you may use, modify, and distribute the package freely with minimal restrictions, though you must retain the license notice.
Quickstart
pip install Flask-AWSCognito
from flask import Flask
from flask_awscognito import AWSCognitoAuthentication
app = Flask(__name__)
app.config['AWS_DEFAULT_REGION'] = 'eu-west-1'
app.config['AWS_COGNITO_USER_POOL_ID'] = 'eu-west-1_XXX'
app.config['AWS_COGNITO_USER_POOL_CLIENT_ID'] = 'YYY'
aws_auth = AWSCognitoAuthentication(app)
@app.route('/')
@aws_auth.authentication_required
def index():
return {'claims': aws_auth.claims}
Requires AWS Cognito user pool credentials (region, pool ID, client ID, client secret) configured via Flask app.config.
Verify before relying
- Whether the package works with recent Flask versions given its 2021 last commit date.
- Current compatibility with modern python-jose and requests versions.
- Whether JWT validation logic matches current AWS Cognito token formats and signing practices.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Flask, python-jose, requests |
| Maintenance | abandoned — 2,433 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 80,526/month — #14,287 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: Flask_AWSCognito-1.3-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
Flask-CognitoFlask-Cognito integrates AWS Cognito JWT…
permissive · top 15,000 on PyPI
Flask-HTTPAuthAdds HTTP Basic, Digest, and Token…
permissive · top 5,000 on PyPI
pycognitoSimplifies AWS Cognito user authentication and…
permissive · top 5,000 on PyPI
warrantWarrant wraps AWS Cognito user management…
permissive · top 15,000 on PyPI
Flask-ParanoidFlask-Paranoid detects and blocks session…
permissive · top 15,000 on PyPI
Flask-JWT-ExtendedAdds JSON Web Token (JWT) authentication to…
permissive · top 5,000 on PyPI
fastapi-cloudauthIntegrates FastAPI applications with cloud…
permissive · top 15,000 on PyPI
fastapi-cognitoDecodes, validates, and parses AWS Cognito JWT…
permissive · top 15,000 on PyPI
cognitojwtDecodes and verifies Amazon Cognito JWT tokens…
permissive · top 15,000 on PyPI
flask-corsFlask-CORS handles Cross-Origin Resource…
permissive · top 1,000 on PyPI