leimd/react-native-aws-signature

Incomplete Signature

Opened this issue · 1 comments

Hi,
I am trying to use this library to then hit the SNS API.
This is what I am doing:

var awsSignature = new AWSSignature();

var timestamp = awsSignature.formatDateTime(new Date());

let credentials = {

    SecretKey: '***',
    AccessKeyId: '***'

};
var options = {
    path: "/?Action=CreatePlatformEndpoint&Version=2010-03-31",
    method: 'POST',
    service: 'sns',
    headers: {
         'X-Amz-Date': timestamp,
         'host': 'sns.amazonaws.com'
       },
    region: 'us-west-2',
    body: '{}',
    credentials
};
awsSignature.setParams(options);
var signature = awsSignature.getSignature();

However I keep getting "Incomplete Signature". I was wondering if you had already seen this, cause I don't quite understand if it's an issue with the signature I am trying to create or the request I later make to AWS.

I think timestamp is not correct, I used
var timestamp = awsSignature.formatDateTime(new Date().toISOString());