st_googleauth is a Python library that provides Streamlit integration for Google Authenticator. It enables single sign-on (SSO) with Google Authenticator for Streamlit applications.
Project description
StreamlitGAuth
StreamlitGAuth is a Python library that simplifies the integration of Google Authenticator-based Single Sign-On (SSO) with Streamlit applications. With StreamlitGAuth, you can enhance the security of your Streamlit apps by enabling two-factor authentication through Google Authenticator.
Installation
You can install StreamlitGAuth using pip
Usage
from google_auth.google_auth import GoogleAuth
import streamlit
client_id = "your_client_id"
client_secret = "your_client_secret"
login = GoogleAuth(client_id, client_secret)
if login:
print("Login successful")
Replace "your_client_id" and "your_client_secret" with your actual Google OAuth 2.0 credentials.
Example Streamlit Application
import streamlit as st
from google_auth import Google_auth
client_id = "hasjh5jk498ufiu3h89g8-aghdszjhk3k.apps.googleusercontent.com"
client_secret = "afsghfbkhfdjdsgfdjhfjkfhjkfhkjhkjdhks"
login = Google_auth(clientId=client_id, clientSecret=client_secret)
if login == "authenticated":
# your streamlit applciation
pass
else:
st.warning("login failed")
Contributing
If you would like to contribute to StreamlitGAuth, please open an issue or submit a pull request on our GitHub repository.
License
This library is released under the MIT License to encourage collaboration and use in various applications.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for StreamlitGAuth-2.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 743d0e077fa5191d4c9391d1840788b333822ad80382ac37a903aac06e9cdf71 |
|
MD5 | 83fc210904cc8d87e471387a651650cf |
|
BLAKE2b-256 | 547fd3b8db5365571830a1a7fec98dc827f28e4eedc8dbd92b104b2541e7a3c6 |