简体   繁体   English

Azure AD 与机器人框架/团队的集成

[英]Azure AD integration with Bot Framework / teams

Last week I've been looking at Bot framework Samples , honestly BotFx isn't my area of expertise.上周我一直在查看Bot framework Samples ,老实说 BotFx 不是我的专业领域。 I was playing with these samples from the sample library:我正在使用样本库中的这些样本:

18.bot-authentication
24.bot-authentication-msgraph
46.teams-auth

The required steps for making work each of them are almost the same, for #18 and make it work in the emulator this include:使每个工作所需的步骤几乎相同,对于 #18 并使其在模拟器中工作,这包括:

  • Then in the solution Modify appsettings.json (sample values below)然后在解决方案中修改 appsettings.json(下面的示例值)
    {
      "ConnectionName": "juank",
      "MicrosoftAppId": "cee1234562074c-1b3e-49b4-9e76-b727d73453454e018d",
      "MicrosoftAppPassword": "uxPdfgwo.JAYmgrtU]w5I7KdgxLZSJ.a[qtgtrFxYZ02"
    }
  • After that It's required to run the emulator and configure the following settings之后需要运行模拟器并配置以下设置

  • Up to this point the bot works as expected到目前为止,机器人按预期工作

  • Then I type any... and it just doesn't work.然后我输入任何...但它不起作用。 I receive this answer from the bot :我从机器人那里收到了这个答案:

  • And this data from the trace Operation returned an invalid status code 'Unauthorized'来自跟踪Operation returned an invalid status code 'Unauthorized'此数据Operation returned an invalid status code 'Unauthorized'
{
  "channelId": "emulator",
  "conversation": {
    "id": "77631280-22e8-11ea-93e0-6dc9b0b41a7c|livechat"
  },
  "from": {
    "id": "61bab030-214b-11ea-9cf4-193735472c4b",
    "name": "Bot",
    "role": "bot"
  },
  "id": "ae429e60-22e8-11ea-9786-a543cb22378b",
  "label": "TurnError",
  "localTimestamp": "2019-12-20T00:22:13-05:00",
  "locale": "en-US",
  "name": "OnTurnError Trace",
  "recipient": {
    "id": "f6982626-923e-4fd3-b930-eabf095e96df",
    "role": "user"
  },
  "replyToId": "aacb51f0-22e8-11ea-9786-a543cb22378b",
  "serviceUrl": "https://7eec83e4.ngrok.io",
  "timestamp": "2019-12-20T05:22:13.958Z",
  "type": "trace",
  "value": "Operation returned an invalid status code 'Unauthorized'",
  "valueType": "https://www.botframework.com/schemas/error"
}

And that's all.就这样。

I've successfully acquired the token from the OAuth setting Test tool in azure portal and also using Postman, but i haven't been able to make these Demos work properly once OAuthCard should be presented for login.我已经成功地从 azure 门户中的 OAuth 设置测试工具中获取了令牌,并且还使用了 Postman,但是一旦应该提供 OAuthCard 进行登录,我就无法使这些演示正常工作。 Debugging hasn't been helpful since there isn't other information apart from JSON exposed above.调试没有帮助,因为除了上面公开的 JSON 之外没有其他信息。

Any guidance or orientation about how to fix this will be appreciated.任何有关如何解决此问题的指导或方向将不胜感激。

There is no need to configure Azure Bot Service configurations in emulator.无需在模拟器中配置 Azure 机器人服务配置。 The Application Id and Application Password should be the same as those in appsettings.应用程序 ID 和应用程序密码应与 appsettings 中的相同。

在此处输入图片说明

And you should got these values from Azure portal under Configuration part.您应该从 Azure 门户的配置部分下获得这些值。

在此处输入图片说明

Before doing this, please make sure the auth connection works.在执行此操作之前,请确保身份验证连接有效。

在此处输入图片说明

Update:更新:

在此处输入图片说明

You can change the Microsoft APPId here:您可以在此处更改 Microsoft APPId:

在此处输入图片说明

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

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