API Design · Middle · Question 39 of 75
How should a webhook receiver verify that a request really comes from the provider?
- 1Trust any request to the secret URL
- ✓Correct answer: Check an HMAC signature over the raw body and timestamp with a shared secret, and reject old timestamps
- 3Check the
User-Agentheader
Explanation
Compute the signature over the raw bytes (before JSON parsing) and compare in constant time. Standard Webhooks defines a common scheme.