Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A webhook signature can fail even when the payload appears unchanged because verification checks bytes, not how parsed JSON looks. Capture the original request body before middleware parses or transforms it, verify it using the provider’s exact signature rules, and parse it only after verification succeeds.

Why matching JSON can produce a different signature

Webhook providers calculate signatures over a defined input, such as the request body’s contents or a timestamp combined with the body. Whitespace, key order, character encoding, and other byte-level differences can change that input without changing the JSON object you see.

For example, these JSON texts describe the same object but are not identical byte sequences:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
{"event":"created","id":42}
{ "id": 42, "event": "created" }

If your server parses the request and later serializes the object again, it may produce different bytes from those the provider signed. Verify the original body rather than a reconstruction. GitHub instructs developers to calculate the HMAC over the payload contents, while Slack says to use the raw request body before deserialization. GitHub’s webhook validation documentation and Slack’s request verification documentation describe their respective approaches.

#1 Best Overall
XCHTX 2PK Magnetic Key for Anti-Theft Security Slatwall&Peg Hook Magnet Key
  • Feature: Material is four strong magnets in white plastic house
  • Functions: It is used for displaying your stuffs so that it beautifies and saves your space while it prevents your retail items from missing.Key unlocks your hook lock as security magnetic key ,it meets many purposes.It is suitable for any specific security hook like 6"7"8"peg&slat wall hook& other usages.
  • To use:You put it on the correct position when two tabs are in line ,then you slide it, so you unlock articles
  • Warranty: Erase electronic data off most devices. SO BE CAREFUL PLACING OR STORING ELECTRONICS NEAR,To keep them away from your wallet avoid damaging your credit pinch fingers slamming together or grab up metallic objects

Debug the failure in this order

  1. Identify the provider and endpoint. Confirm which webhook integration is sending the request and which endpoint’s secret is configured. Secrets can differ across endpoints or environments, so check the configuration associated with the failing endpoint.
  2. Preserve the body before it is parsed. At the earliest point in your server’s request lifecycle, retain the original body bytes—or the exact raw representation required by the provider’s official SDK. Do not call JSON parsing middleware, request.json(), or an equivalent operation first if it consumes or transforms the body.
  3. Verify with the provider’s own rules. Use its official SDK or documented formula, signature header, algorithm, and encoding. Do not assume that another provider’s signing procedure applies.
  4. Parse only after verification succeeds. Once the signature passes, decode and parse the body for application logic. Reject or quarantine requests that fail verification according to your service’s error-handling policy.
  5. If it still fails, check the inputs and the route. Confirm the secret value, header name, algorithm, encoding, and whether another middleware or earlier body read changed or consumed the request. Check whether a proxy or load balancer alters the body or relevant headers.
  6. Compare safely and diagnose without leaking data. If implementing verification yourself, use a constant-time comparison function rather than ordinary string equality. Log which verification stage failed, but do not log signing secrets or expose sensitive payload contents.

Provider formats are not interchangeable

The shared principle is to verify the input the provider actually signed. The precise input construction, header, algorithm, output format, and replay protections are provider-specific.

Provider Documented signature details Implementation point
GitHub X-Hub-Signature-256 carries an HMAC-SHA256 hex digest with the sha256= prefix, calculated using the webhook secret and payload contents. GitHub’s examples verify the request body before parsing JSON. Its troubleshooting guidance also calls out a configured and correct secret, the SHA-256 header and algorithm rather than legacy X-Hub-Signature/HMAC-SHA1, possible proxy or load-balancer changes, and UTF-8 handling where the runtime specifies an encoding.
Slack X-Slack-Signature is used with a signing secret and a timestamp header; the timestamp participates in Slack’s verification flow. Use the raw body before deserialization and check that the request is recent. The timestamp check helps protect against replay; do not carry Slack’s timestamp procedure over to another provider unless that provider documents it.

See GitHub Docs: Validating webhook deliveries and Slack’s request verification guide for those provider-specific details. Exact framework APIs differ, so there is no universal raw-body code snippet: consult the documentation for your server framework and the provider’s current instructions.

Rank #2
SecuX PUFido USB-C Security Key with PUF Technology, FIDO2/U2F Certified, Hardware-Rooted Unclonable Security for Passwordless Login and 2FA Authentication
  • A FIDO security key with PUF technology provides a unique, hardware-rooted trust anchor that resists tampering and cyber attacks, offering stronger security than conventional designs.
  • FIDO2 Certified Protection – Enjoy phishing-resistant security with FIDO2 certification, ensuring top-tier account safety across Windows, macOS, Linux, iOS iOS, Android and more.
  • Easy to use & Portable – Designed with a compact USB-C interface, Clife key fits easily on your keychain for secure access anywhere. Simply plug in and authenticate with ease.
  • Universal Compatibility – Works seamlessly with hundreds of FIDO2/U2F compliant services, including popular cloud, email, and social platforms.
  • Backup recommended – To ensure continuous access, register a backup Clife security key as a spare in case your primary key is lost.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Use constant-time signature comparison

After calculating the expected signature, compare it with the supplied signature using a constant-time function. GitHub’s examples include Node.js crypto.timingSafeEqual and Python hmac.compare_digest. GitHub Docs cautions: “Never use a plain == operator.” See its signature validation guidance.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This comparison safeguard does not fix a wrong secret, changed body, or incorrect formula; it protects the comparison step once the right values have been computed.

Rank #4
XCHTX Theft Protection Stop Lock Magnetic Key with Slat Wall & Pegboard Security Hook Lock 6 inch,Sets of 3
  • Material: Key is made of plastic with 4 magnets in house, Hook Lock is made of Plastic & Metal
  • Functions: Hook lock is used for displaying your stuffs so that it beautifies and saves your space while it prevents your retail items from missing.Key unlocks you hook lock as security magnetic key ,it meets many purposes.It is suitable for any specific security hook like 6"7"8"peg&slat wall hook& other usages .
  • Feature:Anti-theft security slatwall hook, White ABS, wire prong width 6.2 mm, Chrome finish. Two prongs that go into slatwall has distance between them that is 1 1/16" on center. Length: 6".
  • To use:Easy to be used for your security hook and so on ,You put it on the correct positon when two tabs are in line ,then you slide it, so you unlock your hook lock to take items out.
Rank #3
XCHTX Magnet Key,Anti-Theft Display Security Peg&Slat wall Hook Lock Key,1Pack
  • Feature: Material is four strong magnets in white plastic house
  • Functions: It is used for displaying your stuffs so that it beautifies and saves your space while it prevents your retail items from missing.Key unlocks your hook lock as security magnetic key ,it meets many purposes.It is suitable for any specific security hook like 6"7"8"peg&slat wall hook& other usages.
  • To use:You put it on the correct position when two tabs are in line ,then you slide it, so you unlock articles
  • Warranty: Erase electronic data off most devices. SO BE CAREFUL PLACING OR STORING ELECTRONICS NEAR,To keep them away from your wallet avoid damaging your credit pinch fingers slamming together or grab up metallic objects

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.