[英]How to integrate MS Bot with Webex teams using botbulilder webex adapter using node js
I am trying to integrate MS Bot developed in node js with webex teams using botbuilder webex adapter as follows我正在尝试使用 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 });
when try to run I am getting this warning message Need some solution for this.尝试运行时我收到此警告消息需要一些解决方案。
You are getting this error because the signature in the headings is not matching your secret hash.您收到此错误是因为标题中的签名与您的秘密哈希不匹配。 Here is the relevant part of the code which is throwing this error.
这是引发此错误的代码的相关部分。
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;
}
}
You need to check that you have the correct signature in the request header and that you have set the correct secret in you bot options.您需要检查请求标头中的签名是否正确,并且您在机器人选项中设置了正确的秘密。
Reference on Github: https://github.com/howdyai/botkit/blob/master/packages/botbuilder-adapter-webex/src/webex_adapter.ts Github 上的参考: https : //github.com/howdyai/botkit/blob/master/packages/botbuilder-adapter-webex/src/webex_adapter.ts
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.