skip to Main Content

I have used oauth2.0 implicit flow to authenticate and generate the access token using IAM and internal service provider, I can see the access token generated in the URL but I’m not ale to fetch that because URL has ‘#’ instead of ‘?’, in this case how can I fetch the URL in streamlit?

I have used javascript to fetch the url but not ale to send it to streamlit, could anyone please help me resolve this?

i tried javascript to fetch the url, javascript side is working, I can see the variable i console, but not able to get that to streamlit

2

Answers


  1. OAuth2 implicit flow (which is no longer recommended) is a flow for browser applications. The important information is in the URL in the fragment part (#).

    You don’t really need to ‘fetch’ this URL. The assumption is that you get sent to a browser application and using Javascript you extract the data from document.location.

    If you’re hoping to do stuff on the server instead, implicit flow is the wrong choice. Use the authorization_code flow which is the recommended flow these days for browsers as well.

    Login or Signup to reply.
  2. This library can extract # URL fragments from current url
    https://pypi.org/project/streamlit-url-fragment/

    from their documentation,

    import streamlit as st
    from streamlit_url_fragment import get_fragment
    
    st.write("Current value: {!r}".format(get_fragment()))
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search