Rob1202
Rob1202

Reputation: 59

PAW Rest Client: Generating HMAC-SHA256 Signature for AWS requests

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

Upvotes: 3

Views: 1051

Answers (1)

Micha Mazaheri
Micha Mazaheri

Reputation: 3481

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

Upvotes: 2

Related Questions