Overview
Learn how to secure your webhooks.
To verify that events were sent by Orum and not by a third party, Orum digitally signs our webhooks. This prevents data modification by third parties in the middle of the webhook transfer and ensures that the webhooks you receive have come from Orum.
Orum will send a Signature
header on each webhook request we make to your server. The signature is made up of the following 2 components, which are then encrypted with an Orum-managed private key:
-
The webhook request body
-
The
created_at
timestamp in the request body
The two components are concatenated into the following formula for the digital signature: SHA256(request.body + plaintext timestamp of created_at
). We utilize a standardized signing library with PKCS1 v1.5 padding, the signature is base64 encoded.
Using the public key that is returned to by making a GET request to the webhooks/secret
endpoint, you can verify the message has not been altered and that it is in fact coming from Orum.
Configure and Retrieve Your Public Key
Initialize your public key
um manages a public-private RSA-2048 key pair that allows you to decrypt your digital signature. To initialize your public key, make a POST request to the webhooks/secret
endpoint.
Retrieve your public key
Once the key is initialized, you may retrieve it at any time by making a GET request to the webhooks/secret
endpoint.
How to Validate the Signature
To verify the digital signature, follow these steps:
Recreate the unencrypted plaintext digital signature
Take a SHA256 hash of the concatenated string of the following information:
-
The webhook request body
-
Plaintext timestamp of
created_at
field in the request body
Decrypt the digital signature with your public key
This can be retrieved by making a GET request to webhooks/secret
endpoint
Verify that the decrypted digital signature from Orum and your recreated unencrypted plaintext digital signature match
Code Examples
Was this page helpful?