gpt4 book ai didi

Azure AD 与 Bot 框架/团队集成

转载 作者:行者123 更新时间:2023-12-03 04:06:50 26 4
gpt4 key购买 nike

上周我一直在研究 Bot framework Samples ,老实说 BotFx 不是我的专业领域。我正在使用示例库中的这些示例:

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

使它们工作所需的步骤几乎相同,对于 #18 并使其在模拟器中工作,包括:

  • 然后在解决方案中修改 appsettings.json(示例值如下)
    {
"ConnectionName": "juank",
"MicrosoftAppId": "cee1234562074c-1b3e-49b4-9e76-b727d73453454e018d",
"MicrosoftAppPassword": "uxPdfgwo.JAYmgrtU]w5I7KdgxLZSJ.a[qtgtrFxYZ02"
}
  • 之后需要运行模拟器并配置以下设置

  • 到目前为止,机器人按预期工作

  • 然后我输入任何...,但它不起作用。我收到这个答案来自机器人:

  • 来自跟踪的数据操作返回了无效状态
    代码“未经授权”
{
"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"
}

仅此而已。

我已经成功地从 azure 门户中的 OAuth 设置测试工具获取了 token ,并且还使用了 Postman,但是一旦应提供 OAuthCard 进行登录,我就无法使这些演示正常工作。调试没有什么帮助,因为除了上面公开的 JSON 之外没有其他信息。

任何有关如何解决此问题的指导或指导将不胜感激。

最佳答案

无需在模拟器中配置 Azure Bot 服务配置。应用程序 ID 和应用程序密码应与 appsettings 中的相同。

enter image description here

您应该从 Azure 门户的配置部分获取这些值。

enter image description here

在执行此操作之前,请确保身份验证连接有效。

enter image description here

更新:

enter image description here

您可以在此处更改 Microsoft APPId:

enter image description here

关于Azure AD 与 Bot 框架/团队集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59420484/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com