Skip to content

Commit

Permalink
refactor(docs): add using raw body note when verifying logto signature (
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyijun authored Nov 22, 2023
1 parent c3f93ef commit 0318fa5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/docs/recipes/webhooks/securing-your-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Extract the signature from the `logto-signature-sha-256` header of the webhook r

After that, you should generate a signature using your signing key, and the webhook request body and ensure that the result matches the signature from Logto.

:::note
Use the raw body of the webhook request for signature generation; avoid using the parsed body, as servers may preprocess it before reaching your webhook endpoint handler.
:::

Logto uses an HMAC hex digest to compute the signature.

Here's an example of how to verify the signature in Node.js:
Expand Down

0 comments on commit 0318fa5

Please sign in to comment.