FreeNew: the 58-page Authentication Analytics Whitepaper on the 10 login KPIs that matterDownload
Back to Overview

What are PublicKeyCredentialRequestOptions in WebAuthn?

PublicKeyCredentialRequestOptions explained: all WebAuthn login options incl. allowCredentials, userVerification, hints and the account enumeration risk.

Vincent Delitz
Vincent Delitz

Created: December 18, 2023

Updated: November 23, 2026

public key credential request options
Key Facts
  • PublicKeyCredentialRequestOptions is the server-generated WebAuthn dictionary passed to navigator.credentials.get() to authenticate with an existing passkey or security key. Only challenge is required; all other members are optional.
  • allowCredentials is the most security-critical field: an empty list enables usernameless login and Conditional UI without revealing account existence; a filled list exposes which accounts have passkeys.
  • userVerification set to "required" fails authentication if the device cannot perform a biometric or PIN check. Use it when the passkey replaces both password and MFA.
  • With Conditional UI (mediation: "conditional"), passkeys appear in the autofill of the username field. This only works with discoverable credentials and an empty allowCredentials list.

What are PublicKeyCredentialRequestOptions?#

PublicKeyCredentialRequestOptions is the WebAuthn dictionary that tells the browser how to log in with an existing passkey or security key. The Relying Party server generates it, the frontend passes it to navigator.credentials.get({ publicKey }) and the authenticator answers with a signed assertion.

Only challenge is required. The most important decision is how you use allowCredentials: it determines whether the login is usernameless, whether Conditional UI works and whether your login reveals which accounts exist.

Example#

A typical login request for usernameless passkey login, serialized as JSON (binary values are base64url encoded):

{ "challenge": "pT7HMA-...dFPHk", "timeout": 300000, "rpId": "passkeys.eu", "allowCredentials": [], "userVerification": "required", "hints": [], "extensions": {} }

Continue reading for a breakdown of every member and the values we recommend for different login flows.


Relevance in WebAuthn#

As shown in the login flow, sending PublicKeyCredentialRequestOptions to the frontend is the first step of every WebAuthn authentication. The backend stores the cryptographic challenge, the authenticator signs it with the private key and the backend verifies the signature with the stored public key.

All members at a glance#

MemberRequiredDefaultWhat it controls
challengeYesnoneRandom value that the authenticator signs
timeoutNobrowser specificHow long the browser waits for the user (300000 ms recommended)
rpIdNocurrent domainWhich Relying Party's credentials can be used
allowCredentialsNo[]Which credentials are allowed. Empty means any discoverable one
userVerificationNo"preferred"Whether a biometric or PIN check is required
hintsNo[]UI hints: security-key, client-device or hybrid
extensionsNo{}Additional features such as prf, largeBlob or appid

Technical breakdown#

Here is an explanation of every member as defined in the WebAuthn Level 3 specification.

challenge#

"challenge": "pT7HMA-...dFPHk"

The cryptographic challenge is a random value of at least 16 bytes, generated by the server for every login attempt. The authenticator signs it together with the authenticator data and the clientDataJSON. The server accepts each challenge only once, which protects against replay attacks.

timeout#

"timeout": 300000

timeout is a hint in milliseconds for how long the browser should wait for the user. Browsers may ignore or cap it. WebAuthn Level 3 recommends 300000 to 600000 ms with 300000 ms (five minutes) as default. A value of only a few hundred milliseconds aborts the ceremony before the user can react. Let the server-side challenge expire after the same time. For Conditional UI the browser ignores the timeout and keeps the request open while the user is on the login page, so plan how you handle expired challenges.

rpId#

"rpId": "passkeys.eu"

rpId is the Relying Party ID the credentials were registered for. If you leave it out, the browser uses the current domain. Set it explicitly if you log in on a subdomain (e.g. login.passkeys.eu) but registered the passkeys for passkeys.eu.

allowCredentials#

"allowCredentials": [ { "type": "public-key", "id": "Xk2b...9fQ", "transports": ["internal", "hybrid"] } ]

