My Bot service uses a custom service that does AAD authentication before providing data. I have been using AuthBot for getting the AAD authentication. This method causes the user to move away from the bot and then paste back a magic code to complete the authentication. With Microsoft teams, is it possible to use the token generated for Teams authentication for Bot purposes?
问题:
回答1:
It seems like the Microsoft Teams Channel does not support this feature, although it might be possible that it will be supported sometime in the future, as it is already supported for the Cortana Channel.
There exists a workaround by including a webchat tab, where you can chat with the bot instead of a seperate conversation, explained in this blog post (and the one referenced there).
https://stephaneeyskens.wordpress.com/2017/01/07/transparent-bot-authentication-with-microsoft-teams/
回答2:
It depends on how the web app protected. Based on my understanding, if your web app also protected by Azure AD with same app risger on the Azure(refer here), the token you acquire using AuthBot should also work for Microsoft teams.
回答3:
Not exactly what you are looking for, but you don't have to use the 'magic number' pasting method. I've used something along the lines of the SimpleFacebookAuthBot with AAD OAuth. Using this method user is still taken to web for auth but they don't have to paste anything back into the chat. Using ReplyUrl to your own endpoint you can persist the AccessToken in BotData and if using .NET use TokenCache implementation (this could also be stored in BotData) to make refreshing tokens simple.