Verifica delle richieste (Dialogflow)
Le richieste al webhook di conversazione vengono firmate con un token di autorizzazione
nell'intestazione, utilizzando il seguente formato:
authorization: "<JWT token>"
Il token di autenticazione segue il formato token web JSON,
in cui il valore del campo Pubblico è uguale all'ID progetto della console Actions per
l'app. Per verificare la firma, apri il token e assicurati che il campo del pubblico
corrisponda all'ID progetto dell'app. Questa operazione può essere eseguita con modelli
libreria di credenziali, come il client Node.js delle API di Google,
o direttamente usando la libreria client Node.js di Actions on Google
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.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2024-10-15 UTC.
[null,null,["Ultimo aggiornamento 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"]]