Uses auth0 to give you the ability to leverage many login providers (google, facebook etc.), through a simple button
Does this componet support LDAP authentication way?
Thatâs awesome. I tried to publish a test app with your package but when I want to deploy it on streamlit it says:
No module named 'auth0_component'
The module canât be found although I pip installed it and I followed your readme.
To import everything I used this in my main file:
from auth0_component import login_button
And if I try to import it as⌠import streamlit-auth0-component ⌠visual studio code wonât let me import this syntax as their are dashes.
Running it locally doesnât show any errors but I canât deploy it.
This is great Conrad. (I authored an Auth0/Next.js auth component a few months ago.) To help folks deploy this in their local and online apps can you explain how to configure the host URLs for the ExpressJS server and how to start it? I donât think itâs straight-forward to do this in Streamlit online (or at least I donât know how to myself).
Thanks asehmi, I was actually inspired by your application but really wanted something that wouldnât rely on a separate server. The ExpressJS is legacy and not needed to run the Auth component so there shouldnât be an issue running on Streamlit Share.
Suspect your issue is not including the package in your requirements.txt.
Hereâs an example I put together with instructions in the README
https://github.com/conradbez/streamlit-auth0-example/blob/main/test.py
Demo (fake auth0 domain etc.):
https://share.streamlit.io/conradbez/streamlit-auth0-example/main/app.py
Long story short make sure youâve got a requirements.txt
in your repo root with the following line streamlit-auth0-component
Not sure - probably not but Iâm not 100% familiar with this
Oh, I guess this is in fact the problem. Okay that was dumb from me.
Thanks for pointing this out.
Hi @conrad_bezuidenhout and @asehmi
I have attempt to create streamlit-auth
component a clone of streamlit-auth0-component
I have added support for OIDC (OpenId) and OAuth2 , I donât know much about React programing . I am having issue while testing it seems useAuth() method for odic react is not carring redirect url.
Please have a look at the below repository and fill free to update it
GitHub - rahulbsw/streamlit-auth
Hey, this is a fantastic feature.
However, I am getting this error. I am given to understand I need to do something on my callback URL settings.
Could you please guide me on what changes to make? Thanks!
My app is hosted on : https://share.streamlit.io/pitanjal/tradingwebsite/main/
Hey, great to know that your one is running perfectly locally.
I am getting an error here as below.
Could you pls guide me what changes to be made on auth application settings page.
Thanks!
Also, you need to put
streamlit-auth0-component
In your requirements.txt while deploying to sort out the issue you are facing.
I followed the readme and i got streamlit-auth0-component
Hey @Etienne_G Iâve updated if you want to try with the latest
I have the button but i got Callback URL mismatch. This error seems to be mine Thx for your reactivity and your job !
Hello @conrad_bezuidenhout , sorry to bother you again but, now there is a problem of refresh token, there is the log : The scope âoffline_accessâ was requested, but no ârefresh_tokenâ was issued because the authorization code exchange originated from a browser.
To fix that, i think that the component need to create a new instance of Auth0Client
(here the link : Auth0 Single Page App SDK.
Enjoy your day
@conrad_bezuidenhout thanks for the package, it works very well for me. I am using custom domain in auth0. It is not working for me for the custom domain. I see this line
domain = âhttps://â+domain
if domain[-13:] != â.us.auth0.comâ:
print(âdomain should end with â.us.auth0.comâ (no slash)â)
raise ValueError
custom domain doesnât follow that pattern. Why do you have that check? Any other issues with custom domain?
Thanks
Amy
Thanks for the praise.
That check is there so people use the correct domain name - often new users wonât know what to use and the auth flow gives very cryptic errors.
If you would like to implement a unsafe_url_flag parameter to skip the check Iâll happily merge the PR.
I tried it and this is what I get so far.
I am following this guide.
* Register for Auth0
* Create a Single Page Application and navigate to the "settings" tab
* set your callback url's to `http://localhost:8501/component/auth0_component.login_button/index.html` assuming you're running on localhost or `http://YOUR_DOMAIN/component/auth0_component.login_button/index.html` if you're deploying
* Copy `client_id` and `domain` from this page
* Follow example below
I use http://localhost:8501/component/auth0_component.login_button/index.html.
And use this code.
app.py
from auth0_component import login_button
import streamlit as st
clientId = "...."
domain = "...."
user_info = login_button(clientId, domain = domain)
st.write(user_info)
I use clientId and domain from auth0.
requirements.txt
streamlit
streamlit-auth0-component
python-jose==3.3.0
Installation
- Create venv and activate it
- pip install -r requirements.txt
OS is windows 10.
streamlit run app.py
How to solve this issue?
Sorry for the delay, can you please review this? allow custom domain by amy-why ¡ Pull Request #19 ¡ conradbez/streamlit-auth0 ¡ GitHub