Hi, has anyone successfully used this component recently? I’m trying to integrate it into my app, and running into the issue
Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('http://localhost:8501') does not match the recipient window's origin ('https://pkonduri.auth0.com').
I can successfully login, but when I click logout, I get the error shown above.
Note that I had to edit the file auth0_component/__init__.py slightly so that it would accept my domain that Auth0 gave me. I had to comment out a few lines of code in geterifiedSubFromToken method just to be able to get this far, because the library made the assumption that my domain ended in .us.auth0.com, which it does not. Edit shown below:
def getVerifiedSubFromToken(token, domain):
domain = "https://"+domain
# if domain[-13:] != '.us.auth0.com':
# print('domain should end with ".us.auth0.com" (no slash)')
# raise ValueError
# rest of the code is unchanged.....
Any guidance would be very much appreciated @conrad_bezuidenhout ? @amy-why looks like you’ve dug deep into this lib, mind seeing what I may be doing wrong?
Hi @Danyal_Zahid that’s exciting! Do you have an example implementation / site where I can try it out? Before stripping out all of my hacky auth code for this, I would love to test it out if possible.
Hi Danyal, thank you for your package. I am able to set it up and test logging in. However, I noticed the login status turned back to “Login” when the page refreshes. I turned on both Refresh Token and Rotation Refresh Token Expiration for several hours but didn’t fix the issue. Do you know when should I config so that the user can remain logged in for several days with the token in the cookie?
Did you ever find a workaround here? I’ve been searching for a long time, but this is just by design from what I understand. I don’t think I’ve seen any Streamlit apps that ahve successfully implemented persistent logins.
(Doesn’t seem to matter whether I allow sites to use popups or not in Chrome - still get message)
Would love to get Auth0 working on Streamlit. Spent all day yesterday on this. Unfortunately going to have to move on for now without this much-desired feature. Please let me know if anyone has any tips, thanks.
What resolved this issue for me:
I switched my “Regular web app” to SPA and that worked.
However, creating a SPA from the outset doesn’t seem to work, although maybe I had flipped some setting in my orignal app that allowed it to work, your mileage may vary.
In any case maybe this comment will be useful to someone.
For those with commercial use cases: Ploomber (I’m part of their team) developed a Streamlit + Auth0 integration. You only need to provide Auth0 config params and we’ll take of the rest, there’s no need to modify your Streamlit app code.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.