Webhook Authentication
Your app must verify the authenticity of a received webhook as outlined on this page.
Webhook Secret
You will receive a webhook secret key from us when your webhook endpoint is set up, store this value somewhere safe.
Webhook secret keys are unique for each set up webhook.
Signature
With every webhook sent, you will receive LTD-Webhook-Signature
header, which will contain a computed signature.
To verify the authenticity of a webhook, you need to compute the signature on your side and compare it with the received signature.
There is also an obsolete X-LTD-Webhook-Signature
, which will be removed in the feature.
Computing the signature
Parameter | Description |
---|---|
[key] | The webhook secret key given to you when the webhook was set up. |
[text] | The body content of received webhook. |
The result must match the value received in LTD-Webhook-Signature
header.
Example
Field | Value |
---|---|
Webhook Secret Key | F6FkZsYFvfM8/DFcEOwmLg== |
Field | Value |
---|---|
LTD-Webhook-Signature | b3VVq3GVdtVjBi560WFW2Wf4lUd8wC00UMuaYfcF18U= |
Body content | {"SomeValue":"Example","SomeObject":{"SomeValue2":"Example"}} |
Encode the required values (Body content and Webhook Secret Key) in the format HMAC (Hash-based Message Authentication Code)
In the end, our computed value and the value received in the header (LTD-Webhook-Signature) match, therefore the request is authentic.
[Obsolete] Computing the signature (header X-LTD-Webhook-Signature)
Following sections describe verification of the webhook request using an obsolete header X-LTD-Webhook-Signature
that will be removed in the future.
Field | Description |
---|---|
[affiliateId] | Your partner ID. |
[webhookSecret] | The webhook secret key given to you when the webhook was set up. |
[crc32] | Cyclic Redundancy Check (Crc32) checksum of the body content. |
The result must match the value received in X-LTD-Webhook-Signature
header.
Example X-LTD-Webhook-Signature
Field | Value |
---|---|
Partner (Affiliate) ID | 3fe4e9b5-99b9-46cf-b5e7-e7c94bd19088 |
Webhook Secret Key | F6FkZsYFvfM8/DFcEOwmLg== |
Field | Value |
---|---|
X-LTD-Webhook-Signature | M2ZlNGU5YjUtOTliOS00NmNmLWI1ZTctZTdjOTRiZDE5MDg4OkY2Rmtac1lGdmZNOC9ERmNFT3dtTGc9PTo0MDcwNzIwMTQ4 |
Body content | {"SomeValue":"Example","SomeObject":{"SomeValue2":"Example"}} |
First, calculate the Cycling Redundancy Check (Crc32) checksum of the body content, which in case of this example is 4070720148
.
Then encode the required values in the format specified above to a Base64 string.
Input: 3fe4e9b5-99b9-46cf-b5e7-e7c94bd19088:F6FkZsYFvfM8/DFcEOwmLg==:4070720148
Output: M2ZlNGU5YjUtOTliOS00NmNmLWI1ZTctZTdjOTRiZDE5MDg4OkY2Rmtac1lGdmZNOC9ERmNFT3dtTGc9PTo0MDcwNzIwMTQ4
In the end, our computed value and the value received in the header match, therefore the request is authentic.