|
| 1 | +--- |
| 2 | +title: Authentication of custom Teams endpoint |
| 3 | +titleSuffix: An Azure Communication Services concept document |
| 4 | +description: This article discusses authentication of a custom Teams endpoint. |
| 5 | +author: tomaschladek |
| 6 | +manager: nmurav |
| 7 | +services: azure-communication-services |
| 8 | + |
| 9 | +ms.author: tchladek |
| 10 | +ms.date: 06/30/2021 |
| 11 | +ms.topic: conceptual |
| 12 | +ms.service: azure-communication-services |
| 13 | +ms.subservice: teams-interop |
| 14 | +--- |
| 15 | + |
| 16 | +# Authentication flow cases |
| 17 | + |
| 18 | +Azure Communication Services provides developers the ability to build custom Teams calling experience with Communication Services calling software development kit (SDK). This article provides insights into the process of authentication and describes individual authentication artifacts. In the following use cases, we'll demonstrate authentication for single and multi-tenant Azure Active Directory (Azure AD) applications. |
| 19 | + |
| 20 | +## Case 1: Single-tenant application |
| 21 | +The following scenario shows an example of the company Fabrikam, which has built custom Teams calling application for internal use within a company. All Teams users are managed by Azure Active Directory. The access to the Azure Communication Services is controlled via Azure role-based access control (Azure RBAC). |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +The following sequence diagram is showing detailed steps of the authentication: |
| 27 | + |
| 28 | +:::image type="content" source="./media/custom-teams-endpoint/authentication-case-single-tenant-azure-rbac.svg" alt-text="Sequence diagram is describing detailed set of steps, that happens to authenticate Teams user. In the end, client application retrieves an Azure Communication Services access token for single tenant Azure AD application." lightbox="./media/custom-teams-endpoint/authentication-case-single-tenant-azure-rbac.svg"::: |
| 29 | + |
| 30 | +Prerequisites: |
| 31 | +- Alice or her Azure AD Administrator needs to provide consent to the Fabrikam's Azure Active Directory Application before first sign in. To learn more about [consent flow](https://docs.microsoft.com/azure/active-directory/develop/consent-framework). |
| 32 | +- The admin of the Azure Communication Services resource must grant Alice permission to perform this action. You can learn about the [Azure RBAC role assignment](https://docs.microsoft.com/azure/role-based-access-control/role-assignments-portal). |
| 33 | + |
| 34 | +Steps: |
| 35 | +1. Authentication of Alice from Fabrikam against Fabrikam's Azure Active Directory: This step is standard OAuth flow leveraging Microsoft Authentication Library (MSAL) to authenticate against Fabrikam's Azure Active Directory. Alice is authenticating for Fabrikam's Azure AD application. If the authentication of Alice is successful, Fabrikam's Client application receives Azure AD access token 'A'. Details of the token are captured below. Developer experience is captured in the [quickstart](../../quickstarts/manage-teams-identity.md). |
| 36 | +1. Get access token for Alice: This flow is initiated from the Fabrikam's Client application and performs control plane logic authorized by artifact 'A' to retrieve Fabrikam's Azure Communication Services access token 'D' for Alice. Details of the token are captured below. This access token can be used for data plane actions in Azure Communication Services such as calling. Developer experience is captured in the [quickstart](../../quickstarts/manage-teams-identity.md). |
| 37 | +1. Start a call to Bob from Fabrikam: Alice is using Azure Communication Services access token to make a call to Teams user Bob via Communication Services calling SDK. You can learn more about the [developer experience in the quickstart](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md). |
| 38 | + |
| 39 | +Artifacts: |
| 40 | +- Artifact A |
| 41 | + - Type: Azure AD access token |
| 42 | + - Audience: _`Azure Communication Services`_ — control plane |
| 43 | + - Azure AD application ID: Fabrikam's _`Azure AD application ID`_ |
| 44 | + - Permission: _`https://auth.msft.communication.azure.com/Teams.ManageCalls`_ |
| 45 | +- Artifact D |
| 46 | + - Type: Azure Communication Services access token |
| 47 | + - Audience: _`Azure Communication Services`_ — data plane |
| 48 | + - Azure Communication Services Resource ID: Fabrikam's _`Azure Communication Services Resource ID`_ |
| 49 | + |
| 50 | +## Case 2: Multi-tenant application |
| 51 | +The following scenario shows an example of company Contoso, which has built custom Teams calling application for external customers, such as the company Fabrikam. Contoso infrastructure uses custom authentication within the Contoso infrastructure. Contoso infrastructure is using a connection string to retrieve the token for Fabrikam's Teams user. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +The following sequence diagram is showing detailed steps of the authentication: |
| 56 | + |
| 57 | +:::image type="content" source="./media/custom-teams-endpoint/authentication-case-multiple-tenants-hmac.svg" alt-text="Sequence diagram is describing detailed set of steps, that happens to authenticate Teams user and retrieve Azure Communication Services access token for multi-tenant Azure AD application." lightbox="./media/custom-teams-endpoint/authentication-case-multiple-tenants-hmac.svg"::: |
| 58 | + |
| 59 | +Prerequisites: |
| 60 | +- Alice or her Azure AD Administrator needs to provide consent to the Contoso's Azure Active Directory Application before first sign in. To learn more about [consent flow](https://docs.microsoft.com/azure/active-directory/develop/consent-framework). |
| 61 | + |
| 62 | +Steps: |
| 63 | +1. Authentication of Alice from Fabrikam against Fabrikam's Azure Active Directory: This step is standard OAuth flow using Microsoft Authentication Library (MSAL) to authenticate against Fabrikam's Azure Active Directory. Alice is authenticating for Contoso's Azure AD application. If the authentication of Alice is successful, Contoso's Client application receives Azure AD access token 'A'. Details of the token are captured below. Developer experience is captured in the [quickstart](../../quickstarts/manage-teams-identity.md). |
| 64 | +1. Get access token for Alice: This flow is initiated from Contoso's client application and performs control plane logic authorized by artifact 'A' to retrieve Contoso's Azure Communication Services access token 'D' for Alice. Details of the token are captured below. This access token can be used for data plane actions in Azure Communication Services such as calling. Developer experience is captured in the [quickstart](../../quickstarts/manage-teams-identity.md). (https://docs.microsoft.com/azure/role-based-access-control/role-assignments-portal). |
| 65 | +1. Start a call to Bob from Fabrikam: Alice is using Azure Communication Services access token to make a call to Teams user Bob via Communication Services calling SDK. You can learn more about the [developer experience in the quickstart](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md). |
| 66 | + |
| 67 | + |
| 68 | +Artifacts: |
| 69 | +- Artifact A |
| 70 | + - Type: Azure AD access token |
| 71 | + - Audience: Azure Communication Services — control plane |
| 72 | + - Azure AD application ID: Contoso's _`Azure AD application ID`_ |
| 73 | + - Permission: _`https://auth.msft.communication.azure.com/Teams.ManageCalls`_ |
| 74 | +- Artifact B |
| 75 | + - Type: Custom Contoso authentication artifact |
| 76 | +- Artifact C |
| 77 | + - Type: Hash-based Message Authentication Code (HMAC) (based on Contoso's _`connection string`_) |
| 78 | +- Artifact D |
| 79 | + - Type: Azure Communication Services access token |
| 80 | + - Audience: _`Azure Communication Services`_ — data plane |
| 81 | + - Azure Communication Services Resource ID: Contoso's _`Azure Communication Services Resource ID`_ |
| 82 | + |
| 83 | +## Next steps |
| 84 | + |
| 85 | +The following articles might be of interest to you: |
| 86 | + |
| 87 | +- Learn more about [authentication](../authentication.md). |
| 88 | +- Try [quickstart for authentication of Teams users](../../quickstarts/manage-teams-identity.md). |
| 89 | +- Try [quickstart for calling to a Teams user](../../quickstarts/voice-video-calling/get-started-with-voice-video-calling-custom-teams-client.md). |
0 commit comments