File size: 983 Bytes
977380c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import streamlit as st
import os
# from dotenv import load_dotenv
import streamlit_google_oauth as oauth

# load_dotenv()
client_id = "657069732284-mbcb1l7ra4pask18n2cc7a29123ldsm3.apps.googleusercontent.com"
client_secret = "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"
redirect_uri = "https://agiveon-ath.streamlit.app/?embed=True"


if __name__ == "__main__":
    app_name = '''
    Streamlit Google Authentication Demo
    '''
    app_desc = '''
    A streamlit application that authenticates users by <strong>Google Oauth</strong>.
    The user must have a google account to log in into the application.
    '''
    login_info = oauth.login(
        client_id=client_id,
        client_secret=client_secret,
        redirect_uri=redirect_uri,
        app_name=app_name,
        app_desc=app_desc,
        logout_button_text="Logout",
    )
    if login_info:
        user_id, user_email = login_info
        st.write(f"Welcome {user_email}")

# streamlit run app.py --server.port 8080