locked
OAuth Card in MS Teams? RRS feed

  • 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.
    Saturday, April 18, 2020 12:47 PM

All replies

  • 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 MS Teams, you need to whitelist the domain in your Bot Manifest. This requirement applies to bots built with the v3 and v4 SDK.

    You could use App Studio to add token.botframework.com to the validDomains section of the manifest file. (or you can build the manifest file manually) 
    Saturday, April 18, 2020 12:55 PM