← Documentação

Verificação segura de webhooks

Use o corpo HTTP bruto, antes de interpretar JSON, com verifyAuthenChainWebhook no Node ou verify_authenchain_webhook no Python.

Contrato v1

HMAC-SHA256(secret,
  "v1." + timestamp + "." + nonce + "." + eventId + "." + rawBody
)

x-authenchain-signature: v1=<hex>
x-authenchain-timestamp: <epoch milliseconds>
x-authenchain-nonce: <32 hex chars>
x-authenchain-event-id: <event id>
x-authenchain-max-age: 300

A janela local nunca excede 300 segundos. O armazenamento de replay deve executar claim(nonce, expiresAt) atomicamente; use Redis SET NX EX ou uma inserção com índice único. Responda 2xx somente depois de validar assinatura e reservar o nonce.

Webhooks | AuthenChain - AuthenChain