I am using AWS4 to generate signature and passing in request header. Generated signature is not getting validated.
const opts = {
service: 's3',
region: 'region-name',
method: 'GET',
host: 's3-{region-name}.amazonaws.com',
path: '/',
};
I am using following code snipped to generate signature
var signature = aws4.sign(opts, {
accessKeyId: 'XXXXXX',
secretAccessKey: 'XXXXXXXXXXXXXXXXXXXX',
});
And updating request header for AutoUpdater(some module) which ultimately hits aws.
autoUpdater.requestHeaders = signature.headers;
Ending up with error message
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message>
Any suggestion to get this worked ?