Skip to main content
verifySolution() is called server-side in your verify endpoint to check that the browser correctly solved all challenge tokens. It validates the JWT signature, token expiry, the SHA-256 hash proof, replay state, and optional context binding.

Import

Signature

Parameters

ChallengeToken | ChallengeToken[]
required
The original JWT token(s) returned by createChallenge(). Pass the same tokens your challenge endpoint issued.
number | string | Array<number | string> | ChallengeSolution | ChallengeSolution[]
required
The solution(s) submitted by the browser. Can be:
  • A single nonce string
  • An array of nonce strings
  • A ChallengeSolution object { nonce: string; hash: string }
  • An array of ChallengeSolution objects (what the widget sends as solutions)
VerifySolutionOptions
Optional configuration object. See the options table below.

Options

Return value

Promise<VerifySolutionResult>. The function returns either:
or

Examples

Basic usage:
With structured warning telemetry:
With a remote replay store:

Warning reasons