Search code examples
azure-active-directorybotframeworkmicrosoft-teams

MS Teams Bot: test in web chat is unauthorized for Teams conversation bot from BotBuilder-Samples


I'm having trouble setting this up https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/57.teams-conversation-bot.

I used a bot channel registration and ngrok. I've replaced the MicrosoftAppId and MicrosoftAppPassword(client secret) in the .env file. I also edited the app id in the manifest. But when I try to test the bot in web chat, it's giving me unauthorized with this error: JwtTokenExtractor.getIdentity:err! FetchError: request to https://login.botframework.com/v1/.well-known/openidconfiguration failed, reason: connect ETIMEDOUT

It works when I test it in the emulator locally. Please help me.


Solution

  • I just tested it, and it works for me, All i did was create a bot channel registration, put the messaging endpoint https://xxxxxxa6ab9.ngrok.io/api/messages, and put the app reg secret and appid into the .env and ran the 2 things.

    it sounds like you may have an antivirus/firewall blocking some of the communications between your ngrok or bot and outside. make sure you turn off third party firewalls and such, and just to confirm, you need 2 command windows to run this, one window to run ngrok and a separate window to run the npm start.