简体   繁体   中英

Authenticating a user via proactive private message in MS Teams Bot

I need a consultation regarding developing authentication feature in MS teams Bot. The Bot is meant to be used in MS Teams Channels primarily, and in order to secure the api/messages endpoint, I am using OAuth

Now if the user is not authenticated an OAuthPrompt is created for the user to login and continue participating in the channel's thread conversation, however, the login prompt is sent in the channel thread, which does not provide a good user experience.

Instead, I would like to send the OAuthPrompt to the user as a private message.

How could go about implementing this? I am referring this documentation and this example core-proactiveMessages could someone please help me in figuring this out or pointing to correct resources, examples. Thanks

It sounds like you want to restrict the bot to specific tenants just like in this question: What is the botframework security model?

If you're sure you want to restrict the bot to specific users instead of specific tenants, you can still use the middleware from that answer and just adapt it slightly to check the user ID instead of the tenant ID.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM