WebAuthn response verification: server checks for registration and sign-in
The browser mediates authenticator use, but the RP server must validate responses before issuing a session. Learn the checks and common failure causes.
WebAuthn is a web API for registering and using public-key credentials. The browser may mediate the authenticator, but the RP server makes the trust decision. This guide follows the W3C WebAuthn Level 3 Recommendation dated 25 August 2026.
For each registration, issue a fresh challenge and bind the response to its request. Check clientDataJSON type is webauthn.create, the challenge and allowed origin match, and attestationObject rpIdHash is the SHA-256 hash of the expected RP ID. Check UP and UV flags and the public-key algorithm against policy; if attestation is required, validate its signature and trust chain. Only then store credential ID, public key, account binding, counter, and needed state.
For every sign-in, issue a new challenge and match the credential ID to the allow-list or account. In discoverable-credential flows, also match userHandle to the account. Require type webauthn.get, the current challenge, an explicitly allowed origin, and the expected RP ID hash. Check UP and requested UV, then verify with the registered public key the signature over authenticatorData followed by SHA-256 of the original clientDataJSON bytes. Apply account and risk policy before issuing a session; never trust a client success flag alone.
A counter no greater than its previous value is a signal to investigate, not proof of cloning; synced credentials or concurrent response order may explain it. For failures, check per-request challenge storage and base64url handling, hash the original JSON bytes, and review protocol, host, and environment settings. Do not allow subdomain origins by default; if needed, restrict them and do not serve untrusted code there. Server transport and library settings are outside the standard; consult current implementation documentation.
Sources
[W3C WebAuthn Level 3: RP registration and assertion verification](https://www.w3.org/TR/webauthn-3/#sctn-rp-operations)
[W3C WebAuthn Level 3: origin validation](https://www.w3.org/TR/webauthn-3/#sctn-verifying-origin)
[W3C WebAuthn Level 3: signature counter](https://www.w3.org/TR/webauthn-3/#sctn-sign-counter)