How to exchange access token from Microsoft account to Azure communication service token?

Nguyen Uy Dinh 20 Reputation points
2024-11-21T04:42:54.42+00:00

I have create an application, use communication service to join call with MSTeams member.
And i have implement login feature, use Microsoft account.

After get access token from MSAL, i use that access token to exchange to ACS (Azure communication service) identityClient.getTokenForTeamsUser , but i get error:
{
"code": "InvalidAccessToken",
"message": "Provided access token is not valid."
}
i has try to call api /teamsUser/:exchangeAccessToken?api-version=2023-10-01 in postman, but get the same error.

My scopes setting is

const scopes = [
"openid",
"profile",
"email"
];

Can you guys help me to fix this error? or do we have any way else to do this function?

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,388 questions
Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
914 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,369 questions
{count} votes

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.