在Microsoft Bot Framework中跨通道对用户进行身份验证

问题描述:

我想构建一个可以在多个渠道(如Skype,Team,SMS等)上使用的机器人.为此,我正在使用BotBuilder SDK.我想通过这些渠道对用户进行身份验证.在不要求他通过网页登录的情况下该如何处理?由于我已经登录了应用程序(例如Skype),如何根据上下文获取电子邮件地址或号码并进行隐式身份验证?

I want to build a bot which can be used over multiple channels like Skype, Teams, SMS etc. I am using the BotBuilder SDK for this. I would like to authenticate a user across these channels. How do I this without asking him to log in through a web page? Since I am already logged in application (say Skype),how can I fetch the email address or number depending on the context and authenticate implicitly?

如果我选择使用OAuth进行此操作,则我将要求用户在每次对话中都登录,而我认为这是不正确的方法

If I choose to do this using OAuth, I would require the user to login at every conversation which I do not believe is the right way to go

快速解答:

每个渠道都是特定的,它们并没有提供获取用户信息的独特方式.

Quick answer:

Every channel is specific and they don't provide a unique way to get information about the user.

您在诸如电子邮件地址或ID之类的渠道上将不会拥有共同的信息,因此您将必须构建一些东西来做自己想做的事情(可能询问用户是唯一的方法...).

You will not have a common information across channels like an email address or an ID, so you will have to build something to do what you want (probably asking the user is the only way...).

有关您在某些渠道中获得的信息的更多详细信息:

More details about what you got in some channels:

  • Facebook Messenger: "from": { "id": "1613014XXXXXXXXX", "name": "My Facebook Name" }

对于页面范围ID,该ID是PSID.它不是用户个人资料网址中的用户ID,它特定于托管机器人的Facebook页面

The ID is a PSID, for Page Scoped ID. It is not the User ID that you have in the URL of the user profile, it is specific to your Facebook Page hosting your bot

  • 松弛: "from": { "id": "U54xxxxxx:T53xxxxxx", "name": "nicolas" }

ID由Slack的用户ID和Slack的团队ID的串联组成.名字是我的Slack的用户名

The ID is composed of the concatenation of Slack's User ID and Slack's Team ID. The name is my Slack's username

  • Skype: "from": { "id": "29:1DwlGVzj.....", "name": "My Skype Name" }

此ID是您的漫游器特有的,它是一个哈希值,但尚不清楚其生成方式(不是开源的)

This ID is a specific to your bot, it is a hash but the way it is generated is not known (not open-source)

  • Skype for Business: "from": { "id": "nicolas-r@myCompany.com", "name": "My SkypeForBusiness Name" }

在这里更容易...

  • Microsoft团队: "from": { "id": "29:1ar5DN....", "name": "Nicolas R" }

此处与我们在Skype上发现的相似,该ID是您的漫游器特有的唯一ID,它是一个哈希值,但其生成方式未知(不是开源的)

Here it is similar to what we found on Skype, the ID is an unique ID specific to your bot, it is a hash but the way it is generated is not known (not open-source)

  • Twilio短信: "from": { "id": "+33600000000", "name": "+33600000000" }

ID是用户的电话号码

The ID is the phone number of the user

==>如您所见,要做很多独特的事情

==> As you can see, there is a lot to do to get something unique