How could I create a proper signature from POST body in express.js
application?
I can't figure out what I should send instead of payload in official documentations. I tried to pass req.body
in different way, but without any success. There are bunch of middlewares (especially body-parser-xml
) before appropriate controller.
function ComputeHash (secret, payload)
{
var crypto = require('crypto');
var hmac = crypto.createHmac('sha256', secret);
hmac.write(payload);
hmac.end();
return hmac.read().toString('base64');
}