Authenticating with a Microsoft Teams Account with Auth0

Phil Haack 66 Reputation points
2021-03-08T21:26:01.363+00:00

Ok, this question may require a bit of context. But the short of it is we are building a MS Teams Bot and a website used to manage the bot. We have two main flows we'd like to support:

New user

  1. Sign in with the account they use to manage their MS Teams instance.
  2. We provide them a link to install our Bot into a Teams instance.
  3. After installing the bot, they're redirected back to our website and we can connect their user account to the instance of Teams.

Existing user

  1. Sign in with the account they use to manage their MS Teams instance.
  2. We list the set of Teams instances associated with that account that we know about.
  3. They choose the Teams instance they want to manage.

For step 2 in the Existing user flow, we need to be able to connect an Azure Bot Service message to a user. For example, suppose another person installs our bot and mentions User A. Later, User A logs into our website. We'd like to be able to connect their account to that earlier mention. That way we could list that Teams instance as one of the instances we know about.

This is the same flow we have for Discord, but we're not sure about the authentication part and connecting that authentication to Teams.

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
840 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,319 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Nikitha-MSFT 541 Reputation points
    2021-03-22T10:32:36.283+00:00

    Copying answer from comments for better understanding

    Here is the doc for developing a bot that will be accessed through the channels: teams.

    Here is the sample team's bot SSO GitHub source code: https://github.com/microsoft/BotBuilder-Samples/tree/main/experimental/teams-sso/csharp_dotnetcore.

    The users will be authenticated against Identity Server V4 in order to use the BOT. Setup an OAuth Connection Settings entry for client's Identity Server, which will be used in the Authentication bot dialog to get the token from the Azure Bot provided token store.
    Given that all the channels will authenticate the users against the client's identity provider before interacting with the bot and will send the JWT token as part of the bot messages.

    Thanks,

    Nikitha.


    If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.