Anfragen verifizieren (Dialogflow)
Anfragen an Ihren Konversations-Webhook werden mit einem Autorisierungstoken im Header signiert. Verwenden Sie dazu das folgende Format:
authorization: "<JWT token>"
Das Authentifizierungstoken entspricht dem JSON Web Token-Format,
Dabei entspricht der Wert des Zielgruppenfelds der Projekt-ID der Actions Console für
in der App. Entpacken Sie zum Bestätigen der Signatur das Token und achten Sie darauf, dass das Zielgruppenfeld
mit der Projekt-ID für die App übereinstimmt. Dies kann mit einem JWT-kompatiblen
Anmeldedatenbibliothek wie dem Node.js-Client von Google APIs
oder direkt über die Node.js-Clientbibliothek von Actions on Google
ActionsSdkOptions#verification
-Option.
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.
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2024-10-15 (UTC).
[null,null,["Zuletzt aktualisiert: 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"]]