Trying to understand the signature verification logic for inbound webhooks.
we’re moving IVR logic to GC and need to stop replay attacks on our endpoint. the docs mention X-Genesys-Request-Signature but i’m stuck on the payload hashing. here’s what i have so far:
const crypto = require('crypto');
const sig = req.headers['x-genesys-request-signature'];
const body = req.rawBody; // or req.body?
const algo = 'sha256';
const hmac = crypto.createHmac(algo, secretKey);
hmac.update(body);
const calculated = hmac.digest('hex');
if i use the raw string body it fails. does GC hash the JSON stringified version or the raw buffer? also is there a timestamp check i’m missing to prevent replay?