What you’ll do
Reject spoofed POSTs to your webhook by verifying theRunflow-Signature HMAC header against a shared secret.
Prerequisites
- A Runflow API key.
- A webhook handler (see Handle async callbacks).
Steps
1
Create a callback secret
plain_secret to your secret manager. It is shown once.2
Verify the signature in your handler
Runflow sends
Runflow-Signature: <hex> where the value is HMAC-SHA256(secret, raw_body). The hex string is 64 chars (SHA-256 digest size).3
Use timing-safe comparison
Always compare with
crypto.timingSafeEqual (Node) or hmac.compare_digest (Python). Plain == leaks timing info. Both inputs must be the same length, hence the regex pre-check above.Verify it worked
Send a test callback (re-deliver one):200. Now send a forged POST without the header. Your handler should return 401.
Troubleshooting
Rotation
Create a second secret. Both verify in parallel during cutover. Delete the old secret once traffic confirms the new one works.Related
Handle callbacks
Handler structure.
Callbacks concept
Pattern, retries.