Flask-Cognito
Authenticate users to Cognito user pool via JWT.
Decision gist · record as of 2026-08-14
Yes, if you are already committed to AWS Cognito and need straightforward JWT validation in Flask. The package is simple, permissive-licensed, and has no external runtime dependencies. However, maintenance is dormant (latest release 2024-04-13), so verify compatibility with your Flask version and check whether cognitojwt and Cognito's API have evolved. Not recommended if you need active support or are evaluating fresh authentication solutions.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires an AWS Cognito user pool already set up with region and pool ID; Flask and its dependencies must be installed separately.
- Installation friction is high.
- Maintenance is dormant—the last commit was 2024-05-05 and the latest release was 2024-04-13.
License · maintenance · safety
MIT (permissive) — Licensed under MIT (permissive), so you may use, modify, and distribute the package freely in commercial and private projects with minimal restrictions.
last release 2024-04-13 (853 days) · last repo commit 2024-05-05 · 95 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 240,282 downloads/mo, #8,906 on PyPI
Alternatives
Verify before relying
pip install Flask-Cognito
from flask_cognito import CognitoAuth, cognito_auth_required
app.config.update({
'COGNITO_REGION': 'eu-central-1',
'COGNITO_USERPOOL_ID': 'your-pool-id'
})
cogauth = CognitoAuth(app)
@app.route('/api/private')
@cognito_auth_required
def protected():
return {'status': 'authenticated'}- Whether the package works with current versions of Flask and its ecosystem (no Python version constraint specified).
- Whether cognitojwt dependency is automatically installed or must be added manually.
- Current compatibility with modern AWS Cognito API changes since the last release in April 2024.
- How long the package has been dormant and whether it remains compatible with current Flask versions.
What it is and what it does
Flask-Cognito is a Flask extension that plugs AWS Cognito JWT authentication into your application. It validates incoming JWT tokens from Cognito user pools, extracts user identity from the token payload, and provides decorators to protect routes and enforce group-based access control. The extension sits between your Flask routes and Cognito's identity service, handling token verification and making the authenticated user's claims available to your handlers via context variables.
You configure it with your Cognito region and user pool ID, then decorate routes with @cognito_auth_required to enforce authentication. The package also supports restricting access by Cognito group membership and lets you hook in a custom identity lookup function to map Cognito users to your own database records. It uses cognitojwt internally to handle JWT validation.
Use it for
- Protect Flask API endpoints by requiring valid Cognito access or ID tokens in the Authorization header.
- Map Cognito user identities to your application's user database for role-based or permission-based access control.
- Enforce group membership restrictions on specific routes using the @cognito_group_permissions decorator.
- Authenticate serverless Flask applications deployed on AWS Lambda that rely on Cognito for identity management.
- Validate JWT tokens without implementing JWT parsing and cryptographic verification yourself.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are already committed to AWS Cognito and need straightforward JWT validation in Flask.
The package is simple, permissive-licensed, and has no external runtime dependencies. However, maintenance is dormant (latest release 2024-04-13), so verify compatibility with your Flask version and check whether cognitojwt and Cognito's API have evolved. Not recommended if you need active support or are evaluating fresh authentication solutions.
Install
flask-cognito on PyPI
Before you install
Installation friction is high. Maintenance is dormant—the last commit was 2024-05-05 and the latest release was 2024-04-13. The repository remains active (95 stars, not archived) but updates are infrequent.
Requires an AWS Cognito user pool already set up with region and pool ID; Flask and its dependencies must be installed separately.
License in practice
Licensed under MIT (permissive), so you may use, modify, and distribute the package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install Flask-Cognito
from flask_cognito import CognitoAuth, cognito_auth_required
app.config.update({
'COGNITO_REGION': 'eu-central-1',
'COGNITO_USERPOOL_ID': 'your-pool-id'
})
cogauth = CognitoAuth(app)
@app.route('/api/private')
@cognito_auth_required
def protected():
return {'status': 'authenticated'}
Verify before relying
- Whether the package works with current versions of Flask and its ecosystem (no Python version constraint specified).
- Whether cognitojwt dependency is automatically installed or must be added manually.
- Current compatibility with modern AWS Cognito API changes since the last release in April 2024.
- How long the package has been dormant and whether it remains compatible with current Flask versions.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Dormant 853 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 240,282 / month, #8,906 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonTopic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules |
Evidence: Flask-Cognito-1.21.tar.gz
Tags
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 › “flask cognito jwt authentication”
- Flask-CognitoFlask-Cognito integrates AWS Cognito JWT authentication into Flask…
- Flask-AWSCognitoIntegrates AWS Cognito user authentication into Flask applications,…
- cognitojwtDecodes and verifies Amazon Cognito JWT tokens in both synchronous…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also fastapi-cognito · Flask-AWSCognito · Flask-JWT-Extended · pycognito · cognitojwt · fastapi-cloudauth · warrant · aws-cdk.aws-cognito · Flask-HTTPAuth · axioms-fastapi