กำลังยืนยันคำขอ (Dialogflow)
คำขอที่ส่งไปยังเว็บฮุคแบบสนทนามีการลงนามด้วยโทเค็นการให้สิทธิ์
ในส่วนหัวโดยใช้รูปแบบต่อไปนี้
authorization: "<JWT token>"
โทเค็นการตรวจสอบสิทธิ์จะเป็นไปตามรูปแบบ JSON เว็บโทเค็น
ที่มีค่าช่องกลุ่มเป้าหมายเท่ากับรหัสโปรเจ็กต์คอนโซล Actions สำหรับ
แอปนั้น หากต้องการยืนยันลายเซ็น ให้คลายการแพคข้อมูลโทเค็นแล้วตรวจสอบว่าช่องกลุ่มเป้าหมาย
ตรงกับรหัสโปรเจ็กต์ของแอป ซึ่งทำได้ด้วยอุปกรณ์ที่เข้ากันได้กับ JWT
ไลบรารีข้อมูลเข้าสู่ระบบ เช่น ไคลเอ็นต์ Node.js ของ Google APIs
หรือใช้ไลบรารีของไคลเอ็นต์ 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.
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-10-15 UTC
[null,null,["อัปเดตล่าสุด 2024-10-15 UTC"],[[["Conversational webhook requests are signed with a JWT token in the authorization header for security."],["The JWT token's audience field should match your Actions Console project ID for verification."],["You can verify the token using JWT libraries or the Actions on Google Node.js Client Library's built-in verification option."]]],["Requests include an authorization header with a JSON Web Token (JWT). The token's audience field must match the Actions Console project ID. Verify the token's signature using a JWT library or the `ActionsSdkOptions#verification` option in the Actions on Google Node.js Client Library. This can be set using the `actionssdk` method with the project ID. Failure to verify will result in a HTTP 403 error.\n"]]