会話 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
}