Flask-Security-Too
Quickly add security features to your Flask application.
What it is and what it does
Flask-Security-Too is a Flask extension that bundles authentication, authorization, and user management into a single package. It provides role-based access control, multiple authentication strategies (username/email, OAuth, WebAuthn), multi-factor authentication (SMS, email, authenticator apps), and session management. The package is maintained as part of the Pallets Community Ecosystem and aims to follow OWASP best practices with sensible defaults, reducing the need to wire together multiple abandoned or unmaintained projects.
You configure it by providing your own User and Role models (typically via SQLAlchemy) and then instantiate the Security object with your Flask app and a datastore. It handles login forms, password hashing, permission decorators, and token-based authentication out of the box. The extension supports modern identity patterns like unified signin (username, phone, passwordless) and freshness checks for sensitive operations.
Use it for:
- Build a web application with user registration, login, and role-based access control without writing authentication logic from scratch.
- Add OAuth social login (via authlib) to an existing Flask app to let users sign in with third-party providers.
- Implement multi-factor authentication (SMS, email, or authenticator apps) for applications handling sensitive data.
- Deploy WebAuthn/passkey support for passwordless authentication in modern web applications.
- Enforce permission checks on Flask routes using decorators to restrict access by role or permission.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds user authentication, authorization, and role-based access control to Flask applications with support for multiple authentication methods including OAuth, WebAuthn, and multi-factor authentication.
Yes. This is an actively maintained, permissively licensed extension backed by the Pallets organization (which maintains Flask itself). It has no known vulnerabilities, low install friction, and provides a comprehensive, opinionated security layer that would otherwise require integrating multiple smaller packages. Install it if you need user authentication and authorization in a Flask app and want to avoid the complexity of assembling and maintaining a custom solution.
Install
flask-security-too on PyPI
pip
pip install flask-security-toouv
uv add flask-security-toopoetry
poetry add flask-security-tooInstalling Flask-Security-Too
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a release just 2 days old and commits as recent as 2026-08-12. Part of the Pallets Community Ecosystem, which maintains Flask itself, providing institutional backing and alignment with Flask's release and documentation standards.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install Flask-Security-Too
from flask import Flask
from flask_security import Security, SQLAlchemyUserDatastore
app = Flask(__name__)
app.config['SECRET_KEY'] = 'your-secret-key'
# Configure datastore with your user and role models
user_datastore = SQLAlchemyUserDatastore(db, User, Role)
security = Security(app, user_datastore)
Requires Python 3.10 or later. Needs a Flask application instance and a database setup (typically SQLAlchemy) to define User and Role models.
Verify before relying
- Whether all advertised authentication methods (OAuth, WebAuthn, SMS/email MFA, passkeys) are production-ready in version 5.8.2 or still experimental.
- Performance characteristics and scalability limits when handling large numbers of concurrent authentication requests.
- Specific OWASP ASVS requirements that are enforced by default vs. those requiring explicit configuration.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 8 — Flask, Flask-Login, Flask-Principal, Flask-WTF, email-validator, markupsafe, libpass, wtforms |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 269,164/month — #8,264 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flask_security_too-5.8.2-py3-none-any.whl
Keywords: flask, security
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-PrincipalFlask-Principal provides identity and…
permissive · top 15,000 on PyPI
Flask-SecurityFlask-Security adds authentication,…
permissive · top 15,000 on PyPI
Flask-SessionFlask-Session adds server-side session storage…
permissive · top 5,000 on PyPI
flask-appbuilderFlask App Builder is a framework that generates…
permissive · top 5,000 on PyPI
django-otp-webauthnAdds WebAuthn Passkey support to Django OTP,…
permissive · top 15,000 on PyPI
flask-oidcAdds OpenID Connect authentication support to…
permissive · top 5,000 on PyPI
Flask-DanceFlask-Dance simplifies OAuth authentication in…
permissive · top 5,000 on PyPI
Flask-OAuthlibFlask-OAuthlib adds OAuth 1.0a and OAuth 2.0…
permissive · top 15,000 on PyPI
Flask-WTFFlask-WTF integrates WTForms with Flask to…
permissive · top 5,000 on PyPI
Flask-MailFlask-Mail adds email-sending functionality to…
permissive · top 5,000 on PyPI