microsoft / botbuilder-dotnet

Welcome to the Bot Framework SDK for .NET repository, which is the home for the libraries and packages that enable developers to build sophisticated bot applications using .NET.
https://github.com/Microsoft/botframework
MIT License
878 stars 484 forks source link

Provide Logging around config issues with auth #6780

Closed tracyboehrer closed 6 months ago

tracyboehrer commented 6 months ago

Specific example: MicrosoftAppId is not the correct AppId for the incoming request. This results in a 401, but is tedious to debug. Mostly likely place is in CloudAdapter.ProcessAcitivtyAsync. Wrap body in UnauthorizedAccessException exception handler, log exception, rethrow. There are multiple ProcessActivityAsync methods, so check each.

Scenario: Provide an incorrect AppId in appsettings and communicate with the bot.

Log the exception message as an error.

tracyboehrer commented 6 months ago

Complication here is that CloudAdapter and BotFrameworkHttpAdapter ProcessActivity catch that exception and just return a 401 in the response.

tracyboehrer commented 6 months ago

@gandiddi Hold on this a bit

tracyboehrer commented 6 months ago

@gandiddi Closing. CloudAdapter already was logging this. I resolved it in the older adapter.