liveBook · Manning

St.login

As explained in Build Python Web Apps with Streamlit

st.login is a Streamlit API function that initiates authentication through a configured identity provider.

st.login() starts authentication for a Streamlit app through a configured identity provider. Instead of handling passwords and user records yourself, the app redirects users to a provider such as Google, Microsoft, Okta, or Auth0. section 8.4.3

Start provider-based login

After configuring an OpenID Connect provider, call st.login() when the user needs to authenticate. The provider handles account creation or sign-in, then the app can inspect st.user.is_logged_in and st.user.email. section 8.4.3

A working setup requires:

  • An account with an identity provider that supports OpenID Connect. section 8.4.3
  • A client ID, client secret, and additional metadata stored in st.secrets. section 8.4.3

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains provider configuration, redirection, and user-state inspection but does not detail the underlying OIDC metadata.
Examples
Uses Google, Microsoft, Okta, and Auth0 as provider examples and checks st.user.is_logged_in or st.user.email.
What it assumes
Requires an OIDC provider account, client credentials, metadata, and st.secrets configuration.
What you can do after
Apply it via Streamlit to redirect users for authentication and inspect their logged-in state and email.
How it connects
Connects OpenID Connect, identity providers, st.secrets, st.user, and st.logout.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Python Web Apps with Streamlit. The section links point to the parts of the book it draws on.