A Streamlit template that handles login using OAuth and manages navigation between login and app states.
- Python 3.7 or higher
- Streamlit
- OAuth provider credentials (e.g., Google, GitHub)
- Fork the repository on GitHub.
- Clone your forked repository:
git clone https://github.com/yourusername/streamlit-oauth-template.git
- Navigate to the project directory:
cd streamlit-oauth-template
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file in the root directory and add your OAuth provider credentials:CLIENT_ID=your_client_id CLIENT_SECRET=your_client_secret GOOGLE_REDIRECT_URI=http://localhost:8501 GOOGLE_SCOPE=https://www.googleapis.com/oauth2/v1/certs GOOGLE_HOSTED_DOMAIN=your_customer_email_hosted_domain
- Start the Streamlit app:
streamlit run app.py
- Open your browser and navigate to
http://localhost:8501
.
- Modify
app.py
to customize the app's behavior. - Modify
frames/header.py
to customize the app's description. - Add more
<page>.py
files to add more functionality to the app. - Update
oauth.py
to change OAuth provider settings.
- Ensure your OAuth credentials are correct.
- Check the Streamlit logs for any errors.
This project is licensed under the MIT License.