liveBook · Manning

Login page

As explained in Build Python Web Apps with Streamlit

A login page is a web-application page that collects user credentials and initiates authentication.

A login page collects a username and password, asks the backend to authenticate them, and records whether the user is signed in. In a Streamlit app, it can show a success message for a valid account or an error for invalid credentials. section 8.4.2

A practical login flow connects the interface, authentication service, and application navigation:

  • Call UserService.get_authenticated_user, which finds the user and checks the supplied password against the stored hash. section 8.4.2
  • Store logged_in and the authenticated user in session state, then redirect to the logged-in home page. section 8.4.2
  • Offer a signup link for users without accounts and expose logout so the navigation returns to login. section 8.4.3

How Build Python Web Apps with Streamlit covers it

How deep it goes
Explains the interface, service call, session state, feedback, and navigation, but stops short of advanced security improvements.
Examples
Uses Streamlit inputs, a Log in button, success and error messages, page links, and a logged-in home-page redirect.
What it assumes
Assumes a Streamlit multi-page app, UserService, User authentication, and session state; demonstrates the login flow incrementally.
What you can do after
Build it from scratch as a Streamlit login page backed by UserService and session-state navigation.
How it connects
Connects authentication, UserService, password hashing, session state, signup pages, logout, and multi-page navigation.

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.