Verification
How to verify webhook requests
Overview
HookStack signs every webhook request to ensure the authenticity and integrity of the payload. This guide explains how to verify these signatures in your webhook handlers.
Understanding the Signature
Each webhook request from HookStack includes several security-related headers:
The signature is a base64-encoded HMAC SHA-256 hash generated using:
- The timestamp from the
X-HookStack-Timestamp
header - The version from the
X-HookStack-Version
header - The complete JSON-stringified payload
Verifying the Signature
Here’s how to verify the signature in your webhook handler:
Using timing-safe comparison when verifying signatures, or checking the timestamp against the current time helps prevent timing attacks.
Best Practices
Example implementation with all best practices:
The signing secret is provided in your HookStack dashboard under each Destination.
It is required for HTTP-type Destinations only.
Testing Verification
HookStack provides test endpoints and signing secrets in the dashboard to help you verify your implementation:
- Use the test webhook feature in the dashboard
- Check the test logs to see detailed request/response information
- Verify your error handling by sending invalid signatures
Use our SDK to automatically handle webhook verification with built-in security best practices.