Flask-JWT-Extended
Extended JWT integration with Flask
What it is and what it does
Flask-JWT-Extended is a Flask extension that integrates JSON Web Token authentication into your application. It wraps PyJWT and Werkzeug to provide decorators and utilities for protecting routes, validating tokens, and managing token state. The package handles the boilerplate of JWT setup so you can focus on application logic rather than cryptographic details.
Beyond basic token creation and validation, it offers optional features like refresh tokens (for long-lived sessions without re-authentication), token blocklisting (revocation), custom claims validation, fresh-token enforcement for sensitive operations, and cookie-based storage with CSRF protection. You configure it once on your Flask app and then use decorators like `@jwt_required()` on routes that need authentication.
Use it for:
- Protect REST API endpoints by requiring valid JWT tokens in request headers before allowing access.
- Implement login flows with separate access and refresh tokens to balance security and user experience.
- Revoke tokens on logout or when user permissions change by maintaining a blocklist.
- Add custom claims (user roles, permissions) to tokens and validate them on each request.
- Enforce fresh tokens for sensitive operations like password changes or account deletions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds JSON Web Token (JWT) authentication to Flask applications, protecting routes and managing token lifecycles with features like refresh tokens, token revocation, and custom claims.
Yes. Flask-JWT-Extended is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It is a standard choice for JWT authentication in Flask applications and is widely used (top 5000 packages by downloads). Install it if you need JWT authentication in Flask; the API is straightforward and the optional features are genuinely useful for production applications.
Install
flask-jwt-extended on PyPI
pip
pip install flask-jwt-extendeduv
uv add flask-jwt-extendedpoetry
poetry add flask-jwt-extendedInstalling Flask-JWT-Extended
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained as of 2026-07-02 with recent releases; the project has 1581 stars and follows semantic versioning.
License in practice
MIT license (permissive) allows use in commercial and private projects with minimal restrictions; attribution is required but no copyleft obligations apply.
Quickstart
pip install flask-jwt-extended
from flask import Flask
from flask_jwt_extended import JWTManager, create_access_token
app = Flask(__name__)
app.config['JWT_SECRET_KEY'] = 'your-secret-key'
jwt = JWTManager(app)
access_token = create_access_token(identity='user_id')
Requires Python 3.10 or later; earlier Python 3.x versions (3.6–3.9) are not supported by this release.
Verify before relying
- Whether the package's optional features (cookie storage, CSRF protection, automatic user loading) require additional dependencies beyond the three listed runtime deps.
- Performance characteristics when handling high token volumes or large custom claims payloads.
- Real-world security audit status or known attack vectors specific to this implementation.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (<4,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — Werkzeug, Flask, PyJWT |
| Maintenance | actively maintained — 93 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 13,637,572/month — #1,270 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flask_jwt_extended-4.7.4-py2.py3-none-any.whl
Keywords: flask, jwt, json web token
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
sanic-jwtSanic JWT adds JWT-based authentication and…
permissive · top 15,000 on PyPI
django-ninja-jwtProvides JWT authentication for Django-Ninja…
permissive · top 15,000 on PyPI
djangorestframework-jwtAdds JSON Web Token (JWT) authentication…
permissive · top 15,000 on PyPI
Flask-AWSCognitoIntegrates AWS Cognito user authentication into…
permissive · top 15,000 on PyPI
okta-jwt-verifierVerifies JWT tokens issued by Okta, checking…
permissive · top 15,000 on PyPI
joseImplements JSON Web Signature (JWS) and JSON…
permissive · top 15,000 on PyPI
edx-drf-extensionsProvides JWT authentication, CSRF token…
permissive · top 15,000 on PyPI
Flask-BasicAuthFlask-BasicAuth adds HTTP basic access…
permissive · top 15,000 on PyPI