bleumink / streamlit-keycloak

User authentication and single sign-on in your Streamlit app using Keycloak
MIT License
59 stars 11 forks source link

Redirect Login #16

Closed gabriel-gfs closed 1 year ago

gabriel-gfs commented 1 year ago

Is it possible to redirect automatically on page load instead of displaying the login Button. I want the least possible interactions for my users. I couldn't figure out wether I just need to change some init_options or it not possible currently without changing the backend code. Kind Regards

bleumink commented 1 year ago

This would involve changing frontend code and might not work as you would expect. In a first version I actually had set it up as you described for the exact same reason, but required users to allow popups to show the login window. Popups created outside of a user action are (fortunately) not allowed anymore.

For a regular website, you could also redirect to the login page and then link back when authenticated. This is a lot trickier in Streamlit because the component is running in an iframe. I found the popup to be a good compromise and will keep it like that for now.