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.X-Orb-Signature: The signature header (formatted asv1=<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
payloadfor the HMAC is the literal"v1:"followed by the ISO formatX-Orb-Timestampand 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 withX-Orb-Signatureheader directly, or extract the element afterv1=inX-Orb-Signatureto check against your generated value.
- The
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, callclient.Webhooks.VerifySignature before parsing. Parsing payloads with the SDKs lists each SDK’s methods.