Security

This section describes the two security mechanisms most relevant to integrations:

  1. Incoming signed verification URL (request integrity)
  2. Outgoing signed result URL (result integrity)

These are independent features and can be enabled/used separately.

Incoming signed verification URL (request integrity)

This is the recommended setting for all projects. A verification configuration created in the Developer Console or through the Session API has ForceSignedInput enabled by default, and the console warns before you turn it off. Disabling it is only acceptable for local testing.

Some projects may require that the initial verification URL (the one your application sends the user to) is signed.

Purpose:

  • prevent unauthorized tampering with query parameters before the verification starts
  • ensure the verification session is initiated with an authentic, unmodified set of inputs

Integration guidance:

  • sign with any of your account's API keys: the session keeps that key, signs its result with it and sends it in the webhook's X-API-Key header
  • treat every API key as a secret; after a key leaks, rotate every key of the account, not only the leaked one
  • sign URLs on a trusted system (typically your backend)
  • do not generate signatures in browser JavaScript

If your project requires signed input and the signature is missing/invalid, the verification will be rejected.

A configuration that does not force signed input still accepts a signed URL: a valid signature starts the session with the key that signed it, and a URL without a valid signature starts it with your primary API key.

For maximum security we recommend issuing a fresh signed URL for every session, with both an expiration (reExpiration) and a one-time-use nonce (reNonce). The signature creation endpoint applies safe defaults out of the box:

  • Expiration is enabled by default (1 day lifetime). Calling the create-signature endpoint with no SecuritySettings produces a URL that expires in 24 hours.
  • ExpirationEnabled adds reExpiration to the URL. The link is rejected with 410 Gone after the timestamp passes. The lifetime is controlled by ExpirationInSeconds — default 86400 (1 day), maximum 604800 (7 days).
  • EnableNonce adds reNonce to the URL (opt-in). The first successful session consumes the nonce; subsequent attempts to open the same URL are rejected with 410 Gone.

If your integration genuinely needs a reusable link (for example a verification URL embedded in an email that the user opens days later), send { "expirationEnabled": false } and omit the nonce.

When the URL is opened, the service validates in this order: signature, expiration, nonce. The nonce is only consumed if the signature is valid and the link has not expired, so a forged or stale URL never burns a legitimate nonce.

The same checks are also exposed by the POST /v1/signature/validate endpoint (read-only), so your backend can detect an expired or already-used link before redirecting the user. Validating via this endpoint does not consume the nonce.

Outgoing signature on the result URL (result integrity)

The result redirect includes reSignature, which can be used for tamper detection.

  • Signature validation is optional.
  • If you need higher assurance, validate reSignature on your backend before trusting any other parameters.

Operational recommendations:

  • consider all query parameters untrusted until signature verification passes
  • validate with the key the session was started with: the key that signed the verification URL or created the session, or your primary API key for a session started without one
  • validate on your backend (or another trusted environment)
  • if verification fails, do not trust or persist the reported outcome

Origin validation (for iFrame / Popup window)

In the iFrame and Popup use cases, the verification ends on the page your verification redirects to: the Target URL in the use cases, set as PassedUrl and FailedUrl or per session as rePassedUrl and reFailedUrl. That page posts a message with redirectedTo to the parent window or the opener, so the message comes from the origin of the URL it was loaded from. Host that page on your own origin.

The samples' Target URL, for example, is on https://verifeye-docs.realeyes.ai, and VerifEye's verification_result.html, the page the widget uses, posts from https://verifeye-service-{region}.realeyes.ai. Both post with "*" so that they work on any host page: do not use either as the Target URL of a production iFrame or Popup integration, and when you copy the sample to your own origin, replace "*" with your host page's origin.

Recommendations:

  • on the page you redirect to, post the message to window.parent or window.opener with your host page's origin as the target origin, never "*"
  • on the host page, compare event.origin for exact equality with the origins of the URLs you configured, and ignore every message from any other origin
  • also check that event.source is your iFrame's contentWindow or the popup window you opened
  • before you navigate to event.data.redirectedTo or link to it, parse it with new URL() and check its origin and path
  • treat event.data.redirectedTo as untrusted input: send it to your backend, and trust none of its values until your backend has validated reSignature
  • when you show the URL or a value from it on your page, set it with textContent, never innerHTML

Last updated: 2026-11-11