allowCredentials lists the credentials that may be used, in order of preference. Each entry is a credential descriptor with the credential id, the type and optionally the transports stored at registration. The transports help the browser decide whether to look on the device, ask for a security key or show a QR code.

  • Empty list: The browser shows all discoverable credentials for the rpId. The user picks the account and the response contains the user handle to identify them. This is how usernameless login and Conditional UI work.
  • Filled list: Only the listed credentials can be used. You need this for non-discoverable credentials, e.g. security keys used as a second factor after the password, and for identifier-first flows where the user enters an email or customer number first.

See the section on account enumeration below before you decide which one to use.

userVerification#

"userVerification": "required"

userVerification defines whether the authenticator must verify the user with a biometric, PIN or device passcode:

  • "required": The login fails if the authenticator cannot verify the user. Use it when the passkey replaces password and MFA.
  • "preferred" (default): Verification happens if the authenticator supports it. Always check the UV flag in the authenticator data on the server.
  • "discouraged": Asks the authenticator to skip verification, e.g. for a security key tap after the password.

Read more about user verification.

hints#

"hints": ["security-key"]

hints (WebAuthn Level 3) tell the browser which UI to show first: "client-device", "security-key" or "hybrid". They do not restrict which authenticator can be used. A typical use is "security-key" for flows where the user is known to log in with a hardware key, so the browser does not first show a QR code.

extensions#

"extensions": { "prf": { "eval": { "first": "Zm9v..." } } }

extensions request additional processing during login. The most relevant ones are:

mediation (outside of the publicKey options)#

navigator.credentials.get({ publicKey: requestOptions, mediation: "conditional", });

mediation is not part of PublicKeyCredentialRequestOptions but of the surrounding CredentialRequestOptions from the Credential Management API. It controls how the browser presents the request:

  • "optional" (default): The browser shows the passkey dialog as a modal.
  • "conditional": Conditional UI. Passkeys appear in the autofill of an input field with autocomplete="username webauthn". The browser only uses discoverable credentials, so leave allowCredentials empty. Check PublicKeyCredential.isConditionalMediationAvailable() first.
  • "required" and "silent": Defined by Credential Management but rarely relevant for passkeys.

A newer mode is immediate mediation, which only shows UI if a credential is available right away.

Passing the options from JSON#

PublicKeyCredential.parseRequestOptionsFromJSON() converts the JSON options from your server (base64url encoded binary values) into the format navigator.credentials.get() expects. It is available since Chrome and Edge 129, Firefox 119 and Safari 18.4.


allowCredentials and account enumeration#

How you fill allowCredentials is the most security-relevant decision in passkey login and the one we discuss most often with banks.

In an identifier-first flow, the user enters an email or customer number and the server returns the credential IDs of that account in allowCredentials. This filters the passkey dialog to the right account, which is useful when several people share a computer. But the response also tells anyone who enters an identifier that the account exists and has a passkey. If identifiers are short numbers, an attacker can simply test them all. This is account enumeration.

There are three ways to handle it:

  1. Accept the enumeration risk: Identifier-first with real credential IDs. Many large consumer services do this, because their account identifiers are not secret anyway. Regulated businesses usually cannot accept it. Combine it with rate limiting and bot detection.
  2. Usernameless login: Send an empty allowCredentials list, either from a separate passkey button or via Conditional UI in the username field. The browser only shows passkeys that exist on the device, so an attacker learns nothing. The trade-off is that you cannot ask for the identifier first. Conditional UI also requests options on every visit of the login page, so challenge generation and storage must scale with your login traffic.
  3. Passkeys only on known browsers: Remember on the device (e.g. with a signed cookie) that a passkey was created and only then offer passkey login after the identifier was entered. This protects against remote enumeration, but synced passkeys do not work on a new device until the user has logged in there once with password and MFA.

If you need identifier-first and cannot accept the risk, you can return fake credential IDs for unknown identifiers. The WebAuthn specification suggests pseudo-random values derived deterministically from the username: random IDs that change on every request give the fake away, and so do IDs that are the same for every username. In practice the list also needs a realistic length and the response must take the same time as for a real account. If the browser does not find any of the IDs on the device, it typically offers to use a phone via QR code or a security key, so users without a passkey on this device need a clear way back to the password.

You cannot show a "no passkey found" message in any of these approaches. WebAuthn does not tell the website whether a passkey exists on the device. This is by design.

OptionUsernameless / Conditional UIIdentifier-first passkey loginSecurity key as second factorStep-up for a transaction
allowCredentials[]credential IDs of the accountcredential IDs of the accountcredential IDs of the account
userVerification"required""required""discouraged""required"
hintsnonenone["security-key"]none
Enumeration risknoneyes, mitigate or acceptafter password onlynone, user is logged in

PublicKeyCredentialRequestOptions FAQs#

How do PublicKeyCredentialRequestOptions facilitate user authentication in WebAuthn?#

They provide everything the browser needs to request an assertion: a fresh challenge, the RP ID, the allowed credentials and the user verification requirement. The server verifies the returned signature against the stored public key and the issued challenge.

What is the significance of the challenge member in PublicKeyCredentialRequestOptions?#

The challenge makes every login unique. Because the server accepts each challenge only once, a recorded assertion cannot be replayed.

Should allowCredentials be empty?#

Leave it empty for usernameless login and Conditional UI. Fill it only if the user has already been identified, e.g. after entering the password for a second-factor security key, or if you accept that an identifier-first flow reveals which accounts exist.

Why should a bank not send allowCredentials after the user enters a customer number?#

Because the response reveals that the customer number exists and has a passkey. Attackers can use this to build lists of valid customers. Banks usually prefer usernameless login or camouflage unknown identifiers with deterministic fake credential IDs.

What's the difference between PublicKeyCredentialRequestOptions and PublicKeyCredentialCreationOptions?#

Both are sent by the backend and contain a challenge. PublicKeyCredentialCreationOptions are used to create a new credential with navigator.credentials.create(), while PublicKeyCredentialRequestOptions are used to log in with an existing credential via navigator.credentials.get().

When do the prf and largeBlob extensions require a filled allowCredentials list?#

The prf extension's evalByCredential field, which allows different inputs per credential, requires a filled allowCredentials list. The largeBlob extension requires exactly one entry in allowCredentials when writing a blob to a credential. Both extensions can be used without these constraints when per-credential inputs or write operations are not needed. Both rules are part of the client extension processing in the WebAuthn Level 3 specification. If they are violated, the browser rejects the request with a NotSupportedError.

Why is allowCredentials empty when using Conditional UI?#

Conditional UI offers passkeys in the autofill of the username field before the user is identified, so the server does not know which credential IDs to send. Browsers only use discoverable credentials in this mode and treat allowCredentials at most as a filter. The input field needs autocomplete="username webauthn" and you should check PublicKeyCredential.isConditionalMediationAvailable() first.

What timeout value does WebAuthn Level 3 recommend for passkey login requests?#

WebAuthn Level 3 recommends a timeout between 300000 and 600000 milliseconds, with 300000 milliseconds (five minutes) as the default. The server-side challenge should expire after the same duration. For Conditional UI, the browser ignores the timeout entirely and keeps the request open while the user remains on the login page.

Corbado

About Corbado

Corbado is the Passkey Intelligence Platform for large-scale CIAM teams running consumer authentication. We help you see what IDP logs and generic analytics tools can't: where passkeys, passwords, OTP, social login and fallback journeys succeed, stall or fail, which devices and browsers create friction, and when an OS update silently breaks login. Two products: Corbado Observe layers process mining and observability across authentication journeys. Corbado Connect adds managed passkeys with analytics built in alongside your IDP. VicRoads runs passkeys for 5M+ users with Corbado (more than 80% passkey activation rate). Talk to a Passkey Expert →

See how Corbado fits your passkey rollout and existing authentication stack.

Explore the Console

Share this article


LinkedInTwitterFacebook