驗證要求 (Dialogflow)

系統會使用授權權杖簽署對對話式 Webhook 的要求 ,並採用以下格式:

authorization: "<JWT token>"

驗證權杖符合 JSON Web Token 格式, 其中目標對象欄位值等於 Actions Console 專案 ID 應用程式如要驗證簽章,請解壓縮權杖,並確認目標對象欄位 與應用程式的專案 ID 相符。方法是使用與 JWT 相容的 憑證程式庫,例如 Google API Node.js 用戶端 或直接使用 Actions on Google Node.js 用戶端程式庫 ActionsSdkOptions#verification 選項。

const {actionssdk} = require('actions-on-google');

const app = actionssdk({verification: 'nodejs-cloud-test-project-1234'});
// HTTP Code 403 will be thrown by default on verification error per request.