Skip to content

Glossary · Triggers & webhooks

HMAC signature

Also called: HMAC-SHA256, webhook signature, signed webhook

An HMAC signature is a hash of a message computed with a secret key that only the sender and receiver know, sent alongside the message so the receiver can prove it came from the sender and wasn't altered.

HMAC stands for hash-based message authentication code. The sender takes the exact bytes of the request body, runs them through a hash function (almost always SHA-256) together with a shared secret, and puts the result in a header. The receiver does the same calculation with its copy of the secret. If the two results match, the body is authentic and intact; if a single byte changed, they won't.

Verifying one, step by step

  1. Read the raw request body, before any JSON parsing. Re-serializing parsed JSON changes whitespace and key order, and the signature stops matching.
  2. Compute HMAC-SHA256(secret, rawBody) and hex-encode it.
  3. Compare it with the header value (often prefixed, like sha256=…) using a constant-time comparison, so response timing doesn't leak how much of the signature was right.
  4. Reject with 401 or 403 on mismatch, and don't start any work.

Replay protection

A valid signed request can be captured and resent. Senders defend against that by signing a timestamp along with the body (timestamp.body) and receivers reject anything older than a few minutes. Stripe and Slack both use variants of this.

A shared secret header is simpler but weaker: anyone who sees one request can reuse the secret forever, and it says nothing about whether the body was changed in transit. HMAC proves both.

In Fluxo Flow

A Webhook trigger in Signature mode expects x-fluxo-signature: sha256=<hex>, the HMAC-SHA256 of the raw body made with the trigger's secret. If the sender adds x-fluxo-timestamp, the signature must cover timestamp.body and the timestamp must be within five minutes; you can make the timestamp mandatory. Comparisons are constant-time. Outbound, every API webhook delivery carries a Fluxo-Signature header (HMAC-SHA256 of the timestamp and body) with verification code for Node.js and Python in the docs.

All 40 glossary terms

Build your first workflow today.

Build and Dry Run on the Free plan, no credit card. Run live on a paid plan, on your own AI key at cost.

Free to explore · No credit card · 30-day money-back guarantee on paid plans