【问题标题】:Azure Web App bot not working - Authentication issuesAzure Web App bot 不工作 - 身份验证问题
【发布时间】:2019-01-10 11:39:32
【问题描述】:

由于我的权限(我没有注册新应用程序的 Active Directory 权限),我使用我的组织管理员提供的 Microsoft AppId 和密码在 Azure 门户中创建了一个新的 WebApp Bot。

我成功创建了机器人,但它没有按预期工作。消息不是从机器人发送的。我一发送消息,就会在机器人输出中收到此错误,

错误:刷新访问令牌失败,状态码:400 在 Request._callback (D:\home\site\wwwroot\node_modules\botbuilder\lib\bots\ChatConnector.js:697:36) 在 Request.self.callback (D:\home\site\wwwroot\node_modules\request\request.js:185:22) 在 emitTwo (events.js:106:13) 在 Request.emit (events.js:191:7) 在请求。 (D:\home\site\wwwroot\node_modules\request\request.js:1161:10) 在 emitOne (events.js:96:13) 在 Request.emit (events.js:188:7) 在传入消息。 (D:\home\site\wwwroot\node_modules\request\request.js:1083:12) 在 IncomingMessage.g (events.js:291:16) 在 emitNone (events.js:91:20)

然后我尝试解决机器人身份验证问题,我按照此页面中提供的步骤https://docs.microsoft.com/en-us/azure/bot-service/bot-service-troubleshoot-authentication-problems?view=azure-bot-service-3.0#step-2

在 curl 以 AppId 作为 clientId 和 App 密码作为客户端密码的 POST 请求之后,出现以下错误

{
    "error": "unauthorized_client",
    "error_description": "AADSTS700016: Application with identifier '[AppId]' was not found in the directory 'botframework.com'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant\r\nTrace ID: fb60c381-afa9-48f4-8946-155a3ab21a00\r\nCorrelation ID: 5f51355a-8e8d-471d-aeba-a286ba620362\r\nTimestamp: 2019-01-10 06:54:24Z",
    "error_codes": [700016],
    "timestamp": "2019-01-10 06:54:24Z",
    "trace_id": "fb60c381-afa9-48f4-8946-155a3ab21a00",
    "correlation_id": "5f51355a-8e8d-471d-aeba-a286ba620362"
}

从这个,我了解到 Bot 的 AppId 和密码存在问题。

我该如何解决这个问题??

【问题讨论】:

    标签: azure authentication botframework


    【解决方案1】:

    这不是凭据的问题。

    您必须将“BotId”更改为在 Azure 仪表板中注册的那个。

    【讨论】:

    • 对不起,这不是 'BotId',它是用于创建 WebApp 机器人的实际 AppId。该错误描述了我的管理员创建的具有该 AppId 的应用程序未找到。
    • 让我直说。您获得了一个应用程序 ID(普通网络应用程序)来上传您的机器人代码,对吧?你仍然需要一个机器人注册,它被称为机器人频道注册。这是整个过程的关键部分,因为它是您的机器人和各种渠道之间的连接器。它有自己的应用程序 ID 和密码,您必须在机器人配置中使用它们来保护机器人和连接器之间的通道。
    猜你喜欢
    • 2018-07-12
    • 2022-12-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-07-13
    • 2017-03-20
    • 2020-03-09
    • 1970-01-01
    相关资源
    最近更新 更多