Giter Site home page Giter Site logo

streamlit-auth0's People

Contributors

conradbez avatar conradbezmck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

streamlit-auth0's Issues

0.1.4 does not work with .eu domains

User info comes through, but then a big error box is printed:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 565, in _run_script
    exec(code, module.__dict__)
  File "/app/deep_digest/app.py", line 12, in <module>
    user_info = login_button(settings.AUTH0_CLIENT_ID, domain=settings.AUTH0_DOMAIN)
  File "/usr/local/lib/python3.10/site-packages/auth0_component/__init__.py", line 82, in login_button
    elif isAuth(response = user_info, domain = domain):
  File "/usr/local/lib/python3.10/site-packages/auth0_component/__init__.py", line 89, in isAuth
    return getVerifiedSubFromToken(token = response['token'], domain=domain) == response['sub']
  File "/usr/local/lib/python3.10/site-packages/auth0_component/__init__.py", line 28, in getVerifiedSubFromToken
    raise ValueError
ValueError
domain should end with ".us.auth0.com" (no slash)

Problem is here:

if domain[-13:] != '.us.auth0.com':

Send user's metadata

This works great for use cases in which you have the same level of permission for all users, but if for instance you want to have different roles per user which entitles different functionalities, just grabbing the user basic info might require additional work, could you also get the user's metadata? that way you can set-up the custom attributes for your users and get it directly just using this library

Inner iframe when logging out

Logging in works great, but when I log out it creates another iframe inside my app (see demo gif attached). I think this is caused by a returnTo redirect enforced by auth0 SDK (essentially refreshing the frontend component). Is there a way to better handle this or is this an issue?

demo

Cannot import component

Hi, I tried to run this package but got and error. I installed with pip install streamlit-auth0-component

The code is

from auth0_component import login_button
import streamlit as st
user_info = login_button(XXX, domain=XXX)
st.write(user_info)

The error

2022-10-12 14:58:48.291 Uncaught app exception
Traceback (most recent call last):
  File "/home/.venv/lib/python3.8/site-packages/streamlit/runtime/scriptrunner/script_runner.py", line 562, in _run_script
    exec(code, module.__dict__)
  File "/home/auth0_app.py", line 1, in <module>
    from auth0_component import login_button
  File "/home/.venv/lib/python3.8/site-packages/auth0_component/__init__.py", line 16, in <module>
    _login_button = components.declare_component("login_button", path=build_dir)
  File "/home/.venv/lib/python3.8/site-packages/streamlit/components/v1/components.py", line 300, in declare_component
    ComponentRegistry.instance().register_component(component)
  File "/home/.venv/lib/python3.8/site-packages/streamlit/components/v1/components.py", line 340, in register_component
    raise StreamlitAPIException(f"No such component directory: '{abspath}'")
streamlit.errors.StreamlitAPIException: No such component directory: '/home/.venv/lib/python3.8/site-packages/auth0_component/frontend/dist'

Login required error for the classic universal login

Thanks a lot for this much needed component!

The component works flawlessly if you make a Single Page Application with the "New" universal login. However, the "New" universal login (Branding > Universal Login > New) has problems with SSO as noted here https://community.auth0.com/t/no-connections-enabled-for-the-client-but-saml-connection-is-enabled/62759.

If you use the "Classical" universal login the component starts breaking with Login required (some context on when that happens on auth0 here https://community.auth0.com/t/failed-silent-auth-login-required/33165/38).

To reproduce it all you need to do is go to Branding > Universal Login and select Classical. The same app breaks.

Any ideas on how to go around it? Plans on supporting it?

user_info returning false

user_info is returning a boolean, and after authentication, it does not turn true.
running simple app in auth0

Can't load auth0_component.login_button in prod

I can run this component in dev - works great!

But deploying to prod (on fly.io), I get this error ("Your app is having trouble loading the auth0_component.login_button component.")

The frontend code is correctly copied to the server, and I'm able to import the python module. Maybe it's a network issue? Does a new port need to be forwarded for a separate process serving the html/ javascript?

Any ideas? Thank you!!

image

Remove domain check?

Would you remove the domain check on line 26 of init.py? It would allow us to work with Auth0 from different regions. My auth0 domain is just .auth0.com

Deployment support in aws

Thanks for the awsome repo,

I have a similar use case where I have to deploy the streamlit app with auth0 on was.

Could you please guide me, on how to deploy the application in aws?

Border color

Is there a way to change the border color of the Login/Logout button? I would prefer it if it would look like a normal button.

Any way to make the component keep its state when used in multi page streamlit app?

I have a simple streamlit app with 2 pages (A and B) and used the login_button component in either pages. When the login is done in the A page the component shows the logout text and allows the user to logout the session.

However when the user changes to page B, the login_button instantiated in that page doesn't maintain the logged in state, and another message to login is shown.

PS: I have instantiated the login button using the key optional parameter as "login" in both pages.

Is there any way to keep the component state even if the user changed page after the login?

I am available to help with development if necessary. Although I'm not an experienced programmer, I'm willing to help,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.