验证请求 (Dialogflow)
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
使用授权令牌对对话 webhook 的请求进行签名
,并采用以下格式:
authorization: "<JWT token>"
身份验证令牌遵循 JSON 网络令牌格式,
其中,受众群体字段值等于
应用。如需验证签名,请解压缩令牌并确保填写了 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):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],["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"],null,[]]