navigator.credentials.get() to authenticate with an existing passkey or security
key. Only challenge is required; all other members are optional."required" fails authentication if the device cannot
perform a biometric or PIN check. Use it when the passkey replaces both password and
MFA.mediation: "conditional"), passkeys appear in the autofill of
the username field. This only works with discoverable credentials and an empty
allowCredentials list.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.
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.
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.
| Member | Required | Default | What it controls |
|---|---|---|---|
challenge | Yes | none | Random value that the authenticator signs |
timeout | No | browser specific | How long the browser waits for the user (300000 ms recommended) |
rpId | No | current domain | Which Relying Party's credentials can be used |
allowCredentials | No | [] | Which credentials are allowed. Empty means any discoverable one |
userVerification | No | "preferred" | Whether a biometric or PIN check is required |
hints | No | [] | UI hints: security-key, client-device or hybrid |
extensions | No | {} | Additional features such as prf, largeBlob or appid |
Here is an explanation of every member as defined in the WebAuthn Level 3 specification.
"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": 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": "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": [ { "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.
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.See the section on account enumeration below before you decide which one to use.
"userVerification": "required"
userVerification defines whether the authenticator must verify the user with a biometric, PIN or device passcode:
Read more about user verification.
"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": { "prf": { "eval": { "first": "Zm9v..." } } }
extensions request additional processing during login. The most relevant ones are:
evalByCredential allows
different inputs per credential and
requires a filled allowCredentials list.read: true) or writes (write) a small blob stored with the
credential. Writing
requires exactly one entry in allowCredentials.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:
autocomplete="username webauthn". The browser only
uses discoverable credentials, so leave allowCredentials empty. Check
PublicKeyCredential.isConditionalMediationAvailable() first.A newer mode is immediate mediation, which only shows UI if a credential is available right away.
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.
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:
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.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.
| Option | Usernameless / Conditional UI | Identifier-first passkey login | Security key as second factor | Step-up for a transaction |
|---|---|---|---|---|
allowCredentials | [] | credential IDs of the account | credential IDs of the account | credential IDs of the account |
userVerification | "required" | "required" | "discouraged" | "required" |
hints | none | none | ["security-key"] | none |
| Enumeration risk | none | yes, mitigate or accept | after password only | none, user is logged in |
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.
The challenge makes every login unique. Because the server accepts each challenge only once, a recorded assertion cannot be replayed.
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.
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.
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().
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.
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.
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 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 →
Table of Contents
Related Articles