Facebook Workplace 中的 BotFramework 集成
BotFramework integration in Facebook Workplace
我用微软的机器人框架创建了一个机器人。我已将它部署在 Microsoft Azure 上,我可以在 Microsoft Teams 中使用它。
现在我想将它集成到 Facebook Workplace。
我已按照 Microsoft 文档中公开的过程进行操作,已安装机器人并且 运行。
但是当我试图在工作区界面中与它交谈时,我得到了这个错误:
see the error detailed screenshot
Error: Invalid signature on incoming request
如您所见,该消息已被机器人接收但无法处理。
下面是引发此错误的更具体的代码段:
Problematic code
我无法解释,因为如果我理解了我在论坛和文档中的红色内容,问题是请求未正确签名但它们直接来自 facebook。
所以你知道我项目的架构是什么package.json 文件:
{
"name": "AppName",
"version": "1.0.0",
"description": "Offer an ergonomic interface between Microsoft Teams and our solution",
"author": "Generated using Microsoft Bot Builder Yeoman generator v4.7.0",
"license": "MIT",
"main": "./lib/index.js",
"scripts": {
"build": "npm run config && npm run html && tsc --build",
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js",
"start": "npm run build && node ./lib/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "nodemon --watch ./src -e ts --exec \"npm run start\"",
"html": "copyfiles -f src/**/*.html lib/",
"config": "copyfiles config/* lib/"
},
"repository": {
"type": "git",
"url": "https://github.com"
},
"dependencies": {
"@microsoft/teams-js": "^1.9.0",
"axios": "^0.21.1",
"botbuilder": "^4.12.0",
"botbuilder-dialogs": "^4.12.0",
"botbuilder-adapter-facebook": "^1.0.11",
"config": "^3.3.6",
"dotenv": "^8.2.0",
"replace": "^1.2.0",
"restify": "^8.5.1",
"rxjs": "^6.6.6",
"vue": "^2.6.12"
},
"devDependencies": {
"@types/restify": "8.5.1",
"copyfiles": "^2.4.1",
"nodemon": "^2.0.7",
"tslint": "^6.1.3",
"typescript": "^4.2.3"
}
}
如果有人以前看过这个或者有任何想法或建议,不客气,我完全没有想法...
我以前遇到过同样的问题,原因是secretparameter。我做了一些研究,我在 Botkit 回购中看到了一个问题,那里的建议是:
验证 app_secret 参数是否正确并与 Facebook 开发者门户中“设置”>“基本”页面上显示的参数匹配
如果您要从 ABS 渠道服务迁移,请注意,一旦迁移,您将无法再将 Bot Framework 模拟器连接到您的机器人应用程序。与模拟器连接将导致无效签名警告。
第一个对我有用,希望对你也有帮助。
Facebook 不再接受 Microsoft Azure 集成,因此您必须自行配置将 facebook 集成到 bot 托管。
您还必须传入环境变量:
- FACEBOOK_VERIFY_TOKEN
- FACEBOOK_APP_SECRET
- FACEBOOK_ACCESS_TOKEN
我用微软的机器人框架创建了一个机器人。我已将它部署在 Microsoft Azure 上,我可以在 Microsoft Teams 中使用它。 现在我想将它集成到 Facebook Workplace。 我已按照 Microsoft 文档中公开的过程进行操作,已安装机器人并且 运行。 但是当我试图在工作区界面中与它交谈时,我得到了这个错误: see the error detailed screenshot
Error: Invalid signature on incoming request
如您所见,该消息已被机器人接收但无法处理。
下面是引发此错误的更具体的代码段: Problematic code
我无法解释,因为如果我理解了我在论坛和文档中的红色内容,问题是请求未正确签名但它们直接来自 facebook。
所以你知道我项目的架构是什么package.json 文件:
{
"name": "AppName",
"version": "1.0.0",
"description": "Offer an ergonomic interface between Microsoft Teams and our solution",
"author": "Generated using Microsoft Bot Builder Yeoman generator v4.7.0",
"license": "MIT",
"main": "./lib/index.js",
"scripts": {
"build": "npm run config && npm run html && tsc --build",
"lint": "tslint -c tslint.json 'src/**/*.ts'",
"postinstall": "npm run build && node ./deploymentScripts/webConfigPrep.js",
"start": "npm run build && node ./lib/index.js",
"test": "echo \"Error: no test specified\" && exit 1",
"watch": "nodemon --watch ./src -e ts --exec \"npm run start\"",
"html": "copyfiles -f src/**/*.html lib/",
"config": "copyfiles config/* lib/"
},
"repository": {
"type": "git",
"url": "https://github.com"
},
"dependencies": {
"@microsoft/teams-js": "^1.9.0",
"axios": "^0.21.1",
"botbuilder": "^4.12.0",
"botbuilder-dialogs": "^4.12.0",
"botbuilder-adapter-facebook": "^1.0.11",
"config": "^3.3.6",
"dotenv": "^8.2.0",
"replace": "^1.2.0",
"restify": "^8.5.1",
"rxjs": "^6.6.6",
"vue": "^2.6.12"
},
"devDependencies": {
"@types/restify": "8.5.1",
"copyfiles": "^2.4.1",
"nodemon": "^2.0.7",
"tslint": "^6.1.3",
"typescript": "^4.2.3"
}
}
如果有人以前看过这个或者有任何想法或建议,不客气,我完全没有想法...
我以前遇到过同样的问题,原因是secretparameter。我做了一些研究,我在 Botkit 回购中看到了一个问题,那里的建议是:
验证 app_secret 参数是否正确并与 Facebook 开发者门户中“设置”>“基本”页面上显示的参数匹配
如果您要从 ABS 渠道服务迁移,请注意,一旦迁移,您将无法再将 Bot Framework 模拟器连接到您的机器人应用程序。与模拟器连接将导致无效签名警告。
第一个对我有用,希望对你也有帮助。
Facebook 不再接受 Microsoft Azure 集成,因此您必须自行配置将 facebook 集成到 bot 托管。 您还必须传入环境变量:
- FACEBOOK_VERIFY_TOKEN
- FACEBOOK_APP_SECRET
- FACEBOOK_ACCESS_TOKEN