Skip to content

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

  1. Go to the Azure Portal and sign in with your Microsoft account.
  2. In the search bar at the top, type App registrations and select it from the results.
  3. Click on the + New registration button.

Step 2: Register Your Application

On the "Register an application" page, fill in the following details:

  1. Name: Give your application a descriptive name, for example, PinionAI Streamlit Login.
  2. Supported account types: This is a crucial step that determines your MS_AUTHORITY value.
    • 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.
  3. 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_URL environment varialbe which maps to the microsoft REDIRECT_URI.
  4. 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.

  1. Application (client) ID: You will see this value on the overview page. This is your MS_CLIENT_ID. Copy it.
  2. Directory (tenant) ID: You will also see this on the overview page.
    • Your MS_AUTHORITY URL 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_AUTHORITY in your code or environment variable to https://login.microsoftonline.com/common.

Step 4: Generate Your MS_CLIENT_SECRET

  1. In the left-hand navigation pane for your app registration, click on Certificates & secrets.
  2. Under the "Client secrets" tab, click on + New client secret.
  3. Add a Description (e.g., "Streamlit App Secret") and choose an Expires duration.
  4. 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_ID
  • MS_CLIENT_SECRET
  • MS_AUTHORITY
  • DOMAIN_URL

You can now set these as environment variables on the system running the PinionAI Studio app.