Some of you may know I’m into authentication/identity and have implemented a Streamlit component for Auth0 identity integration with Streamlit apps. That’s quite an involved solution and can be intimidating for some. On the other end of the scale is a simple database holding usernames + passwords. @madflier provided a neat solution recently which inspired me to delve into his approach in some detail and apply things I’d learned building enterprise apps to my own version of it. Thanks @madflier!
I recently had the opportunity to work on this idea in a Streamlit-internal hackathon. I’m pleased to share outputs of that effort with the Streamlit community today!
See my GitHub repo.
What you’ll get:
- Session state support so logins survive Streamlit’s top-down reruns which occur in it’s normal execution.
- Support for
authenticatedcheck, and a
requires_authfunction decorator to protect areas of your own apps, e.g. secure pages in a multi-page Streamlit application.
- Built-in authentication/login status header widget that will sit nicely in most Streamlit apps.
- Support for SQLite DB and Airtable cloud DB providers.
- Passwords are stored hashed (MD5) & encrypted (AES256 CBC Extended) in the database, not as plain text.
- Configuration has been externalized for things like database names and locations, cloud service account secrets, api keys, etc.
P.S. I’m preparing another implementation and tutorials of my Auth0 identity component (for Auth0), so watch this space.
Happy safe/secure Streamliting!