Quickly add Auth0 authentication to your Streamlit app.
Project description
Welcome to Auth0-Streamlit :forked:
The fastest way to provide comprehensive login inside Streamlit
Updated to latest auth0 sdk
This is a fork of the original onradbez/streamlit-auth0@c5e5666. Thanks to the original author for the great work!
Installation
pip install streamlit-auth0-ts
Setup
- 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 orhttps://YOUR_DOMAIN/component/auth0_component.login_button/index.html
if you're deploying - Set your Web Origin to
http://localhost:8501
orhttp://YOUR_DOMAIN
- Copy
client_id
anddomain
from this page - Follow example below
An example
On Auth0 website start a "Single Page Web Application" and copy your client-id / domain (of form xxxx.us.auth0.com) into code below.
from auth0_component import login_button
import streamlit as st
clientId = "...."
domain = "...."
user_info = login_button(clientId, domain = domain)
st.write(user_info)
user_info
will now contain your user's information
Todo
- Pass all info through JWT, at the moment the
sub
field is the only field passing through verification - Test with other providers, only Google tested
Deploy
Change version in setup.py
cd auth0_component/frontend/ && npm run build && cd .. && cd .. && rm -rf dist/* && python setup.py sdist bdist_wheel
twine upload dist/*
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
streamlit-auth0-ts-0.2.0.tar.gz
(66.0 kB
view hashes)
Built Distribution
Close
Hashes for streamlit_auth0_ts-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b74bd85ed7fa6fe99c6947c389c53d56ea641b72350df83ff8c19af87fdb9f43 |
|
MD5 | 96b7919f5fe3af94ee81764bf216f8e4 |
|
BLAKE2b-256 | ce0b4234fca2238b5d9f8660037a306cd8bd2bc6a72589dd62719b581969cc44 |