繁体   English   中英

如何使用 node js 使用 botbulilder webex 适配器将 MS Bot 与 Webex 团队集成

[英]How to integrate MS Bot with Webex teams using botbulilder webex adapter using node js

我正在尝试使用 botbuilder webex 适配器将 node js 中开发的 MS Bot 与 webex 团队集成,如下所示

//creating webex adapter for bot channel
const adapter = new WebexAdapter({
access_token: process.env.ACCESS_TOKEN,
public_address: process.env.PUBLIC_ADDRESS,
secret: process.env.SECRET });

尝试运行时我收到此警告消息需要一些解决方案。

您收到此错误是因为标题中的签名与您的秘密哈希不匹配。 这是引发此错误的代码的相关部分。

if (this.options.secret) {
   const signature = req.headers['x-spark-signature'];
   const hash = crypto.createHmac('sha1', this.options.secret).update(JSON.stringify(payload)).digest('hex');
   if (signature !== hash) {
      console.warn('WARNING: Webhook received message with invalid signature. Potential malicious behavior!');
      return false;
   }
}

您需要检查请求标头中的签名是否正确,并且您在机器人选项中设置了正确的秘密。

Github 上的参考: https : //github.com/howdyai/botkit/blob/master/packages/botbuilder-adapter-webex/src/webex_adapter.ts

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM