SSO bug fixed
This commit is contained in:
@@ -19,7 +19,7 @@ def get_auth_url(REDIRECT_URI):
|
||||
auth_url = app.get_authorization_request_url(SCOPE, redirect_uri=REDIRECT_URI)
|
||||
return auth_url
|
||||
|
||||
|
||||
@st.cache_data
|
||||
def get_token_from_code(auth_code, REDIRECT_URI):
|
||||
app = msal.ConfidentialClientApplication(CLIENT_ID, authority=AUTHORITY, client_credential=CLIENT_SECRET)
|
||||
result = app.acquire_token_by_authorization_code(auth_code, scopes=SCOPE, redirect_uri=REDIRECT_URI)
|
||||
|
||||
+1
-2
@@ -2,7 +2,6 @@
|
||||
import streamlit as st
|
||||
import security
|
||||
|
||||
@st.cache_data
|
||||
def setup_page(REDIRECT_URI):
|
||||
# st.set_page_config(
|
||||
# page_title=page_title,
|
||||
@@ -17,7 +16,7 @@ def setup_page(REDIRECT_URI):
|
||||
if access_token:
|
||||
user_info = security.get_user_info(access_token)
|
||||
st.session_state['user_info'] = user_info
|
||||
return user_info
|
||||
return True
|
||||
else:
|
||||
st.write("Please sign-in to use this app.")
|
||||
auth_url = security.get_auth_url(REDIRECT_URI)
|
||||
|
||||
Reference in New Issue
Block a user