Microsoft Login Integration
Here are the instructions to get the necessary credentials from Microsoft to enable the Microsoft login option:
How to Configure Microsoft Login Credentials
You will need to register an application in Microsoft's identity platform (Azure Active Directory, now part of Microsoft Entra).
Step 1: Navigate to Azure Portal and Start App Registration
- Go to the Azure Portal and sign in with your Microsoft account.
- In the search bar at the top, type
App registrationsand select it from the results. - Click on the + New registration button.
Step 2: Register Your Application
On the "Register an application" page, fill in the following details:
- Name: Give your application a descriptive name, for example,
PinionAI Streamlit Login. - Supported account types: This is a crucial step that determines your
MS_AUTHORITYvalue.- For the broadest compatibility, including both business/school accounts and personal Microsoft accounts (like Skype, Outlook.com, Xbox), select "Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox)". This is the recommended option.
-
Redirect URI (important):
- Select Web from the dropdown.
- In the text box, enter the exact URL:
http://<YOUR PINIONAI STUDIO URL> - This must match the
DOMAIN_URLenvironment varialbe which maps to the microsoftREDIRECT_URI.
-
Click the Register button at the bottom.
Step 3: Get Your MS_CLIENT_ID and MS_AUTHORITY
After registration, you will be taken to your application's "Overview" page.
- Application (client) ID: You will see this value on the overview page. This is your
MS_CLIENT_ID. Copy it. - Directory (tenant) ID: You will also see this on the overview page.
- Your
MS_AUTHORITYURL is constructed based on your choice in "Supported account types". - If you chose the recommended multitenant and personal accounts option, your authority URL is:
https://login.microsoftonline.com/common - The placeholder in your code is
https://login.microsoftonline.com/consumers, which is for personal Microsoft accounts only. You can use this if you only want to allow personal accounts. - For the recommended setting, you should update the
MS_AUTHORITYin your code or environment variable tohttps://login.microsoftonline.com/common.
- Your
Step 4: Generate Your MS_CLIENT_SECRET
- In the left-hand navigation pane for your app registration, click on Certificates & secrets.
- Under the "Client secrets" tab, click on + New client secret.
- Add a Description (e.g., "Streamlit App Secret") and choose an Expires duration.
- Click Add.
CRITICAL: A new client secret will be generated. Copy the Value of the secret immediately and save it in a secure place. This value will be hidden forever after you leave this page. This is your MS_CLIENT_SECRET.
Step 5: Configure Your Application
You now have all the necessary information for env variables:
MS_CLIENT_IDMS_CLIENT_SECRETMS_AUTHORITYDOMAIN_URL
You can now set these as environment variables on the system running the PinionAI Studio app.