Hi all,
TLDR: I can’t get SSO working through st.login because it refreshes the page and doesn’t save anything.
I am deploying a streamlit app through AWS. My company has a whole organization managing AWS so I don’t have a lot of admin permissions. What I do have is an exposed endpoint (a URL) that I’m able to use. I have an exposed SSO login through microsoft as well. I have successfully uses st.login(“microsoft”) on the newest version of streamlit to login. This means I see the SSO page, select my account, and it brings me back to the same URL with a hashed extension to the URL. AKA .com/
Where I have an issue is that it refreshes everything on the page and doesn’t actually safe any information for me to be able to identify the user. I have the following code, and have tried many other variants of this with st.user, st.session_state, but none of the values actually get populated.
Here is the code (I used /t for tabs)
st.write(“Testing SSO and details”)
st.write("user: ", st.user)
if “user” not in st.session_state:
st.session_state.user = “”
st.write("user2: ", st.user[‘is_logged_in’])
if st.button(“Login”):
/t st.session_state.user = st.login(“microsoft”)
/t st.write(‘Logged in!’)
st.write("session state user: ", st.session_state.user)
st.write(“whole session state”, st.session_state)
st.write("user2: ", st.user[‘is_logged_in’])
What can I do? Any suggestions? I am using a button right now because if I don’t it gets caught in an infinite loop.
Thank you in advance!