streamlit-authenticator
A secure authentication module to manage user access in a Streamlit application.
What it is and what it does
Streamlit-Authenticator is a Python module that adds secure user authentication to Streamlit web applications. It manages credentials through a configuration file, handles password hashing with bcrypt, and provides widgets for login, registration, password reset, and account management. The package integrates with Streamlit's session state to maintain authentication across page reloads and supports optional OAuth2 authentication via Google and Microsoft.
The module depends on bcrypt for password hashing, cryptography for secure token handling, PyJWT for token generation, PyYAML for configuration parsing, and extra-streamlit-components for UI elements. It also includes optional captcha support and can send authentication codes via email when configured with an API key. The package is designed for developers building multi-user Streamlit applications who need standard authentication flows without building security infrastructure from scratch.
Use it for:
- Protect a Streamlit dashboard with username/password login to restrict access to authorized users only
- Allow new users to self-register through a registration widget while restricting signups to pre-authorized email addresses
- Implement password reset and account recovery flows for users who forget their credentials
- Add two-factor authentication via email for applications handling sensitive data or operations
- Enable single sign-on through Google or Microsoft OAuth2 for enterprise Streamlit deployments
- Manage user roles and permissions to control which features different users can access within the app
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds user authentication and access control to Streamlit applications, supporting login, registration, password reset, two-factor authentication, and OAuth2 integration.
Yes. The package is actively maintained, has no known vulnerabilities, installs with low friction, and solves a common need for Streamlit developers. The permissive MIT license removes licensing concerns. Install it if you're building a multi-user Streamlit app that requires authentication; the alternative is implementing security infrastructure yourself.
Install
streamlit-authenticator on PyPI
pip
pip install streamlit-authenticatoruv
uv add streamlit-authenticatorpoetry
poetry add streamlit-authenticatorInstalling streamlit-authenticator
Before you install
Low install friction with a pure-Python wheel distribution. Actively maintained with recent commits and 2086 repository stars, indicating solid community adoption and ongoing support.
License in practice
Licensed under MIT (permissive), allowing free use, modification, and distribution in both open-source and commercial projects with minimal restrictions.
Quickstart
pip install streamlit-authenticator
import streamlit as st
import streamlit_authenticator as stauth
authenticator = stauth.Authenticate(
config['credentials'],
config['cookie']['name'],
config['cookie']['key'],
config['cookie']['expiry_days']
)
authenticator.login()
Requires a configuration file with user credentials, cookie settings, and optional OAuth2 parameters; plain-text passwords are hashed automatically on first run.
Verify before relying
- Whether the package handles session state persistence correctly across Streamlit reruns in all deployment scenarios
- Performance characteristics when managing large numbers of concurrent users
- Specifics of the optional API key requirement for email-based password reset and two-factor authentication features
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — bcrypt, captcha, cryptography, extra-streamlit-components, PyJWT, PyYAML, streamlit |
| Maintenance | actively maintained — 531 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 252,671/month — #8,539 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: streamlit_authenticator-0.4.2-py3-none-any.whl
Keywords: Python, Streamlit, Authentication, Components
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
oauthenticatorOAuthenticator provides OAuth2 login handlers…
permissive · top 15,000 on PyPI
streamlit-cookies-controllerProvides read, write, and delete operations on…
permissive · top 15,000 on PyPI
fastapi-usersProvides ready-to-use user registration, login,…
permissive · top 5,000 on PyPI
streamlit-msalAdds Microsoft Authentication Library (MSAL)…
unclear · top 15,000 on PyPI
oauth2-clientHandles OAuth2 authentication flows…
unclear · top 15,000 on PyPI
django-google-ssoAdds Google OAuth 2.0 authentication to Django…
permissive · top 15,000 on PyPI
fastapi-auth0Integrates Auth0 authentication into FastAPI…
permissive · top 15,000 on PyPI
quart-authQuart-Auth provides session-based…
permissive · top 15,000 on PyPI
streamlit-vertical-sliderAdds a vertical slider widget to Streamlit apps…
unclear · top 15,000 on PyPI
fastapi-loginAdds session and token-based user…
permissive · top 15,000 on PyPI