Forbidden error by creating chat thread

Jan Sr 0 Reputation points
2024-10-23T10:16:49.59+00:00

Hi,

want to implement teams chat via ACS. Calling and chatting is initiated from angular application. Participants are AAD users having teams license.

Access token part is implemented:

List<string> scopes = new() {    
"https://auth.msft.communication.azure.com/Teams.ManageCalls",  
"https://auth.msft.communication.azure.com/Teams.ManageChats",    
"https://graph.microsoft.com/Chat.Create",
"https://graph.microsoft.com/Chat.ReadWrite.All",
"https://graph.microsoft.com/Chat.ReadWrite"
};
    // Create an instance of PublicClientApplication
    var aadClient = PublicClientApplicationBuilder
                    .Create(appId)
                    .WithAuthority(authority)
                    .WithRedirectUri(redirectUri)
                    .Build();
    // Retrieve the AAD token and object ID of a Teams 
    var result = await aadClient.AcquireTokenByUsernamePassword(scopes, user, password).ExecuteAsync();

Azure Communication service has assigned all the permissions listed in the scopes above. All the permissions are granted.

When trying to create thread with generated ACS token by:

POST https://xxx.communication.azure.com/chat/threads?api-version=2024-03-07

Getting following response:

{ "CommunicationError": { "Code": "Forbidden", "Details": [] } }

Thank you for any help.

Azure Communication Services
Azure Communication Services
An Azure communication platform for deploying applications across devices and platforms.
891 questions
0 comments No comments
{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.