Authentication
Aurinko Signature Validation Steps
To verify that a request truly came from Aurinko, follow these four steps:
1. Extract the Components
You will need three specific pieces of information from the incoming HTTP request:
Timestamp: The value of the X-Aurinko-Request-Timestamp header.
Signature: The value of the X-Aurinko-Signature header (this is your target for comparison).
Raw Body: The exact, unparsed byte array of the request body.
2. Create the Base String
Concatenate the version, the timestamp, and the raw body using a colon (:) as a delimiter.
Current Version: v0
Format: v0:{timestamp}:{raw_body}
3. Compute the HMAC SHA256 Hash
Using your Aurinko Signing Secret as the key, sign the base string created in Step 2.
Java Example:
final byte[] signData = org.apache.commons.lang3.ArrayUtils.addAll(
("v0:" + timestampSeconds + ":").getBytes(StandardCharsets.UTF_8),
payloadBytes
);4. Compare and Verify
Compare your computed hash against the X-Aurinko-Signature header.
Match: The request is authentic; proceed with processing.
Mismatch: The request is invalid and should be discarded (return a 401 or 403 status).
Quick Reference Table
Java example:
Last updated
Was this helpful?
