skillfed

Flask-AWSCognito

Authenticate users with AWS Cognito

flask-awscognito v1.3 80.5K downloads/30d#14,287 on PyPI28
Permissive license MIT Abandoned released

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-awscognito

uv

uv add flask-awscognito

poetry

poetry add flask-awscognito

Installing 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

Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Topic :: Internet :: WWW/HTTP :: Dynamic ContentTopic :: Software Development :: Libraries :: Python Modules

Tags

flask cognito authenticationaws cognito flask integrationcognito user pool flaskflask oauth cognitocognito jwt flask decorator
authenticationaws-cognitoabandoned

More Python Modules packages