A deep-dive into Streamlit’s new authentication capabilities
Blog post from Ploomber
Streamlit 1.42, released in February 2024, introduces a new authentication mechanism that allows users to authenticate using various providers such as Google, Microsoft, GitHub, Okta, and other OpenID providers. The setup involves installing the Authlib library and configuring authentication through environment variables or the .streamlit/secrets.toml file, though the latter poses security risks and lacks support across all platforms. The recommended practice is to use environment variables for secure deployment on any platform. Streamlit's login system can now be configured to work with multiple authentication providers by loading the necessary environment variables into the st.secrets dictionary. After successful authentication, Streamlit provides access to user information via the st.experimental_user object, although caution is advised due to potential API changes. The authentication setup is compatible with Ploomber Cloud, offering options like password protection and Single Sign-On (SSO) for enhanced security and ease of deployment.