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
This quickstart demonstrates how to use the Communication Services Common SDK along with Azure Identity SDK in a console application to authenticate a Microsoft Entra ID user, obtain an Entra ID user token, and automatically exchange it for an Azure Communication Services access token for Microsoft Entra ID user. The resulting Azure Communication Services access token allows you to integrate calling and chat features using the Communication Services Calling and Chat SDKs.
21
+
This quickstart demonstrates how to use the Communication Services Common SDK along with Azure Identity SDK in a console application to authenticate a Microsoft Entra ID user, obtain an Azure Communication Services access token for Microsoft Entra ID user. The resulting Azure Communication Services access token allows you to integrate calling and chat features using the Communication Services Calling and Chat SDKs.
22
22
23
23
## Prerequisites
24
24
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
25
-
- An active Azure Communication Services resource and connection string. For more information, see [Create an Azure Communication Services resource](./create-communication-resource.md).
25
+
- An active Azure Communication Services resource and endpoint URI. For more information, see [Create an Azure Communication Services resource](./create-communication-resource.md).
26
26
- A Microsoft Entra ID instance. For more information, see [Microsoft Entra ID overview](./entra/fundamentals/whatis).
27
27
28
28
## Introduction
@@ -41,13 +41,13 @@ The Administrator role has extended permissions in Microsoft Entra ID. Members o
41
41
1. The Contoso Administrator creates or selects an existing *application* in Microsoft Entra ID. The property *Supported account types* defines whether users from various tenants can authenticate to the application. The property *Redirect URI* redirects a successful authentication request to the Contoso *client application*.
42
42
1. The Contoso Administrator adds required API permissions from Communication Services Clients application. For the all list of the permissions, see [Access tokens with Microsoft Entra ID](./identity-model.md#access-tokens-with-microsoft-entra-id).
43
43
1. The Contoso Administrator allows public client flow for the application.
44
-
1. The Contoso Administrator creates or selects existing communication services. The Contoso Administrator grants Fabrikam Entra ID users access to Contoso Azure Communication Services resource. Azure Communication Services Common SDK will be used for Microsoft Entra ID user authentication and in the background seamlessly exchange Microsoft Entra user tokens for Communication Services access token of Microsoft Entra ID user. For more information, see [Create and manage Communication Services resources](./create-communication-resource.md).
44
+
1. The Contoso Administrator creates or selects existing communication services. The Contoso Administrator grants Fabrikam Entra ID users access to Contoso Azure Communication Services resource. Azure Communication Services Common SDK will be used for Microsoft Entra ID user authentication and in the background seamlessly obtain an Azure Communication Services access token for Microsoft Entra ID user. For more information, see [Create and manage Communication Services resources](./create-communication-resource.md).
45
45
1. The Fabrikam Administrator grants required Communication Services Clients application API permissions to the Contoso application. This step is required if only Fabrikam Administrator can grant access to the application with the required permissions.
### Step 1: Create a service principal for Azure Communication Services Clients application
50
-
To enable the Contoso application to access Communication Services Clients application API permissions, the Contoso Administrator must create a service principal for Azure Communication Services Clients application in the Contoso Microsoft Entra ID tenant.
50
+
To enable the Contoso application to access Azure Communication Services Clients application API permissions, the Contoso Administrator must create a service principal for Azure Communication Services Clients application in the Contoso Microsoft Entra ID tenant.
51
51
The Contoso Administrator can create a service principal in Contoso tenant by one of the following methods:
52
52
53
53
- Use the [Microsoft Graph REST API](./graph/api/serviceprincipal-post-serviceprincipals?view=graph-rest-1.0&tabs=http#request) to run the following request:
@@ -86,9 +86,9 @@ For more detailed information, see [Register an application with the Microsoft i
86
86
87
87
On the **Authentication** pane of your application, you can see a configured platform for *Public client/native(mobile & desktop)* with a redirect URI pointing to *http://localhost*. At the bottom of the pane, you'll see an *Allow public client flows* toggle control, which for this quickstart should be set to **Yes**.
88
88
89
-
### Step 4: Add Communication Services Clients permissions in the application
89
+
### Step 4: Add Azure Communication Services Clients permissions in the application
90
90
91
-
The application must declare Communication Services Clients to have access to Azure Communication Services capabilities. Microsoft Entra ID user would be requesting a Microsoft Entra user token with these permissions.
91
+
The application must declare Azure Communication Services Clients to have access to Azure Communication Services capabilities. Microsoft Entra ID user would be requesting a Microsoft Entra user token with these permissions.
92
92
93
93
1. Navigate to your Microsoft Entra app in the Azure portal and select **API permissions**
94
94
1. Select **Add Permissions**
@@ -114,7 +114,7 @@ In the Azure portal follow these steps:
114
114
4. In the **Principal type** select the correct value. In this scenario Contoso Admin provides access for a group from Fabrikam tenant and chooses **Group**.
115
115
5. In the **Object ID** field, enter the object ID of the group from Fabrikam Microsoft Entra tenant.
116
116
6. In the **Tenant ID** field, enter the tenant ID of the Fabrikam Microsoft Entra tenant.
117
-
7. In the **Clien ID** field, enter the client ID of the application from [step 2](entra-id-authentication-integration.md#step-2-create-a-microsoft-entra-application-registration-or-select-a-microsoft-entra-application).
117
+
7. In the **Client ID** field, enter the client ID of Contoso application from [step 2](entra-id-authentication-integration.md#step-2-create-a-microsoft-entra-application-registration-or-select-a-microsoft-entra-application).
118
118
8. Click **Save and exit** to apply the changes.
119
119
120
120
@@ -137,7 +137,7 @@ To construct an Administrator consent URL, the Fabrikam Microsoft Entra Administ
137
137
The service principal of the Contoso application in the Fabrikam tenant is created if consent is granted. The Fabrikam Administrator can review the consent in Microsoft Entra ID by doing the following steps:
138
138
139
139
1. Sign in to the Azure portal as an administrator.
140
-
1. Go to Microsoft Entra ID.
140
+
1. Go to **Microsoft Entra ID**.
141
141
1. On the **Enterprise applications** pane, set the **Application type** filter to **All applications**.
142
142
1. In the field for filtering the applications, enter the name of the Contoso application.
143
143
1. Select **Apply**.
@@ -166,14 +166,14 @@ To provide access to the group, the Fabrikam Administrator does the following st
166
166
167
167
## Developer actions
168
168
169
-
The Contoso developer needs to set up the *client application* to authenticate users. In the client application, the developer creates a credential using Communication Common SDK along with Azure Identity SDK capable of authenticating users against the Microsoft Entra ID application and exchanging the Microsoft Entra user token for Azure Communication Services access token of Microsoft Entra ID user.
169
+
The Contoso developer needs to set up the *client application* to authenticate users. In the client application, the developer creates a credential using Communication Common SDK along with any implementation of the `TokenCredential` from Azure Identity SDK capable of authenticating users against the Microsoft Entra ID application.
170
170
171
171
The developer's required actions are shown in following diagram:
172
172
173
-
![Diagram of developer actions to enable Azure Communication Services support for Microsoft Entra ID users.]()
173
+

174
174
175
-
1. The Contoso developer initialize any implementation of `TokenCredential` from Azure Identity SDK which is capable of obtaining a Microsoft Entra user token for the application that was created earlier by the Administrator.
176
-
1. The Contoso developer initializes `AzureCommunicationTokenCredential` from Communication Services Common SDK with `TokenCredential` created in the step 1. The `AzureCommunicationTokenCredential`credential exchanges the incoming Microsoft Entra user token for the access token of Teams user seamlessly in the background.
175
+
1. The Contoso developer initialize any implementation of `TokenCredential` from Azure Identity SDK which is capable of obtaining a Microsoft Entra user token for the application that was created earlier by the Contoso Administrator.
176
+
1. The Contoso developer initializes `AzureCommunicationTokenCredential` from Communication Services Common SDK with `TokenCredential` created in the step 1. The `AzureCommunicationTokenCredential`obtains an Azure Communication Services access token for Microsoft Entra ID user seamlessly in the background.
177
177
178
178
> [!NOTE]
179
179
> The following sections describe how to create `AzureCommunicationTokenCredential`.
@@ -187,12 +187,11 @@ The developer's required actions are shown in following diagram:
187
187
188
188
The user represents the Fabrikam users of the Contoso application. The user experience is shown in the following diagram:
189
189
190
-
![Diagram of user actions to enable Azure Communication Services support for Microsoft Entra ID users.]()
190
+

191
191
192
192
1. The Fabrikam user uses the Contoso *client application* and is prompted to authenticate.
193
-
1. The Contoso *client application* uses the Azure Identity SDK to authenticate the user against the Fabrikam Microsoft Entra tenant for the Contoso application with Communication Services Clients permissions.
194
-
1. Authentication is redirected to the *client application*, as defined in the property *Redirect URI* in the Contoso application.
195
-
1. The Communication Common SDK seamlessly exchanges the Microsoft Entra user token for Azure Communication Services access token of Microsoft Entra ID user in the background.
193
+
1. The Contoso *client application* uses the Azure Identity SDK to authenticate the user against the Fabrikam Microsoft Entra tenant for the Contoso application with Communication Services Clients permissions. Authentication is redirected to the *client application*, as defined in the property *Redirect URI* in the Contoso application.
194
+
1. The Communication Common SDK seamlessly obtains an Azure Communication Services access token for Fabrikam Entra ID user in the background.
196
195
197
196
Developers can integrate the Communication Services Calling SDK or Chat SDK by providing `AzureCommunicationTokenCredential`.
198
197
@@ -207,4 +206,4 @@ In this quickstart, you learned how to:
207
206
Learn about the following concepts:
208
207
209
208
-[Support Microsoft Entra ID users in Azure Communication Services](../concepts/identity-model.md#microsoft-entra-id-integrating-with-entra-id)
210
-
-[Single-tenant and multitenant authentication for Microsoft Entra Id users](../concepts/entra-id-authentication-overview.md)
209
+
-[Single-tenant and multitenant authentication for Microsoft Entra ID users](../concepts/entra-id-authentication-overview.md)
0 commit comments