Verify a webhook
FreeLogicChecks that a webhook really comes from the sender: its HMAC-SHA256 signature must match.
The sender signs the request body with a secret you both know and sends the signature in a header. HMAC Signature signs the body you received with the same secret; Equals compares the two (the received one trimmed and in lower case, as hex usually is).
Sign the body exactly as it arrived: pass the raw text, not a record that was read and written out again.
Shows: HMAC Signature, Trim, To Lower Case, Equals.
Add it to your logic, then add a Call Function step in any logic and pick Verify a webhook. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.
- No matches
- No matches
Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.
| Passed | Example | Input | Output |
|---|---|---|---|
| Genuine | {"body":"{\"id\":\"evt_1\",\"amount\":42}","secret":"whsec_test","signature":"5C138837C330F065C84A4AA41C9CA0AAA5985897D40C9BDCF28DDC4BDC4EF069 "} | {"valid":true} | |
| Changed body | {"body":"{\"id\":\"evt_1\",\"amount\":4200}","secret":"whsec_test","signature":"5c138837c330f065c84a4aa41c9ca0aaa5985897d40c9bdcf28ddc4bdc4ef069"} | {"valid":false} |
