3

I cannot successfully generate a signature for making AWS Requests using PAW.

Here is a link to the signature I am attempting to generate: http://docs.aws.amazon.com/AWSECommerceService/latest/DG/HMACSignatures.html#HMACAuth_ItemsRequired

I have already searched other StackOverflow posts such as: Paw rest client : how to compute HMAC-SHA256 using absolute url as input

Community
  • 1
  • 1
Rob1202
  • 59
  • 5
  • I guess you're getting a warning (little orange flag in the top bar) saying that there's a circular dependency error? We're fixing this issue in the next version Paw 2.2.8 that should be released by next week. I'll update this thread with a good answer when it's released. Thank you! – Micha Mazaheri Jan 07 '16 at 19:26
  • Just installed the 2.2.8 update. Please respond with updated answer when possible. Thank you! – Rob1202 Jan 13 '16 at 20:09
  • I just answered the question below, both regarding the use of SHA-256 and with a general solution for using the Amazon Product Advertising API. I hope it helps! – Micha Mazaheri Jan 19 '16 at 08:33

1 Answers1

2

To answer your precise question about HMAC-SHA256 signatures, here's a code snippet that will work to compute this specific type of signature, returning the result Base 64 encoded in Paw (it uses the HMAC Dynamic Value programmatically):

function signHmac256(input, key) {
    var dv = DynamicValue("com.luckymarmot.HMACDynamicValue", {
        input: input,
        key: key,
        algorithm: 3 /* = SHA256 */,
        uppercase: false /* keep hashes lowercase */,
        encoding: 'Base64' /* encode hash data in base 64 */,
    });
    return dv.getEvaluatedString();
}

Otherwise, about the AWS Product Advertising API, we've made a dynamic value for it just today (which is a good opportunity for use to showcase the extension API), see AWS Product Advertising API Auth for Paw and the GitHub Repository here.

To use this dynamic value, first install it through the link shared above, then you can set up all other parameters and then enter a Signature parameter, and set this dynamic value as its value:

Use the AWS Product Advertising API in Paw HTTP Client

Open the token to enter your AWS Secret Key (used in the HMAC signature):

Use the AWS Product Advertising API in Paw HTTP Client

Micha Mazaheri
  • 3,481
  • 1
  • 21
  • 26
  • This should work for all AWS signatures and not just the E-Commerce Service, correct? – Ngz Feb 01 '16 at 18:25
  • I'm frankly not sure. AWS uses different auth models for all services. I know Amazon S3 is using a different one (that Paw supports natively). – Micha Mazaheri Feb 02 '16 at 13:03