【发布时间】: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