会話型アクションのサポートは 2023 年 6 月 13 日に終了しました。詳細については、
会話型アクションの廃止をご覧ください。
リクエストを検証する
会話 Webhook へのリクエストは、ヘッダーに含まれる次の形式の認可トークンで署名されています。
google-assistant-signature: "<JWT token>"
認証トークンは JSON Web Token 形式に準拠しています。
[Audience] フィールドの値は、対象アクションの Actions Console プロジェクト ID と
クリックします。署名を検証するには、トークンを展開してオーディエンス フィールドを確認します。
アプリのプロジェクト ID と一致します。これを行うには、JWT 互換の
(Google API Node.js クライアントなど)を使用して、
または、Actions on Google Node.js クライアント ライブラリを直接使用して
ConversationOptions#verification
オプションを使用します。次のコード スニペットをご覧ください。
const {conversation} = require('@assistant/conversation');
const app = conversation({verification: 'nodejs-cloud-test-project-1234'});
// HTTP Code 403 will be thrown by default on verification error per request.
JWT の形式は次のとおりです。
{
"iss": "https://accounts.google.com"
"aud": [project-id],
"nbf": number,
"iat": number,
"exp": number,
"jti": string
}
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-10-15 UTC。
[null,null,["最終更新日 2024-10-15 UTC。"],[[["Conversational webhook requests include an authorization token in the `google-assistant-signature` header for security purposes."],["This token is a JSON Web Token (JWT) containing an audience field that matches your Actions console project ID, enabling verification."],["You can verify the signature using a JWT library or the `ConversationOptions#verification` setting within the Actions on Google Node.js Client Library."],["The JWT structure includes standard fields like issuer, audience, issue and expiration timestamps, and a unique identifier."]]],[]]