Skip to main content
Hopae Connect signs every outgoing webhook delivery with an HMAC-SHA256 signature so you can verify that requests genuinely come from Hopae and have not been tampered with in transit.

How signing works

Each delivery includes an X-Hopae-Signature header with two comma-separated fields:
The signed payload is constructed as:
where <t> is the t value exactly as it appears in the header and <raw-request-body> is the exact UTF-8 bytes of the JSON body received in the HTTP request.

Verifying the signature

Always use the raw request body bytes for signature verification. Do not parse the JSON and re-stringify it — serialisation order differences will cause the comparison to fail.

End-to-end Express example

Use express.raw() middleware on the webhook route so the handler receives the untouched body. Express’s default JSON parser destroys the exact bytes the signature was computed over.

Event types

You cannot choose which event types you receive. Hopae sends each event to your webhook URL as it happens. Check the event field of each payload and ignore the types you do not need. Each payload has the shape:
The top-level event is a string; the nested data.event is an object with its own type, timestamp, and optional metadata — they carry the same event type value, but data.event.metadata lets you pass extra context through the delivery pipeline.

Activation events

Hopae also sends activation.activated and activation.rejected when an eID activation for your app is approved or rejected. They use the same secret and X-Hopae-Signature header, with one difference: t is an ISO 8601 timestamp instead of Unix seconds.
The signed payload is still <t>.<raw-request-body>, with t exactly as received. The examples above accept both formats. They sign the raw t string and parse it as a date only for the replay check. If your code converts t to an integer before signing, activation events fail verification.

Obtaining your webhook secret

Generate the webhook secret in the Console, in your app’s webhook settings. Store the secret securely (e.g. as an environment variable).

Replay protection

The t timestamp in the signature header reflects the moment the delivery was sent. Hopae recommends rejecting webhooks where |now - t| > 300 seconds (5 minutes) to prevent replay attacks, as shown in the examples above.

Backwards compatibility

Apps without a webhook secret deliver webhooks without an X-Hopae-Signature header. Generate the secret once in the Console to enable signing on your app.