X-IMPRINT-HMAC-SIGNATURE header.
Header Format
TheX-IMPRINT-HMAC-SIGNATURE header consists of two parts:
-
Timestamp (
t) – the time the request was sent, represented as milliseconds since January 1, 1970 (Unix epoch). -
Signature (
s) – the cryptographic hash used to verify the request.
Verify signature
1
Extract the timestamp and signature
-
Split the
X-IMPRINT-HMAC-SIGNATUREheader at the comma (,), which separates the timestamp and signature. -
Then, split each part at the equals sign (
=) to extract the respective values.
2
Construct the message to sign
- Concatenate the timestamp , a period (
.), and the raw POST body as a string
1723493048949, the message to sign would be:3
Compute the expected signature
- Use the signing token you were provided during event enrollment (hashed with SHA-256) to generate a Hash-based Message Authentication Code (HMAC).
- Apply HMAC using the SHA-256 algorithm to the message created in Step 2.
4
Compare signatures
- Compare the computed signature with the s value from the X-IMPRINT-HMAC-SIGNATURE header.
- If they match, the request is authentic and was sent by Imprint.