简体   繁体   English

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

[英]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.

相关问题 如何使用节点 js 从 Microsoft Bot for Teams 进行 REST API 调用? - How to make a REST API call from Microsoft Bot for Teams using node js? JS,我们如何从浏览器打开桌面应用程序,例如 Zoom 或 Webex - JS, How can we open the desktop app from browser, like Zoom or Webex does 使用 node sdk v4 通过 MS Teams 通道在 Bot 中获取用户配置文件 - Fetching user profile in Bot with MS Teams channel using node sdk v4 面临错误:对于使用 Bot Framework SDK 构建的 MS Teams Bot,此机器人不支持文件附件 - Facing Error: File attachments aren’t supported for this bot for MS Teams Bot built using Bot Framework SDK MS 团队 bot JS - 创建对话 - MS teams bot JS - create conversation 如何使用discord bot节点js从discord中保存图像 - how to save an image from discord using discord bot node js 如何为节点js使用sdk v4重新启动与机器人的连接 - how to restart a connection to the bot using sdk v4 for node js 已解决:使用 Bot Framework SDK 4 向 MS 团队发送自适应卡时出现 onTurnError - SOLVED: Getting onTurnError when sending adaptive card to MS Teams using Bot Framework SDK 4 如何使用 Node.js node-telegram-bot-api 从电报机器人订阅和取消订阅用户? - How to subscribe and unsubscribe a user from a telegram bot using Node.js node-telegram-bot-api? 如何使用 Node js 结束在机器人框架中的输入 - how to end typing in bot framework using Node js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM