Skip to main content

streamlit-azure-ad-login

This is a React login component that help you check coonect to an endpoint that make the authentication with Azure Active Director and return the proper token.
This aproach is because the Active Directory authentication requires a lot of certifications that depends on each project.

The component allows you to personalize the following parameters:

  • header_text: Text that will apear on the header of the login component
  • authentication_endpoint_url: The active directory url to send the credentials and return the token
  • logo_uri: a URI with the image of your company
  • prefix: If you have a prefix for the login, here is where it goes

How to use it

import streamlit as st

from streamlit_azure_login import login_component

def login():
    with st.expander('Auth', expanded=True):
        token = login_component(
            header_text='Intercement', 
            authentication_endpoint_url=environ.get('AD_ENDPOINT'), 
            logo_uri=environ.get('AD_LOGO_URI'),
            prefix=environ.get('AD_PREFIX'),
        )
        if token:
            return True
        
        return False

if __name__ == '__main__':
    favicon = Image.open('src/favicon/dir.ico')
    st.set_page_config(page_icon=favicon, layout="wide")

    # 1) We start the app without token and we set it to False
    if 'token' not in st.session_state:
        st.session_state.token = False
    
    # 3) We enter to the web logic
    if st.session_state.token:
        # Here goes the dashboard logic
        st.title('Test Azure Login')
    
    # 4) We create a logout button that re run the app
    if st.sidebar.button('Logout', key='logout_1'):
            del st.session_state['token']
            token = False
            st.session_state.token = False
            st.experimental_rerun()

    # 2) We make the login and set the token to True if the login goes ok 
    # or false if goes wrong
    else:
        token = login()
        st.session_state.token = token

example

Release files for streamlit-azure-ad-login 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for streamlit-azure-ad-login 0.1.2
File Size Uploaded
streamlit-azure-ad-login-0.1.2.tar.gz 644.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for streamlit-azure-ad-login 0.1.2
File Interpreter ABI Platform
streamlit_azure_ad_login-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 1.3 MB

Release files / streamlit-azure-ad-login-0.1.2.tar.gz

Download URL streamlit-azure-ad-login-0.1.2.tar.gz
Size 644.5 kB
Tags Source
SHA-256 checksum
How to use checksums
e81993c872ef2df6e2df9019600077279010c0ddef79f469cd81e8fb19f91f97
BLAKE2b-256 checksum
How to use checksums
5b328afbbc54cb8bcf0aeb98fbfda221609af1b5fce9bcebb48f9461c92d5b0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release files / streamlit_azure_ad_login-0.1.2-py3-none-any.whl

Download URL streamlit_azure_ad_login-0.1.2-py3-none-any.whl
Size 653.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d6d2dbe47c7479a5700e882886695f22ce7ca863573a2471b5bbbcac684bfa79
BLAKE2b-256 checksum
How to use checksums
5a647bd2da78f75e0bade3338d95af9418cb222f6dce9bed06136000ddc089f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page