HMAC-SHA 256 signature issues

Hello everyone!

First time poster here. I’m trying to make a API call that requires HMAC SHA 256 encoding. When I use Postman I’m able to make the request but when I use the same information in n8n, I’m unable to make the call, I’m getting 403 errors because of signature issues.

The call is being made to NetSuite. As per their requirements, I’m supposed to generate a signature using specific parameters including a Timestamp. I think my issue is that the Timestamp is being generated in the second node of the workflow called Timestamp, and it is being referenced in the Crypto and HTTP nodes. In other words, there is a lag or time passes by after the timestamp is created in the Timestamp node. I’m not creating the timestamp inside the Crypto node because I need to use the same timestamp in the HTTP request again and I noticed if I create two timestamps (one in the crypto node and one in the HTTP node) I will see different amounts/numbers as timestamps because time passes by betwen the nodes executions.

This is the function I’m using in the Timestamp node {{ $now.toFormat(‘X’) }}. Ideally, I would have the ability to produce the signature inside the HTTP node but I haven’t found a way to SHA 256 encode strings without using the crypto node. I think if I generate the signature inside the HTTP node then the two timestampts (the one generated for signature and the one used in the HTTP header) would be the same and the timestamp will match the call’s timing.

Those this make sense? I’m an accountant that plays a little with APIs, so the Timestamp issue might not be a real issue. Hoping it is because I cannot find anything else wrong with my calls. Any help will be greatly appreciated. Thanks!

Runnning on n8n cloud on a windows laptop, [email protected], database = NetSuite

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Carlos_Cortes,

Welcome to the community :raised_hands:

From what I can remember Netsuite is a pain to work with, I have just taken a quick look at their API docs though and it looks like they might support oauth2 so you could try using a generic oauth2 credential instead of trying to implement it in the http request node manually to see if that works.

Sadly I don’t have a Netsuite account so I am not able to test this.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.