BotBuilderCommunity / botbuilder-community-dotnet

Part of the Bot Builder Community Project. Repository for extensions for the Bot Builder .NET SDK, including middleware, dialogs, recognizers and more.
MIT License
278 stars 170 forks source link

Operation returned an invalid status code 'Unauthorized' - AzureAd AuthController #540

Open ppanchal-mobiz opened 11 months ago

ppanchal-mobiz commented 11 months ago

After successfully authenticating the user with Bot.Builder.Community.Middleware.AzureAdAuthentication middleware, the AuthController tries to send a proactive message using this line:

connectorClient.Conversations.SendToConversation(proactiveMessage);

The above line is throwing an exception Microsoft.Bot.Schema.ErrorResponseException with message

Operation returned an invalid status code 'Unauthorized'