Set up Microsoft client app for OAuth2

This guide provides instructions to set up a Microsoft client app for the OAuth2 flow. OAuth2 is the industry-standard protocol for authorization, allowing people in your organization to authorize your app to securely access their Microsoft data via API.

Use Sema4.ai Microsoft OAuth2 client

Sema4.ai provides a public Microsoft OAuth2 client, which you can use to authenticate users and access their Microsoft data via API. This means you don't have to set up your own Microsoft OAuth2 client.

Select Use Sema4.ai OAuth2 Client from the dropdown.

Sema4.ai OAuth2 client in Studio

Steps to set up Microsoft OAuth2 client

Register an app

  1. Navigate to the Azure portal (opens in a new tab).
  2. Select or search for Microsoft Entra ID.
Azure Portal
Azure Portal

App registration

  1. Click Add and select App registration in the tool ribbon.
Add app registration
Add app registration

Fill in app information

  1. Fill in the necessary details for your app:
    • Name: Type a name for your app (your users will see this name).
    • Supported account types: Select the appropriate account type for your app.
    • Redirect URI: Type the redirect URI for your app. This is the URL where users will be redirected after they authenticate. Use http://localhost:4567 and select Web.
  2. Click Register to create the app.
Register app
Register app

Client ID and tenant ID

After registering, you will see the app overview page.

Note down the Application (client) ID and Directory (tenant) ID values. You will need these values later.

App overview
App overview

Create a client secret

  1. Click Manage in the left-side menu and select Certificates & secrets.
  2. Select New client secret.
  3. Type a name for your secret
  4. Choose the expiration time according to your organization's policies.
Certificates & secrets
Certificates & secrets

Store the client secret value

After creating the secret, note down the Value. You will need this value later.

Client secret value
Client secret value

Create client in Sema4.ai platform

  1. In Sema4.ai Studio, navigate to the Settings tab and select Clients.
  2. Under Microsoft, add the values you stored previously. With the tenant ID, you need to add https://login.microsoftonline.com/ before the tenant ID.
Microsoft OAuth2 client setup in Studio
Microsoft OAuth2 client setup in Studio