I’m not getting the expected signature from the Crypto node
One third party API provider is requesting us to generate a signature to send it along with the http request for security reasons.
They gave us a working example in Postman. In the example they do a Hmac SHA256 encoded in base64. For that they use CryptoJS.
However, I noticed they also add a UTF8 encoding during the action. The code is like this:
However, I couldn’t get the same result using the Crypto node. I tried to replicate the same settings but the result it is not the same. This is the configuration of ours:
The output is:
vq7+FHNBhMrry1HqBRCXmdiC4SZEirU3WAOhmEig1Mk=
Do you know why I’m not getting the same result? Is there any other option I could be missing?
Hi @Anexon, I am not sure what exactly this 3rd party npm module does, so I won’t be able to compare it with the n8n Crypto node unfortunately.
Do you have any documentation for the API your arecalling? Perhaps you can use the default Node.js crypto module instead of the crypto-js? In the Code node you could simply require it using const crypto = require('crypto'); (this works out of the box on cloud, on self-hosted n8n instances you might need to allow it first as described here for example).