Skip to main content

Choose the signing secret

Identity verification uses a separate secret and identity recipe.

Read the signature

X-Tars-Signature contains t, v1 and, during rotation, v2. t is milliseconds since the epoch. The HMAC-SHA256 input joins these values with newline characters, in this order:
  1. The timestamp t.
  2. The uppercase HTTP method.
  3. The exact request path and query string.
  4. The raw request body.
Keep the original body bytes. Do not parse and serialize JSON before checking. Keep the method, path and query unchanged.

Verification recipe

Reject timestamps more than five minutes from your clock. Compare signatures using constant-time equality.

Rotation

v1 uses the current secret. During the 24-hour overlap, v2 uses the previous secret. Accept a valid signature from either secret while replacing your stored secret. Another rotation is refused until the overlap ends.

Other request headers

Only headers applicable to the request are included. These headers do not replace signature verification.