question

PhilHaack-9545 avatar image
0 Votes"
PhilHaack-9545 asked NikithaMSFT-0176 commented

Authenticating with a Microsoft Teams Account with Auth0

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.

office-teams-app-devazure-bot-service
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@PhilHaack-9545 Thanks for the question. 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.


0 Votes 0 ·

1 Answer

NikithaMSFT-0176 avatar image
1 Vote"
NikithaMSFT-0176 answered NikithaMSFT-0176 commented

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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@NikithaMSFT-0176 thanks for the response! I ran that sample and it's very interesting and useful, but not quite what I had in mind.

The sample shows how to authenticate to other services once a bot is in your Teams already.

My question is more the opposite. If someone logs into my website: https://ab.bot/ with their Teams account, how do I give them a link to install my bot into their Teams instance.

0 Votes 0 ·

When some logs into your account you can use Graph API to send message to teams. Could you please check this docs?

0 Votes 0 ·