Single-tenant and multitenant authentication for Microsoft 365 users
Article
This article gives you insight into the authentication process for single-tenant and multitenant, Microsoft Entra ID (Microsoft Entra ID) applications. You can use authentication when you build calling experiences for Microsoft 365 users with the Calling software development kit (SDK) that Azure Communication Services makes available. Use cases in this article also break down individual authentication artifacts.
Case 1: Example of a single-tenant application
The Fabrikam company has built an application for internal use. All users of the application have Microsoft Entra ID. Access to Azure Communication Services is controlled by Azure role-based access control (Azure RBAC).
The following sequence diagram details single-tenant authentication.
Before we begin:
Alice or her Microsoft Entra administrator needs to give the custom Teams application consent, prior to the first attempt to sign in. Learn more about consent.
The Azure Communication Services resource admin needs to grant Alice permission to perform her role. Learn more about Azure RBAC role assignment.
Steps:
Authenticate Alice using Microsoft Entra ID: Alice is authenticated using a standard OAuth flow with Microsoft Authentication Library (MSAL). If authentication is successful, the client application receives a Microsoft Entra access token, with a value of A1 and an Object ID of a Microsoft Entra user with a value of A2. Tokens are outlined later in this article. Authentication from the developer perspective is explored in this quickstart.
Get an access token for Alice: The Fabrikam application by using a custom authentication artifact with value B performs authorization logic to decide whether Alice has permission to exchange the Microsoft Entra access token for an Azure Communication Services access token. After successful authorization, the Fabrikam application performs control plane logic, using artifacts A1, A2, and A3. Azure Communication Services access token D is generated for Alice within the Fabrikam application. This access token can be used for data plane actions in Azure Communication Services, like Calling. The A2 and A3 artifacts are passed along with the artifact A1 for validation. The validation assures that the Microsoft Entra Token was issued to the expected user. The application prevents attackers from using the Microsoft Entra access tokens issued to other applications or other users. For more information on how to get A artifacts, see Receive the Microsoft Entra user token and object ID via the MSAL library and Get an Application ID.
Call Bob: Alice makes a call to Microsoft 365 user Bob, with Fabrikam's app. The call takes place via the Calling SDK with an Azure Communication Services access token. Learn more about developing application for Microsoft 365 users.
Artifacts:
Artifact A1
Type: Microsoft Entra access token
Audience: Azure Communication Services, control plane
Audience: Azure Communication Services, data plane
Azure Communication Services Resource ID: Fabrikam's Azure Communication Services Resource ID
Case 2: Example of a multitenant application
The Contoso company has built an application for external customers. This application uses custom authentication within Contoso's own infrastructure. Contoso uses a connection string to retrieve tokens from Fabrikam's application.
The following sequence diagram details multitenant authentication.
Before we begin:
Alice or her Microsoft Entra administrator needs to give Contoso's Microsoft Entra application consent before the first attempt to sign in. Learn more about consent.
Steps:
Authenticate Alice using the Fabrikam application: Alice is authenticated through Fabrikam's application. A standard OAuth flow with Microsoft Authentication Library (MSAL) is used. Make sure you configure MSAL with a correct authority. If authentication is successful, the Contoso client application receives a Microsoft Entra access token with a value of A1 and an Object ID of a Microsoft Entra user with a value of A2. Token details are outlined below. Authentication from the developer perspective is explored in this quickstart.
Get an access token for Alice: The Contoso application by using a custom authentication artifact with value B performs authorization logic to decide whether Alice has permission to exchange the Microsoft Entra access token for an Azure Communication Services access token. After successful authorization, the Contoso application performs control plane logic, using artifacts A1, A2, and A3. An Azure Communication Services access token D is generated for Alice within the Contoso application. This access token can be used for data plane actions in Azure Communication Services, like Calling. The A2 and A3 artifacts are passed along with the artifact A1. The validation assures that the Microsoft Entra Token was issued to the expected user. The application prevents attackers from using the Microsoft Entra access tokens issued to other applications or other users. For more information on how to get A artifacts, see Receive the Microsoft Entra user token and object ID via the MSAL library and Get an Application ID.
Call Bob: Alice makes a call to Microsoft 365 user Bob, with Fabrikam's application. The call takes place via the Calling SDK with an Azure Communication Services access token. Learn more about developing apps for Microsoft 365 users in this quickstart.
Artifacts:
Artifact A1
Type: Microsoft Entra access token
Audience: Azure Communication Services, control plane
Source: Contoso application registration's Microsoft Entra tenant
The following sample apps may be interesting to you:
Try the Sample App, which showcases a process of acquiring Azure Communication Services access tokens for Microsoft 365 users in mobile and desktop applications.
To see how the Azure Communication Services access tokens for Microsoft 365 users are acquired in a single-page application, check out a SPA sample app.
To learn more about a server implementation of an authentication service for Azure Communication Services, check out the Authentication service hero sample.