You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Explore single-tenant and multi-tenant authentication use cases for applications supporting Teams users. Also learn about authentication artifacts.
2
+
title: Authentication for apps with Microsoft 365 users
3
+
description: Explore single-tenant and multitenant authentication use cases for applications supporting Microsoft 365 users. Also learn about authentication artifacts.
# Single-tenant and multi-tenant authentication for Teams users
15
+
# Single-tenant and multitenant authentication for Microsoft 365 users
16
16
17
-
This article gives you insight into the authentication process for single-tenant and multi-tenant, *Microsoft Entra ID* (Microsoft Entra ID) applications. You can use authentication when you build calling experiences for Teams 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.
17
+
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.
18
18
19
19
## Case 1: Example of a single-tenant application
20
-
The Fabrikam company has built a custom, Teams calling application for internal company use. All Teams users are managed by Microsoft Entra ID. Access to Azure Communication Services is controlled by *Azure role-based access control (Azure RBAC)*.
20
+
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)*.
21
21
22
22
23
-

23
+

24
24
25
25
The following sequence diagram details single-tenant authentication.
26
26
27
-
:::image type="content" source="./media/custom-teams-endpoint/authentication-case-single-tenant-azure-rbac.svg" alt-text="A sequence diagram that details authentication of Fabrikam Teams users. The client application gets an Azure Communication Services access token for a single tenant Microsoft Entra application." lightbox="./media/custom-teams-endpoint/authentication-case-single-tenant-azure-rbac.svg":::
27
+
:::image type="content" source="./media/custom-teams-endpoint/authentication-case-single-tenant-azure-rbac.svg" alt-text="A sequence diagram that details authentication of Fabrikam's Microsoft 365 users. The client application gets an Azure Communication Services access token for a single tenant Microsoft Entra application." lightbox="./media/custom-teams-endpoint/authentication-case-single-tenant-azure-rbac.svg":::
28
28
29
29
Before we begin:
30
-
- 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](/entra/identity-platform/application-consent-experience).
30
+
- Alice or her Microsoft Entra administrator needs to give the internal application consent, prior to the first attempt to sign in. Learn more about [consent](/entra/identity-platform/application-consent-experience).
31
31
- The Azure Communication Services resource admin needs to grant Alice permission to perform her role. Learn more about [Azure RBAC role assignment](../../../role-based-access-control/role-assignments-portal.md).
32
32
33
33
Steps:
34
-
1. 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](../../quickstarts/manage-teams-identity.md).
35
-
1. 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 will prevent 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](../../quickstarts/manage-teams-identity.md?pivots=programming-language-csharp#step-1-receive-the-azure-ad-user-token-and-object-id-via-the-msal-library) and [Getting Application ID](../troubleshooting-info.md#getting-application-id).
36
-
1. Call Bob: Alice makes a call to Teams 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 custom Teams clients](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md).
34
+
1. 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](../../quickstarts/manage-teams-identity.md).
35
+
1. 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](../../quickstarts/manage-teams-identity.md?pivots=programming-language-csharp#step-1-receive-the-azure-ad-user-token-and-object-id-via-the-msal-library) and [Getting Application ID](../troubleshooting-info.md#getting-application-id).
36
+
1. 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](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md).
37
37
38
38
Artifacts:
39
-
- Artifact A1
39
+
- Artifact `A1`
40
40
- Type: Microsoft Entra access token
41
-
- Audience: _`Azure Communication Services`_ — control plane
41
+
- Audience: _`Azure Communication Services`_, control plane
- Type: Custom Fabrikam authorization artifact (issued either by Microsoft Entra ID or a different authorization service)
53
-
- Artifact C
53
+
- Artifact `C`
54
54
- Type: Azure Communication Services resource authorization artifact.
55
55
- Source: "Authorization" HTTP header with either a bearer token for [Microsoft Entra authentication](../authentication.md#azure-ad-authentication) or a Hash-based Message Authentication Code (HMAC) payload and a signature for [access key-based authentication](../authentication.md#access-key).
56
-
- Artifact D
56
+
- Artifact `D`
57
57
- Type: Azure Communication Services access token
58
-
- Audience: _`Azure Communication Services`_ — data plane
58
+
- Audience: _`Azure Communication Services`_, data plane
59
59
- Azure Communication Services Resource ID: Fabrikam's _`Azure Communication Services Resource ID`_
60
60
61
-
## Case 2: Example of a multi-tenant application
62
-
The Contoso company has built a custom Teams calling 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.
61
+
## Case 2: Example of a multitenant application
62
+
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.
63
63
64
64

65
65
66
-
The following sequence diagram details multi-tenant authentication.
66
+
The following sequence diagram details multitenant authentication.
67
67
68
-
:::image type="content" source="./media/custom-teams-endpoint/authentication-case-multiple-tenants-hmac.svg" alt-text="A sequence diagram that details authentication of Teams users and Azure Communication Services access tokens for multi-tenant Microsoft Entra applications." lightbox="./media/custom-teams-endpoint/authentication-case-multiple-tenants-hmac.svg":::
68
+
:::image type="content" source="./media/custom-teams-endpoint/authentication-case-multiple-tenants-hmac.svg" alt-text="A sequence diagram that details authentication of Microsoft 365 users and Azure Communication Services access tokens for multitenant Microsoft Entra applications." lightbox="./media/custom-teams-endpoint/authentication-case-multiple-tenants-hmac.svg":::
69
69
70
70
Before we begin:
71
71
- 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](/entra/identity-platform/application-consent-experience).
72
72
73
73
Steps:
74
-
1. 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](/entra/identity-platform/msal-client-application-configuration#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](../../quickstarts/manage-teams-identity.md).
75
-
1. 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 will prevent 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](../../quickstarts/manage-teams-identity.md?pivots=programming-language-csharp#step-1-receive-the-azure-ad-user-token-and-object-id-via-the-msal-library) and [Getting Application ID](../troubleshooting-info.md#getting-application-id).
76
-
1. Call Bob: Alice makes a call to Teams 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 custom, Teams apps[in this quickstart](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md).
74
+
1. 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](/entra/identity-platform/msal-client-application-configuration#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](../../quickstarts/manage-teams-identity.md).
75
+
1. 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](../../quickstarts/manage-teams-identity.md?pivots=programming-language-csharp#step-1-receive-the-azure-ad-user-token-and-object-id-via-the-msal-library) and [Getting Application ID](../troubleshooting-info.md#getting-application-id).
76
+
1. 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](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md).
77
77
78
78
79
79
Artifacts:
80
-
- Artifact A1
80
+
- Artifact `A1`
81
81
- Type: Microsoft Entra access token
82
-
- Audience: Azure Communication Services — control plane
82
+
- Audience: _`Azure Communication Services`_, control plane
83
83
- Source: Contoso application registration's Microsoft Entra tenant
- Authority: `https://login.microsoftonline.com/<tenant>/` or `https://login.microsoftonline.com/organizations/` (based on your [scenario](/entra/identity-platform/msal-client-application-configuration#authority)
89
-
- Artifact A3
89
+
- Artifact `A3`
90
90
- Type: Microsoft Entra application ID
91
91
- Source: Contoso application registration's Microsoft Entra tenant
92
-
- Artifact B
92
+
- Artifact `B`
93
93
- Type: Custom Contoso authorization artifact (issued either by Microsoft Entra ID or a different authorization service)
94
-
- Artifact C
94
+
- Artifact `C`
95
95
- Type: Azure Communication Services resource authorization artifact.
96
96
- Source: "Authorization" HTTP header with either a bearer token for [Microsoft Entra authentication](../authentication.md#azure-ad-authentication) or a Hash-based Message Authentication Code (HMAC) payload and a signature for [access key-based authentication](../authentication.md#access-key)
97
-
- Artifact D
97
+
- Artifact `D`
98
98
- Type: Azure Communication Services access token
99
-
- Audience: _`Azure Communication Services`_ — data plane
99
+
- Audience: _`Azure Communication Services`_, data plane
100
100
- Azure Communication Services Resource ID: Contoso's _`Azure Communication Services Resource ID`_
101
101
102
102
## Next steps
103
103
104
104
- Learn more about [authentication](../authentication.md).
105
-
- Try this [quickstart to authenticate Teams users](../../quickstarts/manage-teams-identity.md).
106
-
- Try this [quickstart to call a Teams user](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md).
105
+
- Try this [quickstart to authenticate Microsoft 365 users](../../quickstarts/manage-teams-identity.md).
106
+
- Try this [quickstart to call a Microsoft 365 user](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md).
107
107
108
108
The following sample apps may be interesting to you:
109
109
110
-
- Try the [Sample App](https://github.com/Azure-Samples/communication-services-javascript-quickstarts/tree/main/manage-teams-identity-mobile-and-desktop), which showcases a process of acquiring Azure Communication Services access tokens for Teams users in mobile and desktop applications.
110
+
- Try the [Sample App](https://github.com/Azure-Samples/communication-services-javascript-quickstarts/tree/main/manage-teams-identity-mobile-and-desktop), which showcases a process of acquiring Azure Communication Services access tokens for Microsoft 365 users in mobile and desktop applications.
111
111
112
-
- To see how the Azure Communication Services access tokens for Teams users are acquired in a single-page application, check out a [SPA sample app](https://github.com/Azure-Samples/communication-services-javascript-quickstarts/tree/main/manage-teams-identity-spa).
112
+
- 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](https://github.com/Azure-Samples/communication-services-javascript-quickstarts/tree/main/manage-teams-identity-spa).
113
113
114
114
- To learn more about a server implementation of an authentication service for Azure Communication Services, check out the [Authentication service hero sample](../../samples/trusted-auth-sample.md).
0 commit comments