Forum Documentation Showcase Pricing Learn more

Base64-encoded HMAC-SHA256 signature?


#1

hey everybody,

I annoyed the forum now a couple of times regarding the Amazon Product Advertising API (sorry guys…). The incredible guys from https://airdev.co/ @gaurav now helped me and have setup the API Call for me.

The only problem is that the API Call requires a signature and a timestamp. The signature is a “base64-encoded HMAC-SHA256 signature” (see here for more information: http://docs.aws.amazon.com/AWSECommerceService/latest/DG/HMACSignatures.html)

Since I am really clueless and far away from a coder I am posting @gaurav’s answer to me:

"It looks like there are 2 more parameters required: Signature and Timestamp. The endpoint doesnt seem to accept unsigned requests (i.e. without signature)

_Couldnt get it to work due to requirement of a ‘base64-encoded HMAC-SHA256 signature’ to be generated by using the access key."

@emmanuel

Is this something where you can help us out here? This is really the last big issue which is keeping me away from publishing my app. I am sorry for annoying you guys I know you have enough things on your list but if you could help out here I would really appreciate it.

Thank you!!!


Making an HTTP request with a JSON and base64 encoded payload
Connecting to Amazon's WMS API with the API Connector
#2

This is not something we support out of the box, so please reach out by email as it’s a (not quick) feature request.


#3

thaks emmanuel. Will write an email now.


#4

@emmanuel (sorry for tagging you again :sweat:)

would it be possible to integrate this:

crypto-js - JavaScript library of crypto standards.

This could maybe help other users too (Generate SHA256 hash for API-token)

Thank you!


#5

@pat did you have any luck with this? I’m trying to connect to the Product Advertising API also.


#6

@Kfawcett there’s a blockspring block called ‘encryption’. That might be helpful to you.


#7

The incredible guys from airdev helped me with this and it works just perfect.

If you need screenshots of the workflow or any help let me know!


#8

@Pat screenshots would be awesome. I’ve got the call setup, but now I’m working on getting the Timestamp formatted and then will have to figure out the signature. That seems like the most complex part.

@gaurav thanks, but blockspring would be another monthly cost for something that we should be able to do in Bubble.


#9

Hey Keith,

Sorry maybe I was not clear enough about this. Airdev and @gaurav helped me to implement it with Blockspring. I would also like to have it implemented directly in bubble but Emmanuel said it is not an easy fix.

If you still need help with Blockspring and the encryption let me know.


#10

It would be interesting to see how you guys used went about integrating block spring. Any chance of a brief write-up for the community?


#11

I can try to write something tomorrow.

But again I have to say all the credit goes to Airdev. I can only recommend to contact them to outsource some of the more difficult parts of app development.


#12

Trying to do a similar thing with HMAC-SHA256 - is Blockspring still the best solution?


#13

yep afaik


#14

Hello Pat, I would greatly appreciate your help with this. I need to create a HMAC-SHA256 signature with a couple more parameters, I am pretty lost on how to do this, it seems I have to do it through a Workflow+Blockspring and then send it to the api? How do I do this?.

Thank you for your time!


#15

You can use the plugin ToolBox. It’s got a workflow action called ‘Server script’, with which you can use Node.js’s built-in modules ‘crypto’ and ‘buffers’:

var crypto = require('crypto')
                  , text = 'I love cupcakes'
                  , key = 'abcdeghi'
                  , hash;

var hash = crypto.createHmac('sha256', key).update(text).digest('hex');

var base64 = Buffer.from(hash).toString('base64');

base64;

#16

Hi @miguel

I tried the your mentioned script above in Toolbox’s server script (first time trying server script), but getting a bubble server error. Below is the screen shot of what I’ve entered. I have the data being displayed as a result in a group. What am I missing or doing wrong for this static example?

thx


#17

I think you need to type base 64; in a separate line at the end, because that’s what the script will return.

I will update the script I posted.

Let me know if it helped.