简体   繁体   English

如何通过我的机器人对现有用户进行身份验证?

[英]How do I authenticate my existing users through my bot?

I am creating a bot that will allow users to interact with an existing web service. 我正在创建一个机器人,该机器人将允许用户与现有的Web服务进行交互。 I want users to be able to start a conversation with my bot and retrieve information that is personalized to them. 我希望用户能够与我的机器人进行对话并检索针对他们的个性化信息。

How do I match a bot user with their existing account? 如何将漫游器用户与其现有帐户匹配? Not all channels use an email address, so I can't use that for matching. 并非所有渠道都使用电子邮件地址,因此我不能将其用于匹配。

I thought about putting a link in the chat window that says something like "You need to register with the bot framework before continuing", and provide a link back to my service that contains their Bot Framework global UserId. 我曾考虑过在聊天窗口中放置一个链接,上面写着“您需要先在Bot框架中注册才能继续”,然后提供一个包含我的服务的链接,该链接包含Bot Framework的全局UserId。 I can then store this Id in my existing service's database, and use it to authenticate the user. 然后,我可以将该ID存储在现有服务的数据库中,并使用它来验证用户身份。

Is there a better way to do this? 有一个更好的方法吗? Are bots supposed to be treated as standalone applications? 机器人应被视为独立应用程序吗?

If you need to identify a user you can simply ask them for identifying information. 如果您需要识别用户,则可以简单地要求他们提供识别信息。

If you need to authenticate we usually recommend sending a link that does an auth flow and then store the access token on the UserBotData so you have it for future messages. 如果您需要进行身份验证,我们通常建议发送一个执行身份验证流程的链接,然后将访问令牌存储在UserBotData上,以便将来用于消息。

You might want to take a look to the Facebook Auth sample to get an idea of a potential flow for the Auth scenario. 您可能需要看一下Facebook Auth示例,以了解Auth场景的潜在流程。 For Azure AD, you need to do a similar flow. 对于Azure AD,您需要执行类似的流程。

Also, in this thread we discussed about how to do it against Azure AD. 此外,在此线程中,我们讨论了如何针对Azure AD进行操作。

Update 更新资料

There are two new samples that you might want to take a look since they are implementing the workflow being discussed. 您可能要看两个新示例,因为它们正在实现所讨论的工作流程。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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