Verifying signatures
Each webhook call includes three headers with additional information that are used for verification: svix-id where this is the unique message identifier for the webhook message. This identifier is unique across all messages, but will be the same when the same webhook is being resent (e.g. due to a previous failure). svix-timestamp where this is the unique message identifier for the webhook message. This identifier is unique across all messages, but will be the same when the same webhook is being resent (e.g. due to a previous failure). svix-signature where this is the Base64 encoded list of signatures (space delimited).The content to sign is composed by concatenating the id, timestamp and payload, separated by the full-stop character. Flex uses an HMAC with SHA-256 to sign its webhooks. So to calculate the expected signature, you should HMAC the signed_content from above using the base64 portion of your signing secret (this is the part after the whsec_ prefix) as the key. For example, given the secret
fwhsec_Y2NhZDczMDYtNDEyYi0xMWVlLTg5MTItNGY4Y2E5ZmU1MmI4
you will want to use Y2NhZDczMDYtNDEyYi0xMWVlLTg5MTItNGY4Y2E5ZmU1MmI4
.
Here is an example of calculating the signature.
signature
should match the contents of svix-signature
specified in the header.