New Component: auth0_component, a simple way to authenticate a user

Uses auth0 to give you the ability to leverage many login providers (google, facebook etc.), through a simple button

https://github.com/conradbez/streamlit-auth0

demo

3 Likes

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.

1 Like

Suspect your issue is not including the package in your requirements.txt.

Here’s an example I put together with instructions in the README :slight_smile:

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

1 Like

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. :sweat_smile:

Hi @conrad_bezuidenhout and @asehmi
I have attempt to create streamlit-auth component a clone of streamlit-auth0-component :smile:
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