Getting Started
Webhook Signature
Webhook signatures are used to ensure the integrity and authenticity of the data received through webhooks.
Introduction
When sending data via webhooks, a signature is generated using a secret key and attached to the HTTP headers. A signature is sent alongside all webhooks sent from Sigma.
Here is an example on how you can set the headers in your requests:
Before processing the payload of the webhook, always verify the signature.
How to verify Sigma signature
To verify Sigma signature from a received webhook, you have to generate the signature on your end and verify if that signature matches the signature sent in the webhook request you received.
To generate a signature, follow these steps
- Concatenate your api with your api secret.
- Use SHA-256 hashing algorithm to hash the concatenated string.
- The hashed result should be the webhook signature.
To validate a signature, follow these steps
- Retrieve the payload and the signature from the HTTP headers of the incoming webhook request.
- Use the same process described above to generate a local signature from the received payload using your API credentials.
- Compare the locally generated signature with the received signature. If they match, the webhook data is valid.