Validating slack slash command request

Describe the problem/error/question

I am trying to validate a request sent from slack via a slash command to a webhook node, but my code shows the request signature and the calculated signature are different.

Please share your workflow

The switch node at the end is unused at the moment, but should take the output of the code node and continue the flow according to the results.

Share the output returned by the last node

The receivedSignature and expectedSignature are different, but they should be the samae

Information on your n8n setup

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

Hello @tom_firearc, since the signature calculation depends on the code in the Code node, I would first check whether this code is working as expected. Additionally, I recommend avoiding deprecated features like $json["headers"];, as they are not guaranteed to work.

How would you replace $json["headers"];?
I tried many variations of the code but everytime the calculated signature is different than the signature in the message so I have no idea what I am missing.

I used this to verify the signature:

1 Like

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