Search code examples
azure-web-app-servicebotframeworkmicrosoft-teamsazure-bot-service

OauthPrompt is not working inside of teams, works fine in emulator and in 'Test in Web chat'


We are trying to authenticate users with Azure AD V2 so we can use their tokens to make API calls to graph API. We are following the sample number 46 in https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/javascript_nodejs/46.teams-auth.

OauthPrompt is not working inside of Teams, works fine in Bot Framework Emulator and in 'Test in Web chat'. Inside of Teams app and in Teams' web app, the bot does not prompt the user with a sign-in button.


Solution

  • Please follow this Add authentication to your Teams bot.

    Important steps to keep in mind while following the doc:

    1. Create the Azure AD identity provider
    2. Register the Azure AD v2 identity provider with the bot.