How to exchange Teams token to Azure communication service dont need admin consent request api Teams.ManageCalls and Teams.ManageChats?

Nguyen Uy Dinh 40 Reputation points
2024-11-20T03:43:23.6466667+00:00

I have create app using communication service to join the call like MSTeams.

I try to implement login feature, using microsoft account (Teams account).
As i know, after login and get access token from Microsoft, i need to exchange to Azure communication service (ACS) token. Meanwhile i need to add scopes Teams.ManageCalls and Teams.ManageChats.
But my app create for multi-tennant to use. And both api Teams.ManageCalls and Teams.ManageChats need to grant admin consent for.

Is there anyway to create login using Microsoft account, and using communication service but dont need to grant any permission?

Thanks you.

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,457 questions
Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
930 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,494 questions
{count} votes

Accepted answer
  1. Shree Hima Bindu Maganti 1,160 Reputation points Microsoft Vendor
    2024-11-20T06:02:13.1133333+00:00

    Hi @Nguyen Uy Dinh ,
    Welcome to the Microsoft Q&A Platform!
    Using Azure Communication Services (ACS) to join Teams calls without requiring admin consent for Teams.ManageCalls and Teams.ManageChats permissions.

    Use ACS Direct Calling Feature: Azure Communication Services allows you to join Teams calls directly by generating ACS tokens. This does not require Teams.ManageCalls or Teams.ManageChats permissions.

    Authenticate Users with Azure AD: Authenticate users using Microsoft Authentication Library (MSAL) to sign in with their Microsoft accounts. Only request basic scopes like openid, profile, and email.

    Exchange Access Token for ACS Identity: Use the ACS Identity SDK to create a user and issue an ACS token without relying on Teams-specific permissions:

    API: Use the CommunicationIdentityClient.createUserAndToken() method.

    Token scopes: Use ["voip"] for calling functionality.

    Avoid Teams-Specific APIs: The Teams APIs like Teams.ManageCalls and Teams.ManageChats are only needed if interacting with Teams-specific features like managing chats or initiating calls programmatically within Teams. These require admin consent, so avoid these APIs.

    Use ACS Meeting URLs: Join Teams calls by using ACS meeting join links (Teams meeting URLs). ACS handles the call connection without needing direct Teams API permissions.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.