App security
Set your secret token
Validating payloads from iAdvize
x-iadvize-signature: sha256=b847f045bde28959da58adbbb8fdb58dca33e9ff5ebb746ea324a7b71cc4f912// Example for a POST request
$secretToken = 'yourSecretToken';
$headers = getallheaders();
$iAdvizeSignature = $headers['x-iadvize-signature'];
// Get alogrithm and hash
list($algorithm, $iAdvizeHash) = explode('=', $iAdvizeSignature, 2);
// Get body payload from webhook
$bodyPayload = file_get_contents('php://input');
// Computed hash with body payload
$bodyPayloadHash = hash_hmac($algorithm, $bodyPayload, $secretToken);
// Final check
if (! hash_equals($iAdvizeHash, $bodyPayloadHash)) {
exit('Validation hash failed');
}Validate our IPs
Last updated