验证请求 (Dialogflow)
使用授权令牌对对话 webhook 的请求进行签名
,并采用以下格式:
authorization: "<JWT token>"
身份验证令牌遵循 JSON Web 令牌格式,其中“audience”字段值等于应用的 Actions 控制台项目 ID。如需验证签名,请解压缩令牌并确保“audience”字段与应用的项目 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.
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-10-15。
[null,null,["最后更新时间 (UTC):2024-10-15。"],[[["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."]]],[]]