Fintoc-Signature header. Use this header to verify that an event came from Fintoc, not a third party.
Fintoc generates a secret when you register a webhook endpoint. Fintoc shows this secret only once. Use the secret to validate each event’s signature.
Verify that events come from Fintoc
Each event sent by Fintoc includes theFintoc-Signature header. The header contains a Unix timestamp under the t key and a signature under the v1 key:
Validate the signature with an SDK
If you use Python or Node, verify webhook signatures with the Python SDK or Node SDK.Python
Node
Validate the signature with your code
If you want to write your own implementation or use a different programming language, follow these steps:Extract the timestamp and signature
Split theFintoc-Signature header at the , character. Then, split each resulting element at the = character to obtain the key-value pairs. Extract the value for each key.
Rebuild the signed message
Fintoc signs a message composed of the timestamp, a. character, and the raw request body. Rebuild this message with the timestamp from the Fintoc-Signature header and the raw request body.
message has the following format:
Generate the signature
Sign the message with the SHA-256 hash function and the secret generated when you created the webhook endpoint.Compare the signatures
Compare the signature from theFintoc-Signature header with the signature you generated. If the signatures match, you can confirm that Fintoc sent the event.