8000 GitHub - devforfu/streamlit_auth: Poor man's authentication for Streamlit dashboards
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

devforfu/streamlit_auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Password-Protected Streamlit Dashboards

A small example showing how to hide a dashboard behind a trivial password-based single-user authentication.

Please note that it is not a "real-world", production-ready approach to protect access to your dashboards. It is just a very simple way to somehow restrict access if running on a host with public IP.

How It Works?

This example shows a password-input widget to ask user for a password and saves it as a part of Streamlit's session. The password is retrieved each time when the user interacts with the dashboard. However, each time when you refresh the dashboard or restart it, the state is lost and password should be typed again.

Example

Start Streamlit as the following command shows.

DASHBOARD_PASSWORD=123 python -m streamlit run main.py

Open a link printed to the terminal with your browser. Then you'll see a password-protected dashboard as the following GIF shows.

Authentication example

References

  1. Discussion on Streamlit forum
  2. Hacking session state

About

Poor man's authentication for Streamlit dashboards

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0