dnplus / streamlit-oauth

Simple OAuth Component for Streamlit App
MIT License
144 stars 23 forks source link

Automatically invoke authentication #35

Closed michaelroudnitski closed 4 months ago

michaelroudnitski commented 5 months ago

Hi,

Thanks for creating this library, I was wondering if there is any way of invoking the authentication automatically? Instead of rendering an oauth2.authorize_button and waiting for the user to click the button, we could just call something like oauth2.invoke for example.

I'm trying to achieve a more seamless user experience. My users come to my streamlit app through my own IDP, so requiring them to click a login button is something I would like to avoid.

If it isn't already possible, would it make sense to add a configuration that if enabled, calls button.click() in main.js?

i.e.

function onRender(event) {
  ...
  if(data.args["auto_invoke"]) {
    button.click();
  }
  ...
}

Thanks and sorry if I'm missing something obvious, I'm pretty new to streamlit

varadinov commented 4 months ago

I'm also looking for this feature. I want to embed streamlit in iframe. When the user open the page with the iframe I want to have a transparent authentication. Since both apps are using the same OAuth2 Provider the auth will be transparent.