Skip to main content
Each webhook event sent by Orb includes two headers that let you check where it came from:
  1. X-Orb-Timestamp: This header represents the time that the webhook was sent from Orb. You can check this timestamp and compare it to a configured threshold in your system, in order to prevent processing of the webhook event. This can be a mitigation against replay attacks where webhook events are re-sent, causing downstream systems to behave unexpectedly.
  2. X-Orb-Signature: The signature header (formatted as v1=<signature>) is a security header which can be used to confirm that the webhook event originated from Orb. We highly recommend verifying the signature, and only processing events where the header matches the signature you generate. Since each webhook endpoint is associated with a secret, your backend server should re-compute the signature by preparing the payload and subsequently computing an HMAC with the SHA 256 function.
    • The payload for the HMAC is the literal "v1:" followed by the ISO format X-Orb-Timestamp and finally the literal : followed by the event message body itself.
    • You should use the configured secret for the endpoint URL as the signing secret for the HMAC.
    • When comparing to your generated HMAC, you can either prefix the literal v1= to compare with X-Orb-Signature header directly, or extract the element after v1= in X-Orb-Signature to check against your generated value.

Verifying signatures with the SDKs

In Python, TypeScript, Java and Kotlin, Orb’s SDKs verify the signature as they parse a webhook event, with one parsing method per payload style. In Go, call client.Webhooks.VerifySignature before parsing. Parsing payloads with the SDKs lists each SDK’s methods.

Verifying signatures yourself

Here’s an example verification snippet implemented as a Flask endpoint: