簡體   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