Server
Server SDKs - Webhooks
Verifying incoming requests
The Authsignal Server SDK can be used to parse and verify incoming webhook events.
The Authsignal SDK requires the raw body of the request to verify the signature. If you’re using a framework, make sure it doesn’t manipulate the raw body as this will cause the signature verification to fail.
To prevent against replay attacks, the SDK will error if more than 5 minutes has elapsed since the time that the event was sent.
This threshold can be customized by passing a tolerance
value - the time (in minutes) after which requests should be rejected.