Question: I built my bot using Direct Line and authentication works there. But when I deployed my bot to MS Teams, pressing the sign in button does nothing at all. I used the following code:

```
AddDialog(new OAuthPrompt(
    nameof(OAuthPrompt),
    new OAuthPromptSettings
    {
        ConnectionName = ConnectionName,
        Text = " Welcome! Please Sign In.",
        Title = "Sign In",
        Timeout = 300000, // User has 5 minutes to login (1000 * 60 * 5),
    })
);

```

I tried looking up documentation, but it seems they're using a different framework, or the v3 bot framework. How can I make OAuth work in web and ms teams?

I'm using Bot Framework v4.

Answer: 
How are you testing the Teams app? Did you side-load it into your Teams environment? When you are using Azure Bot Service for Authentication in Teams, you need [to whitelist the domain in your Bot Manifest](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/authentication/auth-oauth-card#getting-started-with-oauthcard-in-teams). This requirement applies to bots built with the v3 and v4 SDK.

You could use [App Studio](https://learn.microsoft.com/en-us/microsoftteams/platform/get-started/get-started-app-studio) to add `token.botframework.com` to the `validDomains` section of the [manifest file](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/apps/apps-package). (or you can build the manifest file manually)
Some weeks ago, we faced the same problem.

Luckily, a few weeks ago, Microsoft uploaded a sample:
<https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/javascript_nodejs/46.teams-auth>

The key here is to use TeamsActivityHandler (found inside teamsActivityHandler.js file) instead of ActivityHandler when extending your bot.

Hope it helps!