-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
25 lines (20 loc) · 862 Bytes
/
test.py
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
from oidc_component import login_button as oidc_button
from oauth_component import login_button as oauth_button
import streamlit as st
from dotenv import load_dotenv
import os
load_dotenv()
#provider=os.environ['provider']
authority = os.environ['authority'] # 'https://oidc.io/oauth',
clientId = os.environ['clientId']
clientSecret = os.environ['clientSecret']
scope = os.environ['scope']
st.title('Welcome to OIDC-Streamlit')
with st.echo():
user_info = oidc_button(clientId=clientId , clientSecret=clientSecret, authority = authority ,scope=scope)
#user_info = oauth_button(clientId=clientId, clientSecret=clientSecret, provider=provider, scope=scope)
if user_info:
st.write(f'Hi {user_info["nickname"]}')
# st.write(user_info) # some private information here
if not user_info:
st.write("Please login to continue")