forked from MrBounty/streamlit-google-auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample1.py
More file actions
24 lines (19 loc) · 747 Bytes
/
example1.py
File metadata and controls
24 lines (19 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
from streamlit_google_auth import Authenticate
st.title('Streamlit Google Auth Example 1')
authenticator = Authenticate(
secret_credentials_path = 'google_credentials.json',
cookie_name='my_cookie_name',
cookie_key='this_is_secret',
redirect_uri = 'http://localhost:8501',
)
# Catch the login event
authenticator.check_authentification()
# Create the login button
authenticator.login()
if st.session_state['connected']:
st.image(st.session_state['user_info'].get('picture'))
st.write('Hello, '+ st.session_state['user_info'].get('name'))
st.write('Your email is '+ st.session_state['user_info'].get('email'))
if st.button('Log out'):
authenticator.logout()