【问题标题】:BotFramework integration in Facebook WorkplaceFacebook Workplace 中的 BotFramework 集成
【发布时间】:2021-06-25 14:16:29
【问题描述】:

我用微软的机器人框架创建了一个机器人。我已经将它部署在 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"
    }
}

如果有人以前看过这个或有任何想法或建议,不客气,我完全没有想法......

【问题讨论】:

    标签: typescript azure botframework facebook-messenger-bot facebook-workplace


    【解决方案1】:

    我曾经遇到过同样的问题,原因是秘密参数。我做了一些研究,在 Botkit repo 中看到了一个问题,建议有:

    验证 app_secret 参数是否正确,并与 Facebook 开发者门户的“设置”>“基本”页面上显示的参数匹配

    如果您从 ABS 通道服务迁移,请注意,一旦迁移,您将无法再将 Bot Framework 模拟器连接到您的机器人应用程序。与模拟器连接会导致无效签名警告。

    第一个对我有用,希望对你也有帮助。

    参考:https://github.com/howdyai/botkit/issues/1696 类似帖子:Getting Invalid signature on incoming request with botBuilder adapter for Facebook

    【讨论】:

      【解决方案2】:

      Facebook 不再接受 Microsoft Azure 集成,因此您必须自己配置 Facebook 与机器人托管的集成。 您还必须传入环境变量:

      • FACEBOOK_VERIFY_TOKEN
      • FACEBOOK_APP_SECRET
      • FACEBOOK_ACCESS_TOKEN

      【讨论】:

        猜你喜欢
        • 2018-04-13
        • 1970-01-01
        • 2019-01-09
        • 2018-03-25
        • 1970-01-01
        • 2021-05-15
        • 2018-02-12
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多