由于我的权限(我没有注册新应用程序的活动目录权限),我已使用组织管理员提供的Microsoft AppId和密码在Azure门户中创建了一个新的WebApp Bot。
我成功地创建了bot,但它没有按预期工作。消息不是从机器人发送的。一旦我在bot输出中收到这个错误,
应请求进行回拨(D:\主页\站点\ wwwroot \节点\模块\botbuilder\lib\bots\ChatConnector.js:697:36)
在Request.self.callback(D:\ home\site\wwwroot\node\u modules\Request\Request.js:185:22)时
在emitTwo(events.js:106:13)
应请求发出(events.js:191:7)
应要求。(D:\home\site\wwwroot\node\u modules\request\request.js:1161:10)
应请求发出(events.js:188:7)
在进入信息。(D:\home\site\wwwroot\node\u modules\request\request.js:1083:12)
在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 password为client secret发出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"
}
从这张照片中,我了解到机器人的AppId和密码有问题。