This section describes the status of this document at the time of its publication.
A list of current
W3C publications and the latest revision of this
technical report can be found in the
W3C technical
reports index at http://www.w3.org/TR/.
Publication as an Editors' Draft does not imply endorsement by
W3C and its Members. This is a draft document and may
be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to cite
this document as other than a work in progress.
This document was produced by a group operating under the
W3C Patent Policy.
W3C maintains a
public list of any
patent disclosures made in connection with the deliverables of the group; that page also
includes instructions for disclosing a patent. An individual who has actual knowledge of a
patent that the individual believes contains
Essential
Claim(s) must disclose the information in accordance with
section 6 of the
W3C Patent Policy.
Broadly, compliant authenticators protect public key credentials, and interact with user agents to implement the
Web Authentication API.
Implementing compliant authenticators is possible in software executing
(a) on a general-purpose computing device,
(b) on an on-device Secure Execution Environment, Trusted Platform Module (TPM), or a Secure Element (SE), or
(c) off device.
Authenticators being implemented on device are called platform authenticators.
Authenticators being implemented off device (roaming authenticators) can be accessed over a transport such
as Universal Serial Bus (USB), Bluetooth Low Energy (BLE), or Near Field Communications (NFC).
1.1. Specification Roadmap
While many W3C specifications are directed primarily to user agent developers and also to web application developers
(i.e., "Web authors"), the nature of Web Authentication requires that this specification be correctly used by multiple audiences,
as described below.
Relying Party web application developers, especially those responsible for Relying Partyweb application login flows, account recovery flows,
user account database content, etc.
OS platform developers, responsible for OS platform API design and implementation in regards to platform-specific
authenticator APIs, platform WebAuthn Client instantiation, etc.
The below use case scenarios illustrate use of two very different types of authenticators and credentials across two common deployment types,
as well as outline further scenarios. Additional scenarios, including sample code, are given later in § 1.3 Sample API Usage Scenarios.
These examples are for illustrative purposes only, and feature availability may differ between client and authenticator implementations.
1.2.1. Consumer with Multi-Device Credentials
This use case illustrates how a consumer-centric Relying Party can leverage the authenticator built-in to a user’s devices
to provide phishing-resistant sign in using multi-device credentials (commonly referred to as synced passkeys).
1.2.1.1. Registration
On a phone:
User navigates to example.com in a browser and signs in to an existing account using whatever method they have been using
(possibly a legacy method such as a password), or creates a new account.
The phone prompts, "Do you want to create a passkey for example.com?"
User agrees.
The phone prompts the user for a previously configured authorization gesture (PIN, biometric, etc.); the user
provides this.
Website shows message, "Registration complete."
1.2.1.2. Authentication
On a laptop or desktop:
User navigates to example.com in a browser and initiates signing in.
The browser or operating system prompts the user for a previously configured authorization gesture (PIN, biometric, etc.);
the user provides this.
Web page shows that the selected user is signed in, and navigates to the signed-in page.
If the synced passkey is not available on the device:
The browser or operating system prompts the user for an external authenticator,
such as a phone or security key.
The user selects a previously linked phone.
Next, on their phone:
User sees a discrete prompt or notification, "Sign in to example.com."
User selects this prompt / notification.
User is shown a list of their example.com identities, e.g., "Sign in as Mohamed / Sign in as 张三".
User picks an identity, is prompted for an authorization gesture (PIN, biometric, etc.) and provides this.
Now, back on the laptop:
Web page shows that the selected user is signed in, and navigates to the signed-in page.
1.2.2. Workforce with Single-Device Credentials
This use case illustrates how a workforce-centric Relying Party can leverage a combination of a roaming authenticator (e.g., a USB security
key) and a platform authenticator (e.g., a built-in fingerprint sensor) such that the user has:
In this example, the user’s employer mails a security key which is preconfigured with a device-bound passkey.
A temporary PIN was sent to the user out of band (e.g., via an RCS message).
1.2.2.2. Authentication
On a laptop or desktop:
User navigates to corp.example.com in a browser and initiates signing in.
The browser or operating system prompts the user for their security key.
The user connects their USB security key.
The USB security key blinks to indicate the user should press the button on it; the user does.
The browser or operating system asks the user to enter their PIN.
The user enters the temporary PIN they were provided and continues.
The browser or operating system informs the user that they must change their PIN and prompts for a new one.
The user enters their new PIN and continues.
The browser or operating system restarts the authentication flow and asks the user to enter their PIN.
The user enters their new PIN and taps the security key.
Web page shows that the selected user is signed in, and navigates to the signed-in page.
1.2.3. Other Use Cases and Configurations
A variety of additional use cases and configurations are also possible, including (but not limited to):
A user navigates to example.com on their laptop, is guided through a flow to create and register a credential on their phone.
A user obtains a discrete, roaming authenticator, such as a security key with USB and/or NFC connectivity options, loads
example.com in their browser on a laptop or phone, and is guided through a flow to create and register a credential on the
security key.
A Relying Party prompts the user for their authorization gesture in order to authorize a single transaction, such as a payment
or other financial transaction.
1.3. Sample API Usage Scenarios
This section is not normative.
In this section, we walk through some events in the lifecycle of a public key credential, along with the corresponding
sample code for using this API. Note that this is an example flow and does not limit the scope of how the API can be used.
As was the case in earlier sections, this flow focuses on a use case involving a passkey roaming authenticator
with its own display. One example of such an authenticator would be a smart phone. Other authenticator types are also supported
by this API, subject to implementation by the client platform. For instance, this flow also works without modification for the case of
an authenticator that is embedded in the client device. The flow also works for the case of an authenticator without
its own display (similar to a smart card) subject to specific implementation considerations. Specifically, the client platform
needs to display any prompts that would otherwise be shown by the authenticator, and the authenticator needs to allow the client platform to enumerate all the authenticator’s credentials so that the client can have information to show appropriate prompts.
The user visits example.com, which serves up a script. At this point, the user may already be logged in using a legacy
username and password, or additional authenticator, or other means acceptable to the Relying Party.
Or the user may be in the process of creating a new account.
The Relying Party script runs the code snippet below.
The client platform searches for and locates the authenticator.
The client connects to the authenticator, performing any pairing actions if necessary.
The authenticator shows appropriate UI for the user to provide a biometric or other authorization gesture.
The authenticator returns a response to the client, which in turn returns a response to the Relying Party script. If
the user declined to select an authenticator or provide authorization, an appropriate error is returned.
If a new credential was created,
The Relying Party script sends the newly generated credential public key to the server, along with additional information
such as attestation regarding the provenance and characteristics of the authenticator.
The server stores the credential public key in its database and associates it with the user as well as with the
characteristics of authentication indicated by attestation, also storing a friendly name for later use.
The script may store data such as the credential ID in local storage, to improve future UX by narrowing the choice of
credential for the user.
The sample code for generating and registering a new key follows:
windowPublicKeyCredential
publicKey
challenge Uint8Array
rp
name
user
id Uint8Arraywindowatob cccharCodeAt
name
displayName
pubKeyCredParams
type
alg
type
alg
type
alg
authenticatorSelection
userVerification
timeout
excludeCredentials
Uint8Arraywindowatob cccharCodeAt
Uint8Arraywindowatob cccharCodeAt
extensions
navigatorcredentialscreate publicKey
then newCredentialInfo
err
1.3.2. Registration Specifically with User-Verifying Platform Authenticator
The Relying Party asks the user if they want to create a credential with it. If not, terminate this flow.
The user agent and/or operating system shows appropriate UI and guides the user in creating a credential
using one of the available platform authenticators.
Upon successful credential creation, the Relying Party script conveys the new credential to the server.
windowPublicKeyCredential
PublicKeyCredentialisUserVerifyingPlatformAuthenticatorAvailable
then uvpaAvailable
uvpaAvailable
askIfUserWantsToCreateCredential
then userSaidYes
userSaidYes
publicKeyOptions
navigatorcredentialscreate publicKeyOptions
then newCredentialInfo
newCredentialInfo
err
1.3.3. Authentication
This is the flow when a user with an already registered credential visits a website and wants to authenticate using the
credential.
The user visits example.com, which serves up a script.
The script asks the client for an Authentication Assertion, providing as much information as possible to narrow
the choice of acceptable credentials for the user. This can be obtained from the data that was stored locally after
registration, or by other means such as prompting the user for a username.
The Relying Party script runs one of the code snippets below.
The client platform searches for and locates the authenticator.
The client connects to the authenticator, performing any pairing actions if necessary.
The authenticator presents the user with a notification that their attention is needed. On opening the
notification, the user is shown a friendly selection menu of acceptable credentials using the account information provided
when creating the credentials, along with some information on the origin that is requesting these keys.
The authenticator returns a response to the client, which in turn returns a response to the Relying Party script.
If the user declined to select a credential or provide an authorization, an appropriate error is returned.
If an assertion was successfully generated and returned,
The script sends the assertion to the server.
The server examines the assertion, extracts the credential ID, looks up the registered
credential public key in its database, and verifies the assertion signature.
If valid, it looks up the identity associated with the assertion’s credential ID; that
identity is now authenticated. If the credential ID is not recognized by the server (e.g.,
it has been deregistered due to inactivity) then the authentication has failed; each Relying Party
will handle this in its own way.
The server now does whatever it would otherwise do upon successful authentication -- return a success page, set
authentication cookies, etc.
If the Relying Party script does not have any hints available (e.g., from locally stored data) to help it narrow the list of
credentials, then the sample code for performing such an authentication might look like this:
windowPublicKeyCredential
credentialId Uint8Array
options
challenge Uint8Array
timeout
allowCredentials type id credentialId
navigatorcredentialsget options
then assertion
err
On the other hand, if the Relying Party script has some hints to help it narrow the list of credentials, then the sample code for
performing such an authentication might look like the following. Note that this sample also demonstrates how to use the Credential Properties Extension.
windowPublicKeyCredential
encoder TextEncoder
acceptableCredential1
type
id encoderencode
acceptableCredential2
type
id encoderencode
options
challenge Uint8Array
timeout
allowCredentials acceptableCredential1 acceptableCredential2
extensions
navigatorcredentialsget options
then assertion
err
1.3.4. Aborting Authentication Operations
The below example shows how a developer may use the AbortSignal parameter to abort a
credential registration operation. A similar procedure applies to an authentication operation.
authAbortController AbortController
authAbortSignal authAbortControllersignal
authAbortSignalonabort
options
navigatorcredentialscreate
publicKey options
signal authAbortSignal
then attestation
error
errorname
widget
authAbortControllerabort
1.3.5. Decommissioning
The following are possible situations in which decommissioning a credential might be desired. Note that all of these are
handled on the server side and do not need support from the API specified here.
Possibility #1 -- user reports the credential as lost.
User goes to server.example.net, authenticates and follows a link to report a lost/stolen authenticator.
Server returns a page showing the list of registered credentials with friendly names as configured during registration.
User selects a credential and the server deletes it from its database.
In the future, the Relying Party script does not specify this credential in any list of acceptable credentials, and assertions
signed by this credential are rejected.
Possibility #2 -- server deregisters the credential due to inactivity.
Server deletes credential from its database during maintenance activity.
In the future, the Relying Party script does not specify this credential in any list of acceptable credentials, and assertions
signed by this credential are rejected.
Possibility #3 -- user deletes the credential from the authenticator.
User employs a authenticator-specific method (e.g., device settings UI) to delete a credential from their authenticator.
From this point on, this credential will not appear in any selection prompts, and no assertions can be generated with it.
Sometime later, the server deregisters this credential due to inactivity.
1.4. Platform-Specific Implementation Guidance
This specification defines how to use Web Authentication in the general case. When using Web
Authentication in connection with specific platform support (e.g. apps), it is recommended to see
platform-specific documentation and guides for additional guidance and limitations.
2. Conformance
This specification defines three conformance classes. Each of these classes is specified so that conforming members of the class
are secure against non-conforming or hostile members of the other classes.
2.1. User Agents
A User Agent MUST behave as described by § 5 Web Authentication API in order to be considered conformant. Conforming User Agents MAY implement
algorithms given in this specification in any way desired, so long as the end result is indistinguishable from the result that
would be obtained by the specification’s algorithms.
A conforming User Agent MUST also be a conforming implementation of the IDL fragments of this specification, as described in the
“Web IDL” specification. [WebIDL]
2.1.1. Enumerations as DOMString types
Enumeration types are not referenced by other parts of the Web IDL because that
would preclude other values from being used without updating this specification
and its implementations. It is important for backwards compatibility that
client platforms and Relying Parties handle unknown values. Enumerations for this
specification exist here for documentation and as a registry. Where the
enumerations are represented elsewhere, they are typed as DOMStrings, for
example in transports.
As described in § 1.2 Use Cases, an authenticator may be implemented in the operating system underlying the User Agent, or in
external hardware, or a combination of both.
All CBOR encoding performed by the members of the above conformance classes MUST be done using the
CTAP2 canonical CBOR encoding form.
All decoders of the above conformance classes SHOULD reject CBOR that is not validly encoded
in the CTAP2 canonical CBOR encoding form and SHOULD reject messages with duplicate map keys.
3. Dependencies
This specification relies on several other underlying specifications, listed
below and in Terms defined by reference.
Base64url encoding
The term Base64url Encoding refers to the base64 encoding using the URL- and filename-safe character set defined
in Section 5 of [RFC4648], with all trailing '=' characters omitted (as permitted by Section 3.2) and without the
inclusion of any line breaks, whitespace, or other additional characters.
CBOR
A number of structures in this specification, including attestation statements and extensions, are encoded using the
CTAP2 canonical CBOR encoding form of the Compact Binary Object Representation (CBOR) [RFC8949],
as defined in [FIDO-CTAP].
CDDL
This specification describes the syntax of all CBOR-encoded data using the CBOR Data Definition Language (CDDL) [RFC8610].
COSE
CBOR Object Signing and Encryption (COSE) [RFC9052][RFC9053].
The IANA COSE Algorithms registry [IANA-COSE-ALGS-REG] originally established by [RFC8152] and updated by these specifications is also used.
Many of the interface definitions and all of the IDL in this specification depend on [WebIDL]. This updated version of
the Web IDL standard adds support for Promises, which are now the preferred mechanism for asynchronous
interaction in all new web APIs.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED",
"NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
BCP 14 [RFC2119][RFC8174] when, and only when, they appear in all capitals, as shown here.
4. Terminology
Attestation
Generally, attestation is a statement that serves to bear witness, confirm, or authenticate.
In the WebAuthn context, attestation is employed to provide verifiable evidence as to the origin of an authenticator
and the data it emits. This includes such things as credential IDs, credential key pairs, signature counters, etc.
In general, an authenticator is assumed to have only one user.
If multiple natural persons share access to an authenticator,
they are considered to represent the same user in the context of that authenticator.
If an authenticator implementation supports multiple users in separated compartments,
then each compartment is considered a separate authenticator
with a single user with no access to other users' credentials.
Public Key Credential Sources may be backed up in some fashion such that they may become present on an authenticator other
than their generating authenticator. Backup can occur via mechanisms including but not limited to peer-to-peer sync,
cloud sync, local network sync, and manual import/export. See also § 6.1.3 Credential Backup State.
The concept of a ceremony[Ceremony] is an extension of the concept of a network protocol, with human nodes alongside
computer nodes and with communication links that include user interface(s), human-to-human communication, and transfers of
physical objects that carry data. What is out-of-band to a protocol is in-band to a ceremony. In this specification,
Registration and Authentication are ceremonies, and an authorization gesture is often a component of
those ceremonies.
The hardware device on which the WebAuthn Client runs, for example a smartphone, a laptop computer or a desktop computer, and the
operating system running on that hardware.
Note: Modifying or removing items from the value returned from getTransports()
could negatively impact user experience, or even prevent use of the corresponding credential.
The value of the rp.id parameter
specified in the create() operation during credential registration.
This value is a core property of the credential that determines where it can be used.
Storing this value at registration time can help in the future, such as to audit its use,
troubleshoot issues authenticating with it, or to use it across different domains later
via Related Origins.
WebAuthn extensions MAY define additional items needed to process the extension.
Relying Parties MAY also include any additional items as needed,
and MAY omit any items not needed for their implementation.
An identifier that is human-palatable is intended to be rememberable and reproducible by typical human
users, in contrast to identifiers that are, for example, randomly generated sequences of bits [EduPersonObjectClassSpec].
Note:
This is a willful violation of [RFC4949]. In English, a "credential" is both a) the thing presented to prove
a statement and b) intended to be used multiple times. It’s impossible to achieve both criteria securely with a single
piece of data in a public key system. [RFC4949] chooses to define a credential as the thing that can be used multiple
times (the public key), while this specification gives "credential" the English term’s flexibility. This specification
uses more specific terms to identify the data related to an [RFC4949] credential:
"Authentication information" (possibly including a private key)
The process (also known as throttling) by which an authenticator implements controls against brute force attacks by limiting
the number of consecutive failed authentication attempts within a given period of time. If the limit is reached, the
authenticator should impose a delay that increases exponentially with each successive attempt, or disable the current
authentication modality and offer a different authentication factor if available. Rate limiting is often implemented as an
aspect of user verification.
A Relying Party implementation typically consists of both some client-side script
that invokes the Web Authentication API in the client,
and a server-side component that executes the Relying Party operations and other application logic.
Communication between the two components MUST use HTTPS or equivalent transport security,
but is otherwise beyond the scope of this specification.
Note: While the term Relying Party is also often used in other contexts (e.g., X.509 and OAuth), an entity acting as a Relying Party in one
context is not necessarily a Relying Party in other contexts. In this specification, the term WebAuthn Relying Party is often shortened
to be just Relying Party, and explicitly refers to a Relying Party in the WebAuthn context. Note that in any concrete instantiation
a WebAuthn context may be embedded in a broader overall context, e.g., one based on OAuth.
An RP ID is based on a host’s domain name.
It does not itself include a scheme or port, as an origin does.
The RP ID of a public key credential determines its scope.
I.e., it determines the set of origins on which the public key credential may be exercised, as follows:
For example, given a Relying Party whose origin is https://login.example.com:1337, then the following RP IDs are valid:
login.example.com (default) and example.com, but not m.login.example.com and not com.
Another example of a valid origin is http://localhost:8000, due to the origin being localhost.
This is done in order to match the behavior of pervasively deployed ambient credentials (e.g., cookies, [RFC6265]).
Please note that this is a greater relaxation of "same-origin" restrictions than what
document.domain’s setter provides.
A test of user presence is a simple form of authorization gesture and technical process where a user interacts with
an authenticator by (typically) simply touching it (other modalities may also exist), yielding a Boolean result. Note
that this does not constitute user verification because a user presence test, by definition,
is not capable of biometric recognition, nor does it involve the presentation of a shared secret such as a password or
PIN.
User consent means the user agrees with what they are being asked, i.e., it encompasses reading and understanding prompts.
An authorization gesture is a ceremony component often employed to indicate user consent.
A user handle is an opaque byte sequence with a maximum size of 64 bytes, and is not meant to be displayed to the user.
It MUST NOT contain personally identifying information, see § 14.6.1 User Handle Contents.
Note that user verification does not give the Relying Party a concrete identification of the user,
but when 2 or more ceremonies with user verification have been done with that credential
it expresses that it was the same user that performed all of them.
The same user might not always be the same natural person, however,
if multiple natural persons share access to the same authenticator.
Note: Distinguishing natural persons depends in significant part upon the client platform’s
and authenticator’s capabilities.
For example, some devices are intended to be used by a single individual,
yet they may allow multiple natural persons to enroll fingerprints or know the same PIN
and thus access the same user account(s) using that device.
All such operations are performed in the authenticator and are mediated by
the client platform on the user’s behalf. At no point does the script get access to the credentials themselves; it only
gets information about the credentials in the form of objects.
In addition to the above script interface, the authenticator MAY implement (or come with client software that implements) a user
interface for management. Such an interface MAY be used, for example, to reset the authenticator to a clean state or to inspect
the current state of the authenticator. In other words, such an interface is similar to the user interfaces provided by browsers
for managing user state such as history, saved passwords, and cookies. Authenticator management actions such as credential
deletion are considered to be the responsibility of such a user interface and are deliberately omitted from the API exposed to
scripts.
The security properties of this API are provided by the client and the authenticator working together. The authenticator, which
holds and manages credentials, ensures that all operations are scoped to a particular origin, and cannot be replayed against
a different origin, by incorporating the origin in its responses. Specifically, as defined in § 6.3 Authenticator Operations,
the full origin of the requester is included, and signed over, in the attestation object produced when a new credential
is created as well as in all assertions produced by WebAuthn credentials.
The client facilitates these security measures by providing the Relying Party’s origin and RP ID to the authenticator for
each operation. Since this is an integral part of the WebAuthn security model, user agents only expose this API to callers in
secure contexts.
For web contexts in particular,
this only includes those accessed via a secure transport (e.g., TLS) established without errors.
The Web Authentication API is defined by the union of the Web IDL fragments presented in the following sections. A combined IDL
listing is given in the IDL Index.
;
// The structure of this object will be either
// RegistrationResponseJSON or AuthenticationResponseJSON
;
{
;
;
;
;
;
;
};
{
;
;
<> ;
// The publicKey field will be missing if pubKeyCredParams was used to
// negotiate a public-key algorithm that the user agent doesn't
// understand. (See section “Easily accessing credential data” for a
// list of which algorithms user agents must support.) If using such an
// algorithm then the public key must be parsed directly from
// attestationObject or authenticatorData.
;
;
// This value contains copies of some of the fields above. See
// section “Easily accessing credential data”.
;
};
{
;
;
;
;
;
;
};
{
;
;
;
;
};
{
};
This internal slot contains the credential ID, chosen by the authenticator.
The credential ID is used to look up credentials for use, and is therefore expected to be globally unique
with high probability across all credentials of the same type, across all authenticators.
This API does not constrain the format of this identifier,
except that it MUST NOT be longer than 1023 bytes and MUST be sufficient for the authenticator to uniquely select a key.
For example, an authenticator without on-board storage may create identifiers containing a credential private key
wrapped with a symmetric key that is burned into the authenticator.
By setting options.mediation to conditional,
Relying Parties can indicate that they would like to register a credential without prominent modal UI if the user has already consented to create a credential.
The Relying Party SHOULD first use getClientCapabilities()
to check that the client supports the conditionalCreate capability
in order to prevent a user-visible error in case this feature is not available.
The client MUST set BOTH requireUserPresence and requireUserVerification to FALSE when options.mediation is set to conditional
unless they may be explicitly performed during the ceremony.
All BufferSource objects used in this algorithm MUST be snapshotted when the algorithm begins, to
avoid potential synchronization issues. Implementations SHOULD get a copy of the bytes held by the buffer source and use that copy for relevant portions of the algorithm.
When this method is invoked, the user agent MUST execute the following algorithm:
If the origin that is creating a credential is different from the top-level origin of the relevant global object
(i.e., is a different origin than the user can see in the address bar),
the client SHOULD make this fact clear to the user.
If pkOptions.timeout is present, check if its value lies within a
reasonable range as defined by the client and if not, correct it to the closest value lying within that range. Set a timer
lifetimeTimer to this adjusted value. If pkOptions.timeout is not
present, then set lifetimeTimer to a client-specific default.
Note: An effective domain may resolve to a host, which can be represented in various manners,
such as domain, ipv4 address, ipv6 address, opaque host, or empty host.
Only the domain format of host is allowed here. This is for simplification and also
is in recognition of various issues with using direct IP address identification in concert
with PKI-based security.
Note:pkOptions.rp.id represents the
caller’s RP ID. The RP ID defaults to being the caller’s origin’s
effective domain unless the caller has explicitly set
pkOptions.rp.id when calling
create().
Let authenticatorExtensionInput be the (CBOR) result of running extensionId’s client extension processing
algorithm on clientExtensionInput. If the algorithm returned an error, continue.
SetauthenticatorExtensions[extensionId] to the base64url encoding of authenticatorExtensionInput.
Let collectedClientData be a new CollectedClientData instance whose fields are:
Let authenticators represent a value which at any given instant is a set of client platform-specific handles, where each
item identifies an authenticator presently available on this client platform at that instant.
Note: What qualifies an authenticator as "available" is intentionally unspecified; this is meant to represent how
authenticators can be hot-plugged into (e.g., via USB)
or discovered (e.g., via NFC or Bluetooth) by the client by various mechanisms, or permanently built into the client.
If the user agent has not recently mediated an authentication, the origin of said authentication is not callerOrigin, or the user
does not consent to this type of credential creation, throw a "NotAllowedError" DOMException.
It is up to the user agent to decide when it believes an authentication ceremony has
been completed. That authentication ceremony MAY be performed via other means than the
Web Authentication API.
Consider the value of hints and craft the user interface accordingly, as the user-agent sees fit.
Start lifetimeTimer.
WhilelifetimeTimer has not expired, perform the following actions depending upon lifetimeTimer,
and the state and response for eachauthenticator in authenticators:
If lifetimeTimer expires,
For eachauthenticator in issuedRequests invoke the authenticatorCancel operation on authenticator
and removeauthenticator from issuedRequests.
If the user exercises a user agent user-interface option to cancel the process,
Let userVerification be the effective user verification requirement for credential creation, a Boolean value,
as follows. If
pkOptions.authenticatorSelection.userVerification
Let enterpriseAttestationPossible be true if the user agent wishes to support enterprise attestation for pkOptions.rp.id (see step 8, above). Otherwise false.
otherwise
Let enterpriseAttestationPossible be false.
Let attestationFormats be a list of strings, initialized to the value of pkOptions.attestationFormats.
Note: If the client chooses to continue, this could result in
inadvertently registering multiple credentials bound to the same authenticator
if the transport hints in C.transports are not accurate.
For example, stored transport hints could become inaccurate
as a result of software upgrades adding new connectivity options.
Otherwise, AppendC to excludeCredentialDescriptorList.
Invoke the authenticatorMakeCredential operation on authenticator with
clientDataHash,
pkOptions.rp,
pkOptions.user,
requireResidentKey,
userVerification,
credTypesAndPubKeyAlgs,
excludeCredentialDescriptorList,
enterpriseAttestationPossible,
attestationFormats,
and authenticatorExtensions as parameters.
For each remaining authenticator in issuedRequests invoke the authenticatorCancel operation on
authenticator and remove it from issuedRequests.
Note:Authenticators may return an indication of "the user cancelled the entire operation".
How a user agent manifests this state to users is unspecified.
If any authenticator returns an error status equivalent to "InvalidStateError",
Note: This error status is handled separately because the authenticator returns it only if
excludeCredentialDescriptorList identifies a credential bound to the authenticator and the user has consented to the operation. Given this explicit consent, it is acceptable for this case to be
distinguishable to the Relying Party.
If any authenticator returns an error status not equivalent to "InvalidStateError",
The client MAY replace the aaguid and attestation statement with a more privacy-friendly
and/or more easily verifiable version of the same data (for example, by employing an Anonymization CA).
A sequence of zero or more unique DOMStrings, in lexicographical order, that the authenticator is believed to support. The values SHOULD be members of AuthenticatorTransport, but client platforms MUST ignore unknown values.
If a user agent does not wish to divulge this information it MAY substitute an arbitrary sequence designed to preserve privacy. This sequence MUST still be valid, i.e. lexicographically sorted and free of duplicates. For example, it may use the empty sequence. Either way, in this case the user agent takes the risk that Relying Party behavior may be suboptimal.
If the user agent does not have any transport information, it SHOULD set this field to the empty sequence.
During the above process, the user agent SHOULD show some UI to the user to guide them in the process of selecting and
authorizing an authenticator. When options.mediation is set to conditional, prominent modal UI should not be shown unless credential creation was previously consented to via means determined by the user agent.
Note: Exceptions that can be raised during processing of any WebAuthn Extensions,
including ones defined outside of this specification,
are not listed here.
The following DOMException exceptions can be raised:
A catch-all error covering a wide range of possible reasons,
including common ones like the user canceling out of the ceremony.
Some of these causes are documented throughout this spec,
while others are client-specific.
In general, the user agent SHOULD show some UI to the user to guide them in selecting and authorizing an authenticator with which
to complete the operation. By setting options.mediation to conditional, Relying Parties can indicate that a prominent modal UI should not be shown unless credentials are discovered.
The Relying Party SHOULD first use isConditionalMediationAvailable()
or getClientCapabilities()
to check that the client supports the conditionalGet capability
in order to prevent a user-visible error in case this feature is not available.
All BufferSource objects used in this algorithm MUST be snapshotted when the algorithm begins, to
avoid potential synchronization issues. Implementations SHOULD get a copy of the bytes held by the buffer source and use that copy for relevant portions of the algorithm.
When this method is invoked, the user agent MUST execute the following algorithm:
Note:lifetimeTimer is set to a value of infinity so that the user has the entire lifetime of
the Document to interact with any input form control tagged with a "webauthn"autofill detail token. For example, upon the user clicking in such an input field, the user agent can render a list of discovered credentials for the user to select from, and perhaps also give the user the option to "try another way".
If pkOptions.timeout is present, check if its value lies
within a reasonable range as defined by the client and if not, correct it to the closest value lying within that range.
Set a timer lifetimeTimer to this adjusted value. If pkOptions.timeout
is not present, then set lifetimeTimer to a client-specific default.
Note: An effective domain may resolve to a host, which can be represented in various manners,
such as domain, ipv4 address, ipv6 address, opaque host, or empty host.
Only the domain format of host is allowed here. This is for simplification and also is
in recognition of various issues with using direct IP address identification in concert with
PKI-based security.
Note:rpId represents the caller’s RP ID. The RP ID defaults to being the caller’s origin’s effective domain unless the caller has explicitly set
pkOptions.rpId when calling get().
Let clientExtensions be a new map and let authenticatorExtensions be a new map.
Let authenticatorExtensionInput be the (CBOR) result of running extensionId’s client extension processing
algorithm on clientExtensionInput. If the algorithm returned an error, continue.
SetauthenticatorExtensions[extensionId] to the base64url encoding of authenticatorExtensionInput.
Let collectedClientData be a new CollectedClientData instance whose fields are:
Let authenticators represent a value which at any given instant is a set of client platform-specific handles, where each
item identifies an authenticator presently available on this client platform at that instant.
Note: What qualifies an authenticator as "available" is intentionally unspecified; this is meant to represent how
authenticators can be hot-plugged into (e.g., via USB)
or discovered (e.g., via NFC or Bluetooth) by the client by various mechanisms, or permanently built into the client.
Consider the value of hints and craft the user interface accordingly, as the user-agent sees fit.
Start lifetimeTimer.
WhilelifetimeTimer has not expired, perform the following actions depending upon lifetimeTimer,
and the state and response for eachauthenticator in authenticators:
If lifetimeTimer expires,
For eachauthenticator in issuedRequests invoke the authenticatorCancel operation on
authenticator and removeauthenticator from issuedRequests.
If the user exercises a user agent user-interface option to cancel the process,
Let collectedDiscoveredCredentialMetadata be the result of invoking the silentCredentialDiscovery operation on authenticator with rpId as parameter.
For eachcredentialMetadata of collectedDiscoveredCredentialMetadata:
If credentialIdFilteris empty or credentialIdFilter contains an item whose
id’s value is set to credentialMetadata’s id,
setsilentlyDiscoveredCredentials[credentialMetadata] to authenticator.
Note: A request will be issued to this authenticator upon user selection of a credential via
interaction with a particular UI context
(see here for details).
For each remaining authenticator in issuedRequests invoke the authenticatorCancel operation
on authenticator and remove it from issuedRequests.
Note:Authenticators may return an indication of "the user cancelled the entire operation".
How a user agent manifests this state to users is unspecified.
If assertionCreationData.userHandleResult is null, set this
field to null. Otherwise, set this field to a new ArrayBuffer, created using global’s
%ArrayBuffer%, containing the bytes of
assertionCreationData.userHandleResult.
This algorithm returns false if the client determines that the authenticator is not capable of handling the request, or true if
the request was issued successfully.
If allowCredentialDescriptorList has exactly one value, set
savedCredentialIds[authenticator] to allowCredentialDescriptorList[0].id’s
value (see here in § 6.3.3 The authenticatorGetAssertion Operation for more information).
For each credential descriptor C in allowCredentialDescriptorList,
append each value, if any, of C.transports to distinctTransports.
Note: This will aggregate only distinct values of transports (for this authenticator) in
distinctTransports due to the properties of ordered sets.
The client selects one transport value from distinctTransports, possibly incorporating local
configuration knowledge of the appropriate transport to use with authenticator in making its
selection.
Then, using transport, invoke the authenticatorGetAssertion operation on
authenticator, with rpId, clientDataHash, allowCredentialDescriptorList,
userVerification,
and authenticatorExtensions as parameters.
Using local configuration knowledge of the appropriate transport to use with authenticator,
invoke the authenticatorGetAssertion operation on authenticator with rpId,
clientDataHash, allowCredentialDescriptorList, userVerification,
and authenticatorExtensions as parameters.
Using local configuration knowledge of the appropriate transport to use with authenticator, invoke the
authenticatorGetAssertion operation on authenticator with rpId, clientDataHash,
userVerification,
and authenticatorExtensions as parameters.
Note: In this case, the Relying Party did not supply a list of acceptable credential descriptors. Thus, the
authenticator is being asked to exercise any credential it may possess that is scoped to
the Relying Party, as identified by rpId.
Note: Exceptions that can be raised during processing of any WebAuthn Extensions,
including ones defined outside of this specification,
are not listed here.
The following DOMException exceptions can be raised:
A catch-all error covering a wide range of possible reasons,
including common ones like the user canceling out of the ceremony.
Some of these causes are documented throughout this spec,
while others are client-specific.
This method has no arguments and returns a Boolean value.
{
<> ();
};
5.1.7. Availability of client capabilities - PublicKeyCredential’s getClientCapabilities() Method
WebAuthn Relying Parties use this method to determine the availability of a limited set of client capabilities to offer certain workflows and experiences to users. For example, an RP may offer a sign in button on clients where only hybrid transport is available or where conditional mediation is unavailable (instead of showing a username field).
Upon invocation, the client employs a client platform-specific procedure to discover availability of these capabilities.
This method has no arguments and returns a record of capability keys to Boolean values.
When the value for a given capability is true, the feature is known to be currently supported by the client.
When the value for a given capability is false, the feature is known to be not currently supported by the client.
When a capability does not exist as a key, the availability of the client feature is not known.
The set of keys SHOULD also contain a key for each extension implemented by the client, where the key is formed by prefixing the string extension: to the extension identifier. The associated value for each implemented extension SHOULD be true. If getClientCapabilities() is supported by a client, but an extension is not mapped to the value true, then a Relying Party MAY assume that client processing steps for that extension will not be carried out by this client and that the extension MAY not be forwarded to the authenticator.
Note that even if an extension is mapped to true, the authenticator used for any given operation may not support that extension,
so Relying Parties MUST NOT assume that the authenticator processing steps for that extension will be performed on that basis.
If the client encounters any issues parsing any of the JSON type representations then it
MUST throw an "EncodingError" DOMException with a description of the incompatible
value and terminate the operation.
If the client encounters any issues parsing any of the JSON type representations then it
MUST throw an "EncodingError" DOMException with a description of the incompatible
value and terminate the operation.
WebAuthn Relying Parties may use these signal methods to inform authenticators
of the state of public key credentials, so that incorrect or revoked
credentials may be updated, removed, or hidden. Clients provide this
functionality opportunistically, since an authenticator may not support updating
its credentials map or may not be attached at the time the request is
made. Furthermore, in order to avoid revealing information about a user’s
credentials without user consent, signal methods do not indicate whether
the operation succeeded. A successfully resolved promise only means that the
options object was well formed.
Each signal method includes authenticator
actions. Authenticators MAY choose to deviate in their authenticator actions from the present specification, e.g. to ignore a
change they have a reasonable belief would be contrary to the user’s wish, or to
ask the user before making some change. Authenticator actions
are thus provided as the recommended way to handle signal methods.
In cases where an authenticator does not have the capability to process an
authenticator action, clients MAY choose to use existing
infrastructure such as [FIDO-CTAP]’s authenticatorCredentialManagement
command to achieve an equivalent effect.
Else, if credential has been hidden by an authenticator-specific
procedure, reverse the action so that credential is present in future
authentication ceremonies.
5.2.1. Information About Public Key Credential (interface AuthenticatorAttestationResponse)
The AuthenticatorAttestationResponse interface represents the authenticator’s response to a client’s request
for the creation of a new public key credential. It contains information about the new credential that can be used to
identify it for later use, and metadata that can be used by the WebAuthn Relying Party to assess the characteristics of the credential
during registration.
This internal slot contains a sequence of zero or more unique DOMStrings in lexicographical order. These values are the transports that the authenticator is believed to support, or an empty sequence if the information is unavailable. The values SHOULD be members of AuthenticatorTransport but Relying Parties SHOULD accept and store unknown values.
The getPublicKey() operation thus returns the credential public key as a SubjectPublicKeyInfo. This ArrayBuffer can, for example, be passed to Java’s java.security.spec.X509EncodedKeySpec, .NET’s System.Security.Cryptography.ECDsa.ImportSubjectPublicKeyInfo, or Go’s crypto/x509.ParsePKIXPublicKey.
Relying Parties SHOULD use feature detection before using these functions by testing the value of
'getPublicKey' in AuthenticatorAttestationResponse.prototype.
This member specifies the cryptographic signature algorithm with which the newly generated credential will be used, and
thus also the type of asymmetric key pair to be generated, e.g., RSA or Elliptic Curve.
Note: we use "alg" as the latter member name, rather than spelling-out "algorithm", because it will be serialized into
a message to the authenticator, which may be sent over a low-bandwidth link.
5.4. Options for Credential Creation (dictionary PublicKeyCredentialCreationOptions)
This member lists the key types and signature algorithms the Relying Party supports,
ordered from most preferred to least preferred.
Duplicates are allowed but effectively ignored.
The client and authenticator make a best-effort to create a credential of the most preferred type possible.
If none of the listed types can be created, the create() operation fails.
-9 (ESP256); use -7 (ES256) instead or in addition.
-51 (ESP384); use -35 (ES384) instead or in addition.
-52 (ESP512); use -36 (ES512) instead or in addition.
-19 (Ed25519); use -8 (EdDSA) instead or in addition.
Note: Within WebAuthn, the values -9 (ESP256), -51 (ESP384), -52 (ESP512) and -19 (Ed25519)
represent the same thing respectively as -7 (ES256), -35 (ES384), -36 (ES512) and -8 (EdDSA)
because of the additional restrictions stated in § 5.8.5 Cryptographic Algorithm Identifier (typedef COSEAlgorithmIdentifier).
However, they are not interchangeable in practice
since many implementations support the latter identifiers but not the former ones.
Therefore the latter identifiers are preferred in pubKeyCredParams
for backwards compatibility.
This OPTIONAL member specifies a time, in milliseconds, that the Relying Party is willing to wait for the call to complete. This is
treated as a hint, and MAY be overridden by the client.
hints, of type sequence<DOMString>, defaulting to []
This OPTIONAL member contains zero or more elements from PublicKeyCredentialHint to guide the user agent in interacting with the user. Note that the elements have type DOMString despite being taken from that enumeration. See § 2.1.1 Enumerations as DOMString types.
attestation, of type DOMString, defaulting to "none"
attestationFormats, of type sequence<DOMString>, defaulting to []
The Relying Party MAY use this OPTIONAL member to specify a preference regarding the attestation statement format used by the authenticator.
Values SHOULD be taken from the IANA "WebAuthn Attestation Statement Format Identifiers" registry [IANA-WebAuthn-Registries] established by [RFC8809].
Values are ordered from most preferred to least preferred.
Duplicates are allowed but effectively ignored.
This parameter is advisory and the authenticator MAY use an attestation statement not enumerated in this parameter.
The default value is the empty list, which indicates no preference.
[DEPRECATED] When inherited by PublicKeyCredentialRpEntity it is a human-palatable identifier for the Relying Party, intended only
for display. For example, "ACME Corporation", "Wonderful Widgets, Inc." or "ОАО Примертех".
This member is deprecated because many clients do not display it,
but it remains a required dictionary member for backwards compatibility.
Relying Parties MAY, as a safe default, set this equal to the RP ID.
Relying Parties SHOULD perform enforcement, as prescribed in Section 2.3 of
[RFC8266] for the Nickname Profile of the PRECIS FreeformClass [RFC8264],
when setting name’s value, or displaying the value to the user.
Clients SHOULD perform enforcement, as prescribed in Section 2.3 of
[RFC8266] for the Nickname Profile of the PRECIS FreeformClass [RFC8264],
on name’s value prior to displaying the value to the user or
including the value as a parameter of the authenticatorMakeCredential operation.
Examples of suitable values for this identifier include, "alexm", "+14255551234",
"alex.mueller@example.com", "alex.mueller@example.com (prod-env)",
or "alex.mueller@example.com (ОАО Примертех)".
The Relying Party MAY let the user choose this value. The Relying Party SHOULD perform enforcement,
as prescribed in Section 3.4.3 of [RFC8265] for the UsernameCasePreserved Profile of the PRECIS
IdentifierClass [RFC8264], when setting name’s value, or displaying the value
to the user.
Clients SHOULD perform enforcement, as prescribed in Section 3.4.3 of [RFC8265]
for the UsernameCasePreserved Profile of the PRECIS IdentifierClass [RFC8264],
on name’s value prior to displaying the value to the user or
including the value as a parameter of the authenticatorMakeCredential operation.
When storing a name member’s value,
the value MAY be truncated as described in § 6.4.1 String Truncation
using a size limit greater than or equal to 64 bytes.
5.4.2. Relying Party Parameters for Credential Generation (dictionary PublicKeyCredentialRpEntity)
To ensure secure operation, authentication and authorization
decisions MUST be made on the basis of this id member, not the
displayName nor name members. See Section 6.1 of [RFC8266].
A human-palatable name for the user account, intended only for
display. The Relying Party SHOULD let the user choose this, and SHOULD NOT restrict the choice
more than necessary. If no suitable or human-palatable name is
available, the Relying Party SHOULD set this value to an empty string.
Examples of suitable values for this identifier include, "Alex Müller", "Alex Müller (ACME Co.)" or "田中倫".
Relying Parties SHOULD perform enforcement, as prescribed in Section 2.3 of
[RFC8266] for the Nickname Profile of the PRECIS FreeformClass [RFC8264],
when setting displayName’s value to a non-empty string,
or displaying a non-empty value to the user.
Clients SHOULD perform enforcement, as prescribed in Section 2.3 of
[RFC8266] for the Nickname Profile of the PRECIS FreeformClass [RFC8264],
on displayName’s value prior to displaying a non-empty value to the user or
including a non-empty value as a parameter of the authenticatorMakeCredential operation.
When storing a displayName member’s value,
the value MAY be truncated as described in § 6.4.1 String Truncation
using a size limit greater than or equal to 64 bytes.
requireResidentKey, of type boolean, defaulting to false
This member is retained for backwards compatibility with WebAuthn Level 1 and, for historical reasons, its naming retains the deprecated “resident” terminology for discoverable credentials. Relying Parties SHOULD set it to true if, and only if, residentKey is set to required.
userVerification, of type DOMString, defaulting to "preferred"
The Relying Party wants to receive an enterprise attestation, which is an attestation statement that may include information which uniquely identifies the authenticator. This is intended for controlled deployments within an enterprise where the organization wishes to tie registrations to specific authenticators. User agents MUST NOT provide such an attestation unless the user agent or authenticator configuration permits it for the requested RP ID.
5.5. Options for Assertion Generation (dictionary PublicKeyCredentialRequestOptions)
The PublicKeyCredentialRequestOptions dictionary supplies get() with the data it needs to generate
an assertion. Its challenge member MUST be present, while its other members are OPTIONAL.
This OPTIONAL member specifies a time, in milliseconds, that the Relying Party is willing to wait for the call to complete.
The value is treated as a hint, and MAY be overridden by the client.
The items SHOULD specify transports whenever possible.
This helps the client optimize the user experience for any given situation.
Also note that the Relying Party does not need to filter the list when requesting user verification —
the client will automatically ignore non-eligible credentials
if userVerification is set to required.
If not empty, the client MUST return an error if none of the listed credentials can be used.
The list is ordered in descending order of preference: the first item in the list is the most
preferred credential, and the last is the least preferred.
userVerification, of type DOMString, defaulting to "preferred"
hints, of type sequence<DOMString>, defaulting to []
This OPTIONAL member contains zero or more elements from PublicKeyCredentialHint to guide the user agent in interacting with the user. Note that the elements have type DOMString despite being taken from that enumeration. See § 2.1.1 Enumerations as DOMString types.
The public key credential type uses certain data structures that are specified in supporting specifications. These are as
follows.
5.8.1. Client Data Used in WebAuthn Signatures (dictionary CollectedClientData)
The client data represents the contextual bindings of both the WebAuthn Relying Party and the client. It is a key-value
mapping whose keys are strings. Values can be any type that has a valid encoding in JSON. Its structure is defined by the
following Web IDL.
This member contains the string "webauthn.create" when creating new credentials, and "webauthn.get" when getting an
assertion from an existing credential. The purpose of this member is to prevent certain types of signature confusion
attacks (where an attacker substitutes one legitimate signature for another).
This OPTIONAL member contains information about the state of the Token Binding protocol [TokenBinding] used when communicating
with the Relying Party. Its absence indicates that the client doesn’t support token binding
Note: While Token Binding was present in Level 1 and Level 2 of WebAuthn, its use is not expected in Level 3. The tokenBinding field is reserved so that it will not be reused for a different purpose.
The serialization of the CollectedClientData is a subset of the algorithm for JSON-serializing to bytes. I.e. it produces a valid JSON encoding of the CollectedClientData but also provides additional structure that may be exploited by verifiers to avoid integrating a full JSON parser. While verifiers are recommended to perform standard JSON parsing, they may use the more limited algorithm below in contexts where a full JSON parser is too large. This verification algorithm requires only base64url encoding, appending of bytestrings (which could be implemented by writing into a fixed template), and simple conditional checks (assuming that inputs are known not to need escaping).
The serialization algorithm works by appending successive byte strings to an, initially empty, partial result until the complete result is obtained.
A string, origin, that contains the expected origin that issued the request to the user agent.
An optional string, topOrigin, that contains the expected topOrigin that issued the request to the user agent, if available.
A boolean, requireTopOrigin, that is true if, and only if, the verification should fail
if topOrigin is defined and the topOrigin attribute is not present in clientDataJSON.
Append 0x2c2263726f73734f726967696e223a (,"crossOrigin":) to expected.
If topOrigin is defined:
Append 0x74727565 (true) to expected.
If requireTopOrigin is true
or if 0x2c22746f704f726967696e223a (,"topOrigin":) is a prefix
of the substring of clientDataJSON beginning at the offset equal to the length of expected:
Append 0x2c22746f704f726967696e223a (,"topOrigin":) to expected.
If additional fields are added to CollectedClientData then verifiers that employ the limited verification algorithm will not be able to consider them until the two algorithms above are updated to include them. Once such an update occurs then the added fields inherit the same limitations as described in the previous paragraph. Such an algorithm update would have to accomodate serializations produced by previous versions. I.e. the verification algorithm would have to handle the fact that a sixth key–value pair may not appear sixth (or at all) if generated by a user agent working from a previous version.
5.8.2. Credential Type Enumeration (enum PublicKeyCredentialType)
This enumeration defines the valid credential types. It is an extension point; values can be added to it in the future, as
more credential types are defined. The values of this enumeration are used for versioning the Authentication Assertion and
attestation structures according to the type of the authenticator.
Currently one credential type is defined, namely "public-key".
This dictionary identifies a specific public key credential.
It is used in create() to prevent creating duplicate credentials on the same authenticator,
and in get() to determine if and how the credential can currently be reached by the client.
Authenticators may implement various transports for communicating with clients. This enumeration
defines hints as to how clients might communicate with a particular authenticator in order to obtain an assertion for a
specific credential. Note that these hints represent the WebAuthn Relying Party’s best belief as to how an authenticator may be reached. A
Relying Party will typically learn of the supported transports for a public key credential via
getTransports().
usb
Indicates the respective authenticator can be contacted over removable USB.
nfc
Indicates the respective authenticator can be contacted over Near Field Communication (NFC).
ble
Indicates the respective authenticator can be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE).
smart-card
Indicates the respective authenticator can be contacted over ISO/IEC 7816 smart card with contacts.
hybrid
Indicates the respective authenticator can be contacted using a combination of (often separate) data-transport and proximity mechanisms. This supports, for example, authentication on a desktop computer using a smartphone.
A COSEAlgorithmIdentifier’s value is a number identifying a cryptographic algorithm.
The algorithm identifiers SHOULD be values registered in the IANA COSE Algorithms registry [IANA-COSE-ALGS-REG],
for instance, -7 for "ES256" and -257 for "RS256".
The COSE algorithms registry leaves degrees of freedom to be specified by other parameters in a COSE key. In order to promote interoperability, this specification makes the following additional guarantees of credential public keys:
Keys with algorithm -7 (ES256) MUST specify 1 (P-256) as the crv parameter and MUST NOT use the compressed point form.
Keys with algorithm -9 (ESP256) MUST NOT use the compressed point form.
Keys with algorithm -35 (ES384) MUST specify 2 (P-384) as the crv parameter and MUST NOT use the compressed point form.
Keys with algorithm -51 (ESP384) MUST NOT use the compressed point form.
Keys with algorithm -36 (ES512) MUST specify 3 (P-521) as the crv parameter and MUST NOT use the compressed point form.
Keys with algorithm -52 (ESP512) MUST NOT use the compressed point form.
Keys with algorithm -8 (EdDSA) MUST specify 6 (Ed25519) as the crv parameter. (These always use a compressed form in COSE.)
Note: There are many checks neccessary to correctly implement signature verification using these algorithms. One of these is that, when processing uncompressed elliptic-curve points, implementations should check that the point is actually on the curve. This check is highlighted because it’s judged to be at particular risk of falling through the gap between a cryptographic library and other code.
5.8.6. User Verification Requirement Enumeration (enum UserVerificationRequirement)
The Relying Party prefers user verification for the operation if possible, but will not fail the
operation if the response does not have the UVflag set.
discouraged
The Relying Party does not want user verification employed during the operation (e.g., in the
interest of minimizing disruption to the user interaction flow).
This enumeration defines a limited set of client capabilities which a WebAuthn Relying Party may evaluate to offer certain workflows and experiences to users.
WebAuthn Relying Parties may use this enumeration to communicate hints to the user-agent about how a request may be best completed. These hints are not requirements, and do not bind the user-agent, but may guide it in providing the best experience by using contextual information that the Relying Party has about the request. Hints are provided in order of decreasing preference so, if two hints are contradictory, the first one controls. Hints may also overlap: if a more-specific hint is defined a Relying Party may still wish to send less specific ones for user-agents that may not recognise the more specific one. In this case the most specific hint should be sent before the less-specific ones.
If the same hint appears more than once, its second and later appearances are ignored.
Hints MAY contradict information contained in credential transports and authenticatorAttachment. When this occurs, the hints take precedence. (Note that transports values are not provided when using discoverable credentials, leaving hints as the only avenue for expressing some aspects of such a request.)
security-key
Indicates that the Relying Party believes that users will satisfy this request with a physical security key. For example, an enterprise Relying Party may set this hint if they have issued security keys to their employees and will only accept those authenticators for registration and authentication.
Indicates that the Relying Party believes that users will satisfy this request with general-purpose authenticators such as smartphones. For example, a consumer Relying Party may believe that only a small fraction of their customers possesses dedicated security keys. This option also implies that the local platform authenticator should not be promoted in the UI.
Two features are identified by the feature-identifier tokens "publickey-credentials-create"
and "publickey-credentials-get".
Their default allowlists are both 'self'.
A third feature is identified by the feature-identifier token "publickey-credentials-remote-client-data-json".
Its default allowlist is 'none', meaning it is disabled for all origins by default. This feature is also a powerful feature ([Permissions]) identified by the name "publickey-credentials-remote-client-data-json", with default permission state"denied".
This can make deployment challenging for large environments where multiple country-specific domains are in use (e.g. example.com vs example.co.uk vs example.sg), where alternative or brand domains are required (e.g. myexampletravel.com vs examplecruises.com), and/or where platform as a service providers are used to support mobile apps.
A JSON document MUST be hosted at the webauthn well-known URL [RFC8615] for the RP ID, and MUST be served using HTTPS. The JSON document MUST be returned as follows:
The content type MUST be application/json.
The top-level JSON object MUST contain a key named origins whose value MUST be an array of one or more strings containing web origins.
Fetch the webauthn well-known URL [RFC8615] for the RP ID rpIdRequested (i.e., https://rpIdRequested/.well-known/webauthn) without credentials, without a referrer and using the https:scheme.
If the fetch fails, the response does not have a content type of application/json, or does not have a status code (after following redirects) of 200, then throw a "SecurityError" DOMException.
Client platforms MAY implement and expose this abstract model in any way desired. However, the behavior of the client’s Web
Authentication API implementation, when operating on the authenticators supported by that client platform, MUST be indistinguishable
from the behavior specified in § 5 Web Authentication API.
Note:[FIDO-CTAP] is an example of a concrete instantiation of this model, but it is one in which there are differences in the data it returns and those expected by the WebAuthn API’s algorithms. The CTAP2 response messages are CBOR maps constructed using integer keys rather than the string keys defined in this specification for the same objects. The client is expected to perform any needed transformations on such data. The [FIDO-CTAP] specification details the mapping between CTAP2 integer keys and WebAuthn string keys in Section §6. Authenticator API.
For authenticators, this model defines the logical operations that they MUST support, and the data formats that they expose to
the client and the WebAuthn Relying Party. However, it does not define the details of how authenticators communicate with the client device,
unless they are necessary for interoperability with Relying Parties. For instance, this abstract model does not define protocols for
connecting authenticators to clients over transports such as USB or NFC. Similarly, this abstract model does not define specific
error codes or methods of returning them; however, it does define error behavior in terms of the needs of the client. Therefore,
specific error codes are mentioned as a means of showing which error conditions MUST be distinguishable (or not) from each other
in order to enable a compliant and secure client implementation.
In this abstract model, the authenticator provides key management and cryptographic signatures. It can be embedded in the
WebAuthn client or housed in a separate device entirely. The authenticator itself can contain a cryptographic module which
operates at a higher security level than the rest of the authenticator. This is particularly important for authenticators that
are embedded in the WebAuthn client, as in those cases this cryptographic module (which may, for example, be a TPM) could be
considered more trustworthy than the rest of the authenticator.
Additionally, each authenticator has an Authenticator Attestation Globally Unique Identifier or AAGUID, which is a 128-bit identifier
indicating the type (e.g. make and model) of the authenticator. The AAGUID MUST be chosen by its maker to be identical across all substantially identical
authenticators made by that maker, and different (with high probability) from the AAGUIDs of all other types of authenticators. The AAGUID for a given type
of authenticator SHOULD be randomly generated to ensure this. The Relying Party MAY use the AAGUID to infer certain properties of the authenticator, such as
certification level and strength of key protection, using information from other sources. The Relying Party MAY use the AAGUID to attempt to identify the maker of
the authenticator without requesting and verifying attestation, but the AAGUID is not provably authentic without attestation.
The primary function of the authenticator is to provide WebAuthn signatures, which are bound to various contextual data. These
data are observed and added at different levels of the stack as a signature request passes from the server to the
authenticator. In verifying a signature, the server checks these bindings against expected values. These contextual bindings
are divided in two: Those added by the Relying Party or the client, referred to as client data; and those added by the authenticator,
referred to as the authenticator data. The authenticator signs over the client data, but is otherwise not interested in
its contents. To save bandwidth and processing requirements on the authenticator, the client hashes the client data and
sends only the result to the authenticator. The authenticator signs over the combination of the
hash of the serialized client data, and its own authenticator data.
The goals of this design can be summarized as follows.
The scheme for generating signatures should accommodate cases where the link between the client device and authenticator
is very limited, in bandwidth and/or latency. Examples include Bluetooth Low Energy and Near-Field Communication.
The data processed by the authenticator should be small and easy to interpret in low-level code. In particular, authenticators
should not have to parse high-level encodings such as JSON.
Both the client and the authenticator should have the flexibility to add contextual bindings as needed.
The design aims to reuse as much as possible of existing encoding formats in order to aid adoption and implementation.
Authenticators produce cryptographic signatures for two distinct purposes:
The term WebAuthn signature refers to both attestation signatures and assertion signatures.
The formats of these signatures, as well as the procedures for generating them, are specified below.
6.1. Authenticator Data
The authenticator data structure encodes contextual bindings made by the authenticator. These bindings are
controlled by the authenticator itself, and derive their trust from the WebAuthn Relying Party’s assessment of the security properties of the
authenticator. In one extreme case, the authenticator may be embedded in the client, and its bindings may be no more trustworthy
than the client data. At the other extreme, the authenticator may be a discrete entity with high-security hardware and
software, connected to the client over a secure channel. In both cases, the Relying Party receives the authenticator data in the same
format, and uses its knowledge of the authenticator to make trust decisions.
The authenticator data has a compact but extensible encoding. This is desired since authenticators can be devices with
limited capabilities and low power requirements, with much simpler software stacks than the client platform.
The authenticator data structure is a byte array of 37 bytes or more,
laid out as shown in Table .
Authenticator data layout. The names in the Name column are only for reference within this document, and are not
present in the actual representation of the authenticator data.
The RP ID is originally received from the client when the credential is created, and again when an assertion is generated.
However, it differs from other client data in some important ways. First, unlike the client data, the RP ID of a
credential does not change between operations but instead remains the same for the lifetime of that credential. Secondly, it is
validated by the authenticator during the authenticatorGetAssertion operation, by verifying that the RP ID that
the requested credential is scoped to exactly matches the RP ID supplied by the client.
The UPflag SHALL be set if and only if the authenticator performed a test of user presence.
The UVflag SHALL be set if and only if the authenticator performed user verification.
The RFU bits SHALL be set to zero.
Detecting a signature counter mismatch does not indicate whether the current operation was performed by a cloned authenticator or the original authenticator. Relying Parties should address this situation appropriately relative to their individual situations, i.e., their risk tolerance or operational factors that might result in an acceptable reason for non-increasing values.
Authenticators:
SHOULD implement per credential signature counters. This prevents the
signature counter value from being shared between Relying Parties and being possibly employed
as a correlation handle for the user. Authenticators MAY implement a global signature counter,
i.e., on a per-authenticator basis, but this is less privacy-friendly for users.
SHOULD ensure that the signature counter value does not
accidentally decrease (e.g., due to hardware failures).
The value of the BSflag may change over time based on the current state of the public key credential source. Table below defines
valid combinations and their meaning.
When the BSflag changes from 0 to 1, the authenticator is signaling that the credential is backed up and is protected from single device loss.
The Relying Party MAY choose to prompt the user to upgrade their account security and remove their password.
Adding an additional factor after a state change:
When the BSflag changes from 1 to 0, the authenticator is signaling that the credential is no longer backed up,
and no longer protected from single device loss. This could be the result of the user actions, such as disabling the backup service,
or errors, such as issues with the backup service.
When this transition occurs, the Relying Party SHOULD guide the user through a process to validate their other authentication factors.
If the user does not have another credential for their account, they SHOULD be guided through adding an additional credential
to ensure they do not lose access to their account. For example, the user could be prompted to set up an additional authenticator,
such as a roaming authenticator or an authenticator that is capable of multi-device credentials.
6.2. Authenticator Taxonomy
Many use cases are dependent on the capabilities of the authenticator used.
This section defines some terminology for those capabilities, their most important combinations,
and which use cases those combinations enable.
For subsequent re-authentication on the same client device, a platform authenticator is likely the most convenient
since it’s built directly into the client device rather than being a separate device that the user may have to locate.
For second-factor authentication in addition to a traditional username and password, any authenticator can be used.
These characteristics are independent and may in theory be combined in any way,
but Table
lists and names some authenticator types of particular interest.
A WebAuthn Client MUST connect to an authenticator in order to invoke any of the operations of that authenticator. This connection
defines an authenticator session. An authenticator must maintain isolation between sessions. It may do this by only allowing one
session to exist at any particular time, or by providing more complicated session management.
The following operations can be invoked by the client in an authenticator session.
6.3.1. Lookup Credential Source by Credential ID Algorithm
The result of looking up a credential idcredentialId in an authenticatorauthenticator is the result of the following algorithm:
If credSource.id is credentialId, return credSource.
Return null.
6.3.2. The authenticatorMakeCredential Operation
Before invoking this operation, the client MUST invoke the authenticatorCancel operation
in order to abort all other operations in progress in the authenticator session.
This operation takes the following input parameters:
An OPTIONAL list of PublicKeyCredentialDescriptor objects provided by the Relying Party with the intention that, if any of
these are known to the authenticator, it SHOULD NOT create a new credential. excludeCredentialDescriptorList contains a
list of known credentials.
enterpriseAttestationPossible
A Boolean value that indicates that individually-identifying attestation MAY be returned by the authenticator.
attestationFormats
A sequence of strings that expresses the Relying Party’s preference for attestation statement formats, from most to least preferable. If the authenticator returns attestation, then it makes a best-effort attempt to use the most preferable format that it supports.
When this operation is invoked, the authenticator MUST perform the following procedure:
Check if all the supplied parameters are syntactically well-formed and of the correct length. If not, return an error code
equivalent to "UnknownError" and terminate the operation.
Check if at least one of the specified combinations of PublicKeyCredentialType and cryptographic parameters in
credTypesAndPubKeyAlgs is supported.
If not, return an error code equivalent to "NotSupportedError" and terminate the operation.
For eachdescriptor of excludeCredentialDescriptorList:
return an error code equivalent to "InvalidStateError" and terminate the operation.
does not consent to create a new credential
return an error code equivalent to "NotAllowedError" and terminate the operation.
Note: The purpose of this authorization gesture is not to proceed with creating a credential,
but for privacy reasons to authorize disclosure of the fact that
descriptor.id is bound to this authenticator.
If the user consents, the client and Relying Party can detect this and guide the user to use a different authenticator.
If the user does not consent,
the authenticator does not reveal that descriptor.id
is bound to it,
and responds as if the user simply declined consent to create a credential.
If requireUserVerification is true and the authenticator cannot perform user verification, return an error code
equivalent to "ConstraintError" and terminate the operation.
Collect an authorization gesture confirming user consent for creating a new credential.
The prompt for the authorization gesture is shown by the
authenticator if it has its own output capability, or by the user agent otherwise. The prompt SHOULD display
rpEntity.id, rpEntity.name,
userEntity.name and
userEntity.displayName, if possible.
Let (publicKey, privateKey) be a new pair of cryptographic keys using the combination of PublicKeyCredentialType
and cryptographic parameters represented by the first item in credTypesAndPubKeyAlgs that is supported by
this authenticator.
let the signature counter value for the new credential be zero. (U2F devices may support signature counters but do not return a counter when making a credential. See [FIDO-U2F-Message-Formats].)
let the signature counter value for the new credential be constant at zero.
Let attestedCredentialData be the attested credential data byte array including the credentialId and publicKey.
Let attestationFormat be the first supported attestation statement format identifier from attestationFormats, taking into account enterpriseAttestationPossible.
If attestationFormats contains no supported value, then let attestationFormat be the attestation statement format identifier most preferred by this authenticator.
On successful completion of this operation, the authenticator returns the attestation object to the client.
6.3.3. The authenticatorGetAssertion Operation
Before invoking this operation, the client MUST invoke the authenticatorCancel operation
in order to abort all other operations in progress in the authenticator session.
This operation takes the following input parameters:
rpId
The caller’s RP ID, as determined by the user agent and the client.
The constant Boolean value true.
It is included here as a pseudo-parameter to simplify applying this abstract authenticator model to implementations that may
wish to make a test of user presence optional although WebAuthn does not.
When this method is invoked, the authenticator MUST perform the following procedure:
Check if all the supplied parameters are syntactically well-formed and of the correct length. If not, return an error code
equivalent to "UnknownError" and terminate the operation.
If allowCredentialDescriptorList was supplied, then for eachdescriptor of allowCredentialDescriptorList:
Let credSource be the result of looking updescriptor.id in this
authenticator.
If credSource is not null, append it to credentialOptions.
Otherwise (allowCredentialDescriptorList was not supplied), for eachkey → credSource of this
authenticator’s credentials map, appendcredSource to credentialOptions.
Remove any items from credentialOptions whose rpId is not equal to
rpId.
If credentialOptions is now empty, return an error code equivalent to "NotAllowedError" and terminate the operation.
Let signature be the assertion signature of the concatenation authenticatorData || hash using the
privateKey of selectedCredential as shown in Figure , below. A simple,
undelimited
concatenation is safe to use here because the authenticator data describes its own length. The hash of the serialized client data (which potentially has a variable length) is always the last element.
If any error occurred while generating the assertion signature, return an error code equivalent to "UnknownError" and
terminate the operation.
Return to the user agent:
selectedCredential.id, if either a list of credentials
(i.e., allowCredentialDescriptorList) of length 2 or greater was
supplied by the client, or no such list was supplied.
Note: If, within allowCredentialDescriptorList, the client supplied exactly one credential and it was successfully employed, then its
credential ID is not returned since the client already knows it. This saves transmitting these bytes over
what may be a constrained connection in what is likely a common case.
Note: In cases where allowCredentialDescriptorList was supplied the returned
userHandle value may be null, see: userHandleResult.
If the authenticator cannot find any credential corresponding to the specified Relying Party that
matches the specified criteria, it terminates the operation and returns an error.
6.3.4. The authenticatorCancel Operation
This operation takes no input parameters and returns no result.
When this operation is invoked by the client in an authenticator session, it has the effect of terminating any
authenticatorMakeCredential or authenticatorGetAssertion operation currently in progress in that authenticator
session. The authenticator stops prompting for, or accepting, any user input related to authorizing the canceled operation. The
client ignores any further responses from the authenticator for the canceled operation.
AppenddiscoveredCredentialMetadata to collectedDiscoverableCredentialMetadata.
Return collectedDiscoverableCredentialMetadata.
6.4. String Handling
Authenticators may be required to store arbitrary strings chosen by a Relying Party, for example the name and displayName in a PublicKeyCredentialUserEntity. This section discusses some practical consequences of handling arbitrary strings that may be presented to humans.
6.4.1. String Truncation
Each arbitrary string in the API will have some accommodation for the potentially limited resources available to an authenticator.
When the chosen accommodation is string truncation, care needs to be taken to not corrupt the string value.
For example, truncation based on Unicode code points alone may cause a grapheme cluster to be truncated.
This could make the grapheme cluster render as a different glyph,
potentially changing the meaning of the string, instead of removing the glyph entirely.
For example, figure
shows the end of a UTF-8 encoded string whose encoding is 65 bytes long.
If truncating to 64 bytes then the final 0x88 byte is removed first to satisfy the size limit.
Since that leaves a partial UTF-8 code point, the remainder of that code point must also be removed.
Since that leaves a partial grapheme cluster, the remainder of that cluster should also be removed.
👁 Image The end of a UTF-8 encoded string showing the positions of different truncation boundaries.
The responsibility for handling these concerns falls primarily on the client,
to avoid burdening authenticators with understanding character encodings and Unicode character properties.
The following subsections define requirements for how clients and authenticators,
respectively, may perform string truncation.
6.4.1.1. String Truncation by Clients
When a WebAuthn Client truncates a string,
the truncation behaviour observable by the Relying Party MUST satisfy the following requirements:
Choose a size limit equal to or greater than the specified minimum supported length.
The string MAY be truncated so that its length in bytes in the UTF-8 character encoding satisfies that limit.
This truncation MUST respect UTF-8 code point boundaries, and SHOULD respect grapheme cluster boundaries [UAX29].
The resulting truncated value MAY be shorter than the chosen size limit
but MUST NOT be shorter than the longest prefix substring that satisfies the size limit and ends on a grapheme cluster boundary.
The client MAY let the authenticator perform the truncation if it satisfies these requirements;
otherwise the client MUST perform the truncation before relaying the string value to the authenticator.
In addition to the above, truncating on byte boundaries alone causes a known issue that user agents should be aware of: if the authenticator is using [FIDO-CTAP] then future messages from the authenticator may contain invalid CBOR since the value is typed as a CBOR string and thus is required to be valid UTF-8. Thus, when dealing with authenticators, user agents SHOULD:
Ensure that any strings sent to authenticators are validly encoded.
Handle the case where strings have been truncated resulting in an invalid encoding. For example, any partial code point at the end may be dropped or replaced with U+FFFD.
6.4.1.2. String Truncation by Authenticators
Because a WebAuthn Authenticator may be implemented in a constrained environment,
the requirements on authenticators are relaxed compared to those for clients.
When a WebAuthn Authenticator truncates a string,
the truncation behaviour MUST satisfy the following requirements:
Choose a size limit equal to or greater than the specified minimum supported length.
The string MAY be truncated so that its length in bytes in the UTF-8 character encoding satisfies that limit.
This truncation SHOULD respect UTF-8 code point boundaries, and MAY respect grapheme cluster boundaries [UAX29].
The resulting truncated value MAY be shorter than the chosen size limit
but MUST NOT be shorter than the longest prefix substring that satisfies the size limit and ends on a grapheme cluster boundary.
6.4.2. Language and Direction Encoding
In order to be correctly displayed in context, the language and base direction of a string may be required. Strings in this API may have to be written to fixed-function authenticators and then later read back and displayed on a different platform.
For compatibility with existing fixed-function authenticators without support for dedicated language and direction metadata fields,
Web Authentication Level 2 included provisions for embedding such metadata in the string itself to ensure that it is transported atomically.
This encoding is NOT RECOMMENDED; clients and authenticators MAY ignore such encoding in new values.
Clients and authenticators MAY detect and process language and direction metadata encoded in existing strings
as described in Web Authentication Level 2 §6.4.2. Language and Direction Encoding.
Instead, a future version of the Web Authentication API may provide dedicated language and direction metadata fields.
The attestation statement format is the manner in which the signature is represented and the various contextual
bindings are incorporated into the attestation statement by the authenticator. In other words, this defines the
syntax of the statement. Various existing components and OS platforms (such as TPMs and the Android OS) have previously defined
attestation statement formats. This specification supports a variety of such formats in an extensible way, as defined in
§ 6.5.2 Attestation Statement Formats. The formats themselves are identified by strings, as described in § 8.1 Attestation Statement Format Identifiers.
The characteristics of the individual authenticator, such as its construction, whether part or all of it runs in a secure
operating environment, and so on.
Attested credential data is a variable-length byte array added to the authenticator data when generating an attestation object for a credential. Its format is shown in Table .
6.5.1.1. Examples of credentialPublicKey Values Encoded in COSE_Key Format
This section provides examples of COSE_Key-encoded Elliptic Curve and RSA public keys for the ES256, PS256, and RS256
signature algorithms. These examples adhere to the rules defined above for the credentialPublicKey value, and are presented in CDDL [RFC8610] for clarity.
Section 7 of [RFC9052] defines the general framework for all COSE_Key-encoded keys.
Specific key types for specific algorithms are defined in [RFC9053] as well as in other specifications,
as noted below.
Below is an example of a COSE_Key-encoded Elliptic Curve public key in EC2 format (see Section 7.1 of [RFC9053]),
on the P-256 curve, to be used with the ES256 signature
algorithm (ECDSA w/ SHA-256, see Section 2.1 of [RFC9053]):
Below is the above Elliptic Curve public key encoded in the CTAP2 canonical CBOR encoding form, whitespace and line breaks
are included here for clarity and to match the CDDL [RFC8610] presentation above:
Below is an example of a COSE_Key-encoded 2048-bit RSA public key (see [RFC8230]Section 4,
to be used with the PS256 signature algorithm
(RSASSA-PSS with SHA-256, see Section 2 of [RFC8230]:
Below is an example of the same COSE_Key-encoded RSA public key as above,
to be used with the RS256 signature algorithm (RSASSA-PKCS1-v1_5 with SHA-256):
An error indicating that the attestation is invalid, or
An implementation-specific value representing the attestation type, and the trust path. This attestation trust path is either
empty (in case of self attestation), or a set of X.509 certificates.
In this case, an authenticator is based on a Trusted Platform Module (TPM) and holds an authenticator-specific
"endorsement key" (EK). This key is used to securely communicate with a trusted third party, the Attestation CA[TCG-CMCProfile-AIKCertEnroll] (formerly known as a "Privacy CA"). The authenticator can generate multiple
attestation identity key pairs (AIK) and requests an Attestation CA to issue an AIK certificate
for each. Using this approach, such an authenticator can limit the exposure of the EK (which is a global correlation
handle) to Attestation CA(s). AIKs can be requested for each authenticator-generated public key credential
individually, and conveyed to Relying Parties as attestation certificates.
Note: This concept typically leads to multiple attestation certificates. The attestation certificate requested most recently
is called "active".
Return the attestation object as a CBOR map with the following syntax, filled in with variables initialized by this
algorithm:
attObj = {
authData: bytes,
; Each choice in $$attStmtType defines the fmt value and attStmt structure
$$attStmtType
} .within attStmtTemplate
attStmtTemplate = {
authData: bytes,
fmt: text,
attStmt: (
{ * tstr => any } ; Map is filled in by each concrete attStmtType
//
[ * any ] ; attStmt may also be an array
)
}
6.5.5. Signature Formats for Packed Attestation, FIDO U2F Attestation, and Assertion Signatures
For COSEAlgorithmIdentifier -7 (ES256), and other ECDSA-based algorithms, the
sig value MUST be encoded as an ASN.1 DER Ecdsa-Sig-Value, as defined in [RFC3279] section 2.2.3.
Example:
Note: Encoding lengths vary with INTEGER magnitude and curve size.
30 43 ; SEQUENCE (67 Bytes)
02 21 ; INTEGER (33 Bytes)
| 00 89 90 95 04 e1 4f 1e 29 db a8 15 8f a7 c3 87
| e8 88 ff be 07 d8 24 bb 21 43 20 55 06 ab 15 9c
| 3e
02 1e ; INTEGER (30 Bytes)
| 56 55 4f b5 81 9b 12 84 5e 85 be 2f 78 37 1c f3
| cb 95 e3 87 f4 51 cb 36 2b 94 78 d1 83 d2
Note: As CTAP1/U2F authenticators are already producing signatures values in this format, CTAP2
authenticators will also produce signatures values in the same format, for consistency reasons.
It is RECOMMENDED that any new attestation formats defined not use ASN.1 encodings,
but instead represent signatures as equivalent fixed-length byte arrays without internal structure,
using the same representations as used by COSE signatures as defined in [RFC9053] and [RFC8230].
The below signature format definitions satisfy this requirement and serve as examples for deriving the same for other signature algorithms not explicitly mentioned here:
For COSEAlgorithmIdentifier -257 (RS256), sig MUST contain the signature generated using the
RSASSA-PKCS1-v1_5 signature scheme defined in Section 8.2.1 of [RFC8017] with SHA-256 as the hash function.
The signature is not ASN.1 wrapped.
For COSEAlgorithmIdentifier -37 (PS256), sig MUST contain the signature generated using the
RSASSA-PSS signature scheme defined in Section 8.1.1 of [RFC8017] with SHA-256 as the hash function.
The signature is not ASN.1 wrapped.
Call navigator.credentials.create() and pass options as the argument.
Let credential be the result of the successfully resolved promise.
If the promise is rejected, abort the ceremony with a user-visible error, or otherwise guide the user experience as
might be determinable from the context available in the rejected promise. For example if the promise is rejected with
an error code equivalent to "InvalidStateError", the user might be instructed to use a different authenticator.
For information on different error contexts and the circumstances leading to them, see § 6.3.2 The authenticatorMakeCredential Operation.
Note: Using any implementation of UTF-8 decode is acceptable as long as it yields the same result as that yielded by
the UTF-8 decode algorithm. In particular, any leading byte order mark (BOM) must be stripped.
Let C, the client data claimed as collected during the credential creation, be the result of running an
implementation-specific JSON parser on JSONtext.
Note:C may be any implementation-specific data structure representation, as long as C’s components are referenceable, as
required by this algorithm.
Verify that the value of C.type is webauthn.create.
Verify that the value of C.challenge equals
the base64url encoding of pkOptions.challenge.
If the BE bit of the flags in authData is not set, verify that the BS bit is not set.
If the Relying Party uses the credential’s backup eligibility to inform its user experience flows and/or policies, evaluate the
BE bit of the flags in authData.
If the Relying Party uses the credential’s backup state to inform its user experience flows and/or policies, evaluate the BS
bit of the flags in authData.
Determine the attestation statement format by performing a USASCII case-sensitive match on fmt against the set of
supported WebAuthn Attestation Statement Format Identifier values.
An up-to-date list of registered WebAuthn Attestation Statement Format Identifier values
is maintained in the
IANA "WebAuthn Attestation Statement Format Identifiers" registry [IANA-WebAuthn-Registries] established by [RFC8809].
If validation is successful, obtain a list of acceptable trust anchors (i.e. attestation root certificates)
for that attestation type and attestation statement format fmt, from a trusted source or from policy. For
example, the FIDO Metadata Service [FIDOMetadataService] provides one way to obtain such information, using the
aaguid in the attestedCredentialData in authData.
Otherwise, use the X.509 certificates returned as the attestation trust path from the verification procedure
to verify that the attestation public key either correctly chains up to an acceptable root certificate, or is itself an acceptable certificate
(i.e., it and the root certificate obtained in step 22 may be the same).
Note: The rationale for Relying Parties rejecting duplicate credential IDs is as follows:
credential IDs contain sufficient entropy that accidental duplication is very unlikely. However, attestation types other than self attestation do not include a self-signature to explicitly prove possession of the credential private key at registration time. Thus an attacker who has managed to obtain a user’s credential ID and credential public key for a site (this could be potentially accomplished in various ways), could attempt to register a victim’s credential as their own at that site. If the Relying Party accepts this new registration and replaces the victim’s existing credential registration, and the credentials are discoverable, then the victim could be forced to sign into the attacker’s account at their next attempt. Data saved to the site by the victim in that state would then be available to the attacker.
Let credentialRecord be a new credential record with the following contents:
The Relying Party MAY also include any additional items as necessary.
As a non-normative example, the Relying Party might allow the user to set a "nickname" for the credential
to help the user remember which credential is bound to which authenticator
when interacting with account settings.
Since all extensions are OPTIONAL for both the client and the authenticator, the Relying Party MUST also be
prepared to handle cases where none or not all of the requested extensions were acted upon.
Verification of attestation objects requires that the Relying Party has a trusted method of determining acceptable trust anchors
in step 22 above.
Also, if certificates are being used, the Relying Party MUST have access to certificate status information for the
intermediate CA certificates. The Relying Party MUST also be able to build the attestation certificate chain if the client did not
provide this chain in the attestation information.
Call navigator.credentials.get() and pass options as the argument.
Let credential be the result of the successfully resolved promise.
If the promise is rejected, abort the ceremony with a user-visible error, or otherwise guide the user experience as might
be determinable from the context available in the rejected promise. For information on different error contexts and the
circumstances leading to them, see § 6.3.3 The authenticatorGetAssertion Operation.
Let JSONtext be the result of running UTF-8 decode on the value of cData.
Note: Using any implementation of UTF-8 decode is acceptable as long as it yields the same result as that yielded by
the UTF-8 decode algorithm. In particular, any leading byte order mark (BOM) must be stripped.
Let C, the client data claimed as used for the signature, be the result of running an implementation-specific
JSON parser on JSONtext.
Note:C may be any implementation-specific data structure representation, as long as C’s components are referenceable, as
required by this algorithm.
Verify that the value of C.type is the string webauthn.get.
Verify that the value of C.challenge equals
the base64url encoding of pkOptions.challenge.
If user verification was determined to be required,
verify that the UV bit of the flags in authData is set.
Otherwise, ignore the value of the UVflag.
If the BE bit of the flags in authData is not set, verify that the BS bit is not set.
If the credential backup state is used as part of Relying Party business logic or policy,
let currentBe and currentBs be the values of the BE and BS bits, respectively,
of the flags in authData.
Compare currentBe and currentBs with
credentialRecord.backupEligible and credentialRecord.backupState:
If credentialRecord.backupEligible is set, verify that currentBe is set.
If credentialRecord.backupEligible is not set, verify that currentBe is not set.
This is a signal, but not proof, that the authenticator may be cloned. For example it might mean that:
Two or more copies of the credential private key may exist and are being used in parallel.
An authenticator is malfunctioning.
A race condition exists where the Relying Party is processing assertion responses in an order other than the order they were generated at the authenticator.
Since all extensions are OPTIONAL for both the client and the authenticator, the Relying Party MUST also be
prepared to handle cases where none or not all of the requested extensions were acted upon.
Update credentialRecord.backupState to the value of currentBs.
If credentialRecord.uvInitialized is false,
update it to the value of the UV bit in the flags in authData.
This change SHOULD require authorization by an additional authentication factor equivalent to WebAuthn user verification;
if not authorized, skip this step.
If the Relying Party performs additional security checks beyond these WebAuthn authentication ceremony steps,
the above state updates SHOULD be deferred to after those additional checks are completed successfully.
WebAuthn supports pluggable attestation statement formats. This section defines an initial set of such formats.
8.1. Attestation Statement Format Identifiers
Attestation statement formats are identified by a string, called an attestation statement format identifier, chosen by
the author of the attestation statement format.
Attestation statement format identifiers SHOULD be registered in the
IANA "WebAuthn Attestation Statement Format Identifiers" registry [IANA-WebAuthn-Registries] established by [RFC8809].
All registered attestation statement format identifiers are unique amongst themselves as a matter of course.
Unregistered attestation statement format identifiers SHOULD use lowercase reverse domain-name naming, using a domain name
registered by the developer, in order to assure uniqueness of the identifier. All attestation statement format identifiers MUST
be a maximum of 32 octets in length and MUST consist only of printable USASCII characters, excluding backslash and doublequote,
i.e., VCHAR as defined in [RFC5234] but without %x22 and %x5c.
Note: This means attestation statement format identifiers based on domain names are restricted to incorporating only LDH Labels [RFC5890].
Implementations MUST match WebAuthn attestation statement format identifiers in a case-sensitive fashion.
Attestation statement formats that may exist in multiple versions SHOULD include a version in their identifier. In effect,
different versions are thus treated as different formats, e.g., packed2 as a new version of the § 8.2 Packed Attestation Statement Format.
The following sections present a set of currently-defined and registered attestation statement formats and their identifiers.
The up-to-date list of registered attestation statement format identifiers is maintained in the
IANA "WebAuthn Attestation Statement Format Identifiers" registry [IANA-WebAuthn-Registries] established by [RFC8809].
8.2. Packed Attestation Statement Format
This is a WebAuthn optimized attestation statement format. It uses a very compact but still extensible encoding method. It is
implementable by authenticators with limited resources (e.g., secure elements).
The elements of this array contain attestnCert and its certificate chain (if any), each encoded in X.509 format. The attestation
certificate attestnCert MUST be the first element in the array.
attestnCert
The attestation certificate, encoded in X.509 format.
If Basic or AttCAattestation is in use, the authenticator produces the sig by concatenating authenticatorData and
clientDataHash, and signing the result using an attestation private key selected through an authenticator-specific
mechanism. It sets x5c to attestnCert followed by the related certificate chain (if any). It sets alg to the algorithm of the
attestation private key.
If self attestation is in use, the authenticator produces sig by concatenating authenticatorData and clientDataHash,
and signing the result using the credential private key. It sets alg to the algorithm of the credential private key and
omits the other fields.
Verify that attStmt is valid CBOR conforming to the syntax defined above and perform CBOR decoding on it to extract
the contained fields.
If x5c is present:
Verify that sig is a valid signature over the concatenation of authenticatorData and clientDataHash using the
attestation public key in attestnCert with the algorithm specified in alg.
If attestnCert contains an extension with OID 1.3.6.1.4.1.45724.1.1.4 (id-fido-gen-ce-aaguid) verify that the
value of this extension matches the aaguid in authenticatorData.
Optionally, inspect x5c and consult externally provided knowledge to determine whether attStmt conveys a
Basic or AttCA attestation.
If the related attestation root certificate is used for multiple authenticator models, the Extension OID
1.3.6.1.4.1.45724.1.1.4 (id-fido-gen-ce-aaguid) MUST be present, containing the AAGUID as a 16-byte OCTET STRING.
The extension MUST NOT be marked as critical.
As Relying Parties may not know if the attestation root
certificate is used for multiple authenticator models, it is suggested that Relying Parties check if the extension
is present, and if it is, then validate that it contains that same AAGUID as presented in the attestation object.
Note that an X.509 Extension encodes the DER-encoding of the value in an OCTET STRING.
Thus, the AAGUID MUST be wrapped in two OCTET STRINGS to be valid.
The Basic Constraints extension MUST have the CA component set to false.
Additionally, an Authority Information Access (AIA) extension with entry id-ad-ocsp and a CRL Distribution Point extension
[RFC5280] are both OPTIONAL as the status of many attestation certificates is available through authenticator metadata
services. See, for example, the FIDO Metadata Service [FIDOMetadataService].
The firmware of a particular authenticator model MAY be differentiated using the Extension OID 1.3.6.1.4.1.45724.1.1.5
(id-fido-gen-ce-fw-version). When present, this attribute contains an INTEGER with a non-negative value which is incremented for new
firmware release versions. The extension MUST NOT be marked as critical.
For example, the following is an attestation certificate containing the above extension OIDs as well as required fields:
8.2.2. Certificate Requirements for Enterprise Packed Attestation Statements
The Extension OID 1.3.6.1.4.1.45724.1.1.2 ( id-fido-gen-ce-sernum ) MAY additionally be present in packed attestations for enterprise use. If present, this extension MUST indicate a unique octet string value per device against a particular AAGUID. This value MUST remain constant through factory resets, but MAY be distinct from any other serial number or other hardware identifier associated with the device. This extension MUST NOT be marked as critical, and the corresponding value is encoded as an OCTET STRING. This extension MUST NOT be present in non-enterprise attestations.
8.3. TPM Attestation Statement Format
This attestation statement format is generally used by authenticators that use a Trusted Platform Module as their cryptographic
engine.
Concatenate authenticatorData and clientDataHash to form attToBeSigned.
Generate a signature using the procedure specified in [TPMv2-Part3] Section 18.2, using the attestation private key and
setting the extraData parameter to the digest of attToBeSigned using the hash algorithm corresponding to the "alg" signature algorithm.
(For the "RS256" algorithm, this would be a SHA-256 digest.)
Set the pubArea field to the public area of the credential public key (the TPMT_PUBLIC structure), the certInfo field (the TPMS_ATTEST structure)
to the output parameter of the same name, and the sig field to the signature obtained from the above procedure.
Note: If the pubArea is read from the TPM using the TPM2_ReadPublic command, that command returns a TPM2B_PUBLIC structure. TPM2B_PUBLIC
is two bytes of length followed by the TPMT_PUBLIC structure. The two bytes of length must be removed prior to putting this into the pubArea.
Verify that attStmt is valid CBOR conforming to the syntax defined above and perform CBOR decoding on it to extract the
contained fields.
Verify that the public key specified by the parameters and unique fields of pubArea is identical to the
credentialPublicKey in the attestedCredentialData in authenticatorData.
Concatenate authenticatorData and clientDataHash to form attToBeSigned.
If aikCert contains an extension with OID 1.3.6.1.4.1.45724.1.1.4 (id-fido-gen-ce-aaguid) verify that the value of this
extension matches the aaguid in authenticatorData.
Verify the sig is a valid signature over certInfo using the attestation public key in aikCert with the
algorithm specified in alg.
Validate that certInfo is valid:
Note: certInfo is a TPMS_ATTEST structure.
Verify that magic is set to TPM_GENERATED_VALUE.
Verify that type is set to TPM_ST_ATTEST_CERTIFY.
Verify that extraData is set to the hash of attToBeSigned using the hash algorithm employed in "alg".
Verify that attested contains a TPMS_CERTIFY_INFO structure as specified in [TPMv2-Part2] section 10.12.3,
whose name field contains a valid Name for pubArea, as computed using the procedure specified in [TPMv2-Part1] section 16 using the nameAlg in the pubArea.
Note: The TPM will always return TPMS_CERTIFY_INFO structure with the same nameAlg in the name as the nameAlg
in pubArea.
Note: The remaining fields in the "Standard Attestation Structure" [TPMv2-Part1]
section 31.2, i.e., qualifiedSigner, clockInfo and firmwareVersion are ignored.
Depending on the properties of the aikCert key used, these fields may be obfuscated.
If valid, these MAY be used as an input to risk engines.
The Subject Alternative Name extension MUST be set as defined in [TPMv2-EK-Profile] section 3.2.9.
Note: Previous versions of [TPMv2-EK-Profile] allowed the inclusion of an optional attribute,
called HardwareModuleName, that contains the TPM serial number in the EK certificate.
HardwareModuleName SHOULD NOT be placed in in the attestation certificate
Subject Alternative Name.
The Extended Key Usage extension MUST contain the OID 2.23.133.8.3
("joint-iso-itu-t(2) internationalorganizations(23) 133 tcg-kp(8) tcg-kp-AIKCertificate(3)").
The Basic Constraints extension MUST have the CA component set to false.
An Authority Information Access (AIA) extension with entry id-ad-ocsp and a CRL Distribution Point extension [RFC5280] are
both OPTIONAL as the status of many attestation certificates is available through metadata services.
See, for example, the FIDO Metadata Service [FIDOMetadataService].
An Android key attestation statement consists simply of the Android attestation statement, which is a series of
DER encoded X.509 certificates. See
the Android developer documentation. Its
syntax is defined as follows:
Request an Android Key Attestation by calling keyStore.getCertificateChain(myKeyUUID) providing clientDataHash as the
challenge value (e.g., by using
setAttestationChallenge). Set x5c to the returned value.
The authenticator produces sig by concatenating authenticatorData and clientDataHash,
and signing the result using the credential private key. It sets alg to the algorithm of the signature format.
Verify that attStmt is valid CBOR conforming to the syntax defined above and perform CBOR decoding on it to extract the
contained fields.
Verify that sig is a valid signature over the concatenation of authenticatorData and clientDataHash using the
public key in the first certificate in x5c with the algorithm specified in alg.
Verify the following using the appropriate authorization list from the attestation certificate
extension data:
The AuthorizationList.allApplications field is not present on either authorization list
(softwareEnforced nor teeEnforced), since PublicKeyCredential MUST be scoped to the RP ID.
For the following, use only the teeEnforced authorization list if the RP wants to accept only keys from a
trusted execution environment, otherwise use the union of teeEnforced and softwareEnforced.
The value in the AuthorizationList.origin field is equal to KM_ORIGIN_GENERATED.
The value in the AuthorizationList.purpose field is equal to KM_PURPOSE_SIGN.
Android Key Attestation attestation certificate’s android key attestation certificate extension
data is identified by the OID 1.3.6.1.4.1.11129.2.1.17, and its schema is defined in the Android developer documentation.
8.5. Android SafetyNet Attestation Statement Format
Note: This format is deprecated and is expected to be removed in a future revision of this document.
When the authenticator is a platform authenticator on certain Android platforms, the attestation
statement may be based on the SafetyNet API. In
this case the authenticator data is completely controlled by the caller of the SafetyNet API (typically an application
running on the Android platform) and the attestation statement provides some statements about the health of the platform
and the identity of the calling application
(see SafetyNet Documentation for more details).
Concatenate authenticatorData and clientDataHash, perform SHA-256 hash of the concatenated string, and
let the result of the hash form attToBeSigned.
Request a SafetyNet attestation, providing attToBeSigned as the nonce value. Set response to the result, and ver to
the version of Google Play Services running in the authenticator.
Verify that attStmt is valid CBOR conforming to the syntax defined above and perform CBOR decoding on it to extract the
contained fields.
Verify that response is a valid SafetyNet response of version ver
by following the steps indicated by the SafetyNet online documentation.
As of this writing, there is only one format of the SafetyNet response and ver is reserved for future use.
Verify that the nonce attribute in the payload of response is identical to the Base64 encoding of the SHA-256 hash of the concatenation of authenticatorData and clientDataHash.
Verify that the SafetyNet response actually came from the SafetyNet service by following the steps in the
SafetyNet online documentation.
Generate a Registration Response Message as specified in [FIDO-U2F-Message-Formats]Section 4.3, with the application parameter set to the
SHA-256 hash of the RP ID that the given credential is scoped to, the challenge parameter set to clientDataHash, and the key handle
parameter set to the credential ID of the given credential. Set the raw signature part of this Registration Response Message (i.e., without the user public key,
key handle, and attestation certificates) as sig and set the attestation certificates of
the attestation public key as x5c.
Verify that attStmt is valid CBOR conforming to the syntax defined above and perform CBOR decoding on it to extract the
contained fields.
Check that x5c has exactly one element and let attCert be that element. Let certificate public key be the public key
conveyed by attCert. If certificate public key is not an Elliptic Curve (EC) public
key over the P-256 curve, terminate this algorithm and return an appropriate error.
Extract the claimed rpIdHash from authenticatorData, and the claimed credentialId and credentialPublicKey from
authenticatorData.attestedCredentialData.
Let x be the value corresponding to the "-2" key (representing x coordinate) in credentialPublicKey, and confirm its
size to be of 32 bytes.
If size differs or "-2" key is not found, terminate this algorithm and return an appropriate error.
Let y be the value corresponding to the "-3" key (representing y coordinate) in credentialPublicKey, and confirm its
size to be of 32 bytes.
If size differs or "-3" key is not found, terminate this algorithm and return an appropriate error.
Let publicKeyU2F be the concatenation 0x04 || x || y.
Note: This signifies uncompressed ECC key format.
Let verificationData be the concatenation of (0x00 || rpIdHash ||
clientDataHash || credentialId || publicKeyU2F) (see Section 4.3 of [FIDO-U2F-Message-Formats]).
Verify the sig using verificationData and the certificate public key per section 4.1.4 of [SEC1] with SHA-256 as the hash function used in step two.
Optionally, inspect x5c and consult externally provided knowledge to determine whether attStmt conveys a Basic or
AttCA attestation.
credCert followed by its certificate chain, each encoded in X.509 format.
credCert
The credential public key certificate used for attestation, encoded in X.509 format.
Signing procedure
Let authenticatorData denote the authenticator data for the attestation, and let clientDataHash denote the hash of the serialized client data.
Concatenate authenticatorData and clientDataHash to form nonceToHash.
Perform SHA-256 hash of nonceToHash to produce nonce.
Let Apple anonymous attestation CA generate an X.509 certificate for the credential public key and include the nonce as a certificate extension with OID 1.2.840.113635.100.8.2. credCert denotes this certificate. The credCert thus serves as a proof of the attestation, and the included nonce proves the attestation is live. In addition to that, the nonce also protects the integrity of the authenticatorData and client data.
Set x5c to credCert followed by its certificate chain.
Verification procedure
Given the verification procedure inputs attStmt, authenticatorData and clientDataHash, the verification procedure is as follows:
Verify that attStmt is valid CBOR conforming to the syntax defined above and perform CBOR decoding on it to extract the contained fields.
Concatenate authenticatorData and clientDataHash to form nonceToHash.
Perform SHA-256 hash of nonceToHash to produce nonce.
Verify that nonce equals the value of the extension with OID 1.2.840.113635.100.8.2 in credCert.
If validation fails for one or more subStmt, decide the appropriate result based on Relying Party policy.
If sufficiently many (as determined by Relying Party policy) items of attStmt verify successfully,
return implementation-specific values representing any combination of outputs from successful verification procedures.
9. WebAuthn Extensions
The mechanism for generating public key credentials, as well as requesting and generating Authentication assertions, as
defined in § 5 Web Authentication API, can be extended to suit particular use cases. Each case is addressed by defining a registration
extension and/or an authentication extension.
Every extension is a client extension, meaning that the extension involves communication with and processing by the
client.
Client extensions define the following steps and data:
An extension can also be an authenticator extension, meaning that the extension involves communication with and
processing by the authenticator. Authenticator extensions define the following steps and data:
All WebAuthn Extensions are OPTIONAL for both clients and authenticators. Thus, any extensions requested by a Relying Party MAY be
ignored by the client browser or OS and not passed to the authenticator at all, or they MAY be ignored by the authenticator.
Ignoring an extension is never considered a failure in WebAuthn API processing, so when Relying Parties include extensions with any
API calls, they MUST be prepared to handle cases where some or all of those extensions are ignored.
All WebAuthn Extensions MUST be defined in such a way that lack of support for them by the client or authenticator
does not endanger the user’s security or privacy.
For instance, if an extension requires client processing, it could be defined in a manner that ensures
that a naïve pass-through that simply transcodes client extension inputs from JSON to CBOR
will produce a semantically invalid authenticator extension input value, resulting in the extension
being ignored by the authenticator. Since all extensions are OPTIONAL, this will not cause a functional failure in the API
operation.
Extensions are identified by a string, called an extension identifier, chosen by the extension author.
Extension identifiers SHOULD be registered in the
IANA "WebAuthn Extension Identifiers" registry [IANA-WebAuthn-Registries] established by [RFC8809].
All registered extension identifiers are unique amongst themselves as a matter of course.
Unregistered extension identifiers SHOULD aim to be globally unique, e.g., by including the defining entity such as
myCompany_extension.
All extension identifiers MUST be a maximum of 32 octets in length and MUST consist only of printable USASCII characters,
excluding backslash and doublequote, i.e., VCHAR as defined in [RFC5234] but without %x22 and %x5c. Implementations MUST
match WebAuthn extension identifiers in a case-sensitive fashion.
Extensions that may exist in multiple versions should take care to include a version in their identifier. In effect, different
versions are thus treated as different extensions, e.g., myCompany_extension_01
§ 10 Defined Extensions defines an additional set of extensions and their identifiers.
See the IANA "WebAuthn Extension Identifiers" registry [IANA-WebAuthn-Registries] established by [RFC8809]
for an up-to-date list of registered WebAuthn Extension Identifiers.
Any client extension that is processed by the client MUST return a client extension output value so that the WebAuthn Relying Party
knows that the extension was honored by the client. Similarly, any extension that requires authenticator processing MUST return
an authenticator extension output to let the Relying Party know that the extension was honored by the authenticator. If an
extension does not otherwise require any result values, it SHOULD be defined as returning a JSON Boolean client extension output result, set to true to signify that the extension was understood and processed. Likewise, any authenticator extension that does not otherwise require any result values MUST return a value and SHOULD return a CBOR Boolean
authenticator extension output result, set to true to signify that the extension was understood and processed.
9.3. Extending Request Parameters
An extension defines one or two request arguments. The client extension input,
which is a value that can be encoded in JSON, is passed from the WebAuthn Relying Party to the client
in the get() or create() call,
while the CBOR authenticator extension input is
passed from the client to the authenticator for authenticator extensions during the processing of these calls.
Note: Other documents have specified extensions where the extension input does not always use the extension identifier
as the entry key.
The above convention still applies to new extensions.
assertionPromise navigatorcredentialsget
publicKey
extensions
foo
bar
Extension definitions MUST specify the valid values for their client extension input. Clients SHOULD ignore extensions with
an invalid client extension input. If an extension does not require any parameters from the Relying Party, it SHOULD be defined
as taking a Boolean client argument, set to true to signify that the extension is requested by the Relying Party.
Because some authenticators communicate over low-bandwidth links such as Bluetooth Low-Energy or NFC,
extensions SHOULD aim to define authenticator arguments that are as small as possible.
9.4. Client Extension Processing
Extensions MAY define additional processing requirements on the client during the creation of credentials or the
generation of an assertion. The client extension input for the extension is used as an input to this client processing.
For each supported client extension, the client adds an entry to the clientExtensionsmap with the
extension identifier as the key, and the extension’s client extension input as the value.
Unsigned extension outputs are represented independently from authenticator data and returned by authenticators
as a separate map, keyed with the same extension identifier. This map only contains entries for authenticator
extensions that make use of unsigned outputs. Unsigned outputs are useful when extensions output a signature over
the authenticator data (because otherwise a signature would have to sign over itself, which isn’t possible) or when
some extension outputs should not be sent to the Relying Party.
This section and its subsections define an additional set of extensions to be registered in the
IANA "WebAuthn Extension Identifiers" registry [IANA-WebAuthn-Registries] established by [RFC8809].
These MAY be implemented by user agents targeting broad interoperability.
This extension allows WebAuthn Relying Parties that have previously registered a
credential using the legacy FIDO U2F JavaScript API [FIDOU2FJavaScriptAPI] to request an assertion. The
FIDO APIs use an alternative identifier for Relying Parties called an AppID[FIDO-APPID], and any credentials created using those APIs will be scoped to
that identifier. Without this extension, they would need to be re-registered in
order to be scoped to an RP ID.
In addition to setting the appid extension input,
using this extension requires some additional processing by the Relying Party
in order to allow users to authenticate using their registered U2F credentials:
List the desired U2F credentials in the allowCredentials option
of the get() method:
Set the id members to the respective U2F key handles of the desired credentials. Note that U2F key handles commonly use base64url encoding but must be decoded to their binary form when used in id.
allowCredentials MAY contain a mixture
of both WebAuthn credential IDs and U2F key handles;
stating the appid via this extension
does not prevent the user from using a WebAuthn-registered credential
scoped to the RP ID stated in rpId.
This extension does not allow FIDO-compatible credentials to be created. Thus,
credentials created with WebAuthn are not backwards compatible with the FIDO
JavaScript APIs.
Note:appid should be set to the AppID
that the Relying Partypreviously used in the legacy FIDO APIs.
This might not be the same as the result of translating the Relying Party’s WebAuthn RP ID to the AppID format,
e.g., the previously used AppID may have been "https://accounts.example.com"
but the currently used RP ID might be "example.com".
When building allowCredentialDescriptorList,
if a U2F authenticator indicates that a credential is inapplicable (i.e. by
returning SW_WRONG_DATA) then the client MUST retry with the U2F application
parameter set to the SHA-256 hash of appId. If this results in an applicable
credential, the client MUST include the credential in
allowCredentialDescriptorList. The value of appId then replaces the rpId
parameter of authenticatorGetAssertion.
Let output be the Boolean value false.
When creating assertionCreationData,
if the assertion was created by a U2F authenticator with the U2F application parameter set to the SHA-256 hash of appId
instead of the SHA-256 hash of the RP ID, set output to true.
This registration extension allows WebAuthn Relying Parties to exclude authenticators that contain specified credentials that were created with the legacy FIDO U2F JavaScript API [FIDOU2FJavaScriptAPI].
During a transition from the FIDO U2F JavaScript API, a Relying Party may have a population of users with legacy credentials already registered. The appid extension allows the sign-in flow to be transitioned smoothly but, when transitioning the registration flow, the excludeCredentials field will not be effective in excluding authenticators with legacy credentials because its contents are taken to be WebAuthn credentials. This extension directs client platforms to consider the contents of excludeCredentials as both WebAuthn and legacy FIDO credentials. Note that U2F key handles commonly use base64url encoding but must be decoded to their binary form when used in excludeCredentials.
Check whether C was created using U2F on authenticator by sending a
U2F_AUTHENTICATE message to authenticator
whose "five parts" are set to the following values:
If authenticator responds with message:error:test-of-user-presence-required (i.e., success):
cease normal processing of this authenticator and indicate in a platform-specific manner
that the authenticator is inapplicable. For example, this could be in the form of UI, or
could involve requesting user consent from authenticator and, upon receipt, treating
it as if the authenticator had returned InvalidStateError. Requesting user consent
can be accomplished by sending another U2F_AUTHENTICATE message to authenticator as
above except for setting control byte to 0x03 ("enforce-user-presence-and-sign"),
and ignoring the response.
Continue with normal processing.
Client extension output
Returns the value true to indicate to the Relying Party that the extension was acted upon.
As a motivating example, PRF outputs could be used as symmetric keys to encrypt user data. Such encrypted data would be inaccessible without the ability to get assertions from the associated credential. By using the provision below to evaluate the PRF at two inputs in a single assertion operation, the encryption key could be periodically rotated during assertions by choosing a fresh, random input and reencrypting under the new output. If the evaluation inputs are unpredictable then even an attacker who could satisfy user verification, and who had time-limited access to the authenticator, could not learn the encryption key without also knowing the correct PRF input.
This extension is modeled on top of the [FIDO-CTAP]hmac-secret extension, but can also be implemented by other means.
It is a separate client extension because hmac-secret requires that inputs and outputs be encrypted
in a manner that only the user agent can perform,
and to provide separation between uses by WebAuthn and any uses by the underlying platform.
This separation is achieved by hashing the provided PRF inputs with a context string
to prevent evaluation of the PRFs for arbitrary inputs.
The hmac-secret extension provides two PRFs per credential: one which is used for requests where user verification is performed and another for all other requests. This extension only exposes a single PRF per credential and, when implementing on top of hmac-secret, that PRF MUST be the one used for when user verification is performed. This overrides the UserVerificationRequirement if necessary.
This extension MAY be implemented for authenticators that do not use [FIDO-CTAP].
The interface for this between client and authenticator,
and the construction of the PRF by the authenticator, is only abstractly specified.
Note: Implementing on top of hmac-secret causes authenticator extension outputs that are not present otherwise.
These outputs are encrypted and cannot be used by the Relying Party,
but also cannot be deleted by the client since the authenticator data is signed.
One or two inputs on which to evaluate PRF. Not all authenticators support evaluating the PRFs during credential creation so outputs may, or may not, be provided. If not, then an assertion is needed in order to obtain the outputs.
Let salt1 be the value of SHA-256(UTF8Encode("WebAuthn PRF") || 0x00 || eval.first).
If eval.second is present,
let salt2 be the value of SHA-256(UTF8Encode("WebAuthn PRF") || 0x00 || eval.second).
If the authenticator supports the CTAP2 hmac-secret extension [FIDO-CTAP]:
Set hmac-secret to true in the authenticator extensions input.
If salt1 is defined and a future extension to [FIDO-CTAP] permits evaluation of the PRF at creation time,
configure hmac-secret inputs accordingly using the values of salt1 and, if defined, salt2.
Set enabled to the value of hmac-secret in the authenticator extensions output. If not present, set enabled to false.
Set results to the decrypted PRF result(s), if any.
If the authenticator does not support the CTAP2 hmac-secret extension [FIDO-CTAP],
but does support some other implementation compatible with the abstract authenticator processing defined below:
If ev is null and eval is present, then let ev be the value of eval.
If ev is not null:
Let salt1 be the value of SHA-256(UTF8Encode("WebAuthn PRF") || 0x00 || ev.first).
If ev.second is present, let salt2 be the value of SHA-256(UTF8Encode("WebAuthn PRF") || 0x00 || ev.second).
If the authenticator supports the CTAP2 hmac-secret extension [FIDO-CTAP]:
Send an hmac-secret extension to the authenticator using the values of salt1 and, if set, salt2 as the parameters of the same name in that process.
Decrypt the extension result and set results to the PRF result(s), if any.
If the authenticator does not support the CTAP2 hmac-secret extension [FIDO-CTAP],
but does support some other implementation compatible with the abstract authenticator processing defined below:
Use some unspecified mechanism to convey salt1 and, if defined, salt2 to the authenticator as PRF inputs, in that order.
This extension is abstract over the authenticator implementation,
using either the [FIDO-CTAP]hmac-secret extension or an unspecified interface for communication between the client and authenticator.
It thus does not specify a CBOR interface for inputs and outputs, except for the following requirement:
Note: This is because the authenticator data is signed,
so authenticator extension outputs cannot be omitted in case the PublicKeyCredential needs to be sent to the Relying Party server.
This is important for use cases where PRF outputs should remain private to the client side,
such as using PRF outputs to derive encryption keys.
Authenticator extension processing
Authenticators that support the [FIDO-CTAP]hmac-secret extension implement authenticator processing as defined in that extension.
Authenticators that do not support the [FIDO-CTAP]hmac-secret extension
MAY instead implement the following abstract procedure:
Let PRF be the pseudo-random function associated with the current credential,
or initialize the association if uninitialized:
Let PRF be a pseudo-random function whose outputs are exactly 32 bytes long,
selected uniformly at random from a set of at least 2256 such functions.
The choice of PRF MUST be independent of the state of user verification.
The selected PRF SHOULD NOT be used for other purposes than implementing this extension.
Associate PRF with the current credential for the lifetime of the credential.
Use some unspecified mechanism to receive PRF inputs salt1 and, optionally, salt2 from the client, in that order.
If none are received, let salt1 and salt2 be undefined.
true if, and only if, the PRF is available for use with the created credential. This is only reported during registration and is not present in the case of authentication.
The results of evaluating the PRF for the inputs given in eval or evalByCredential. Outputs may not be available during registration; see comments in eval.
This clientregistration extension and authentication extension allows a Relying Party to store opaque data associated with a credential. Since authenticators can only store small amounts of data, and most Relying Parties are online services that can store arbitrary amounts of state for a user, this is only useful in specific cases. For example, the Relying Party might wish to issue certificates rather than run a centralised authentication service.
Note:Relying Parties can assume that the opaque data will be compressed when being written to a space-limited device and so need not compress it themselves.
Since a certificate system needs to sign over the public key of the credential, and that public key is only available after creation, this extension does not add an ability to write blobs in the registration context. However, Relying Parties SHOULD use the registration extension when creating the credential if they wish to later use the authentication extension.
Since certificates are sizable relative to the storage capabilities of typical authenticators, user agents SHOULD consider what indications and confirmations are suitable to best guide the user in allocating this limited resource and prevent abuse.
Note: In order to interoperate, user agents storing large blobs on authenticators using [FIDO-CTAP] are expected to use the provisions detailed in that specification for storing large, per-credential blobs.
A boolean that indicates that the Relying Party would like to fetch the previously-written blob associated with the asserted credential. Only valid during authentication.
A boolean that indicates that the contents of write were successfully stored on the authenticator, associated with the specified credential.
Authenticator extension processing
This extension directs the user-agent to cause the large blob to be stored on, or retrieved from, the authenticator. It thus does not specify any direct authenticator interaction for Relying Parties.
10.1.6. Remote Client Data JSON extension (remoteClientDataJSON)
Remote desktop web client let users interact with the (native) desktop environment of a remote host from a local client (web) application.
This allows web-based remote desktop web clients to execute remote WebAuthn requests locally. Here the Remote desktop web client is calling WebAuthn request on behalf of
RP present on the remote machine and have different origin than the calling RP in the remote machine.
This extension is a powerful feature that requires explicit per-origin permission before use.
User agents SHOULD NOT prompt the user for this permission at request time;
instead, the grant is administered through device management policy (e.g., managed browser profiles, managed browser instances, or
managed devices that enumerate specific Remote desktop web client origins) or
through explicit per-origin user opt-in in WebAuthn Client settings.
This permission MUST be configured per-origin and MUST NOT offer the capability to permit all origins.
collectedClientData has been parsed from given remoteClientDataJSON in establishing the RP ID.
The user agent MUST NOT add, remove, or modify any contents of collectedClientData,
as doing so would invalidate the remote machine’s calculated clientDataJSON,
resulting in a signature mismatch at the Relying Party.
The user agent MUST NOT add, remove, or modify any contents of remoteClientDataJSON,
to construct clientDataJSON here as doing so would invalidate the remote machine’s calculated clientDataJSON,
resulting in a signature mismatch at the Relying Party.
collectedClientData has been parsed from given remoteClientDataJSON in establishing the RP ID.
The user agent MUST NOT add, remove, or modify any contents of collectedClientData,
as doing so would invalidate the remote machine’s calculated clientDataJSON,
resulting in a signature mismatch at the Relying Party.
The user agent MUST NOT add, remove, or modify any contents of remoteClientDataJSON,
to construct clientDataJSON here as doing so would invalidate the remote machine’s calculated clientDataJSON,
resulting in a signature mismatch at the Relying Party.
Authenticator extension input
None
Authenticator extension processing
None
Authenticator extension output
None
Client extension output
Returns the value true to indicate to the Relying Party that the extension was acted upon.
If value is true and the endpoint node WebAuthn WebDriver implementation does not support the authenticator extension identified by the key,
the match is unsuccessful.
An non-null string made using up to 48 characters from the unreserved production defined in Appendix A of [RFC3986]
that uniquely identifies the Virtual Authenticator.
WebAuthn Attestation Statement Format Identifier: packed
Description: The "packed" attestation statement format is a WebAuthn-optimized format for attestation. It uses a very
compact but still extensible encoding method. This format is implementable by authenticators with limited resources (e.g.,
secure elements).
WebAuthn Attestation Statement Format Identifier: tpm
Description: The TPM attestation statement format returns an attestation statement in the same format as the packed
attestation statement format, although the rawData and signature fields are computed differently.
WebAuthn Attestation Statement Format Identifier: none
Description: Used to replace any authenticator-provided attestation statement when a WebAuthn Relying Party indicates it does not wish to receive attestation information.
Description: This registration extension allows WebAuthn Relying Parties to exclude authenticators that contain specified credentials that were created with the legacy FIDO U2F JavaScript API [FIDOU2FJavaScriptAPI].
At this time, this specification does not feature detailed security considerations. However, the [FIDOSecRef] document provides a security analysis which is overall applicable to this specification.
Also, the [FIDOAuthnrSecReqs] document suite provides useful information about authenticator security characteristics.
The below subsections comprise the current Web Authentication-specific security considerations.
They are divided by audience;
general security considerations are direct subsections of this section,
while security considerations specifically for authenticator, client and Relying Party implementers
are grouped into respective subsections.
13.2. Physical Proximity between Client and Authenticator
In the WebAuthn authenticator model, it is generally assumed that roaming authenticators
are physically close to, and communicate directly with, the client.
This arrangement has some important advantages.
The promise of physical proximity between client and authenticator
is a key strength of a something you haveauthentication factor.
For example, if a roaming authenticator can communicate only via USB or Bluetooth,
the limited range of these transports ensures that any malicious actor
must physically be within that range in order to interact with the authenticator.
This is not necessarily true of an authenticator that can be invoked remotely —
even if the authenticator verifies user presence,
users can be tricked into authorizing remotely initiated malicious requests.
If designing a solution where the authenticator does not need to be physically close to the client,
or where client and authenticator do not communicate directly,
designers SHOULD consider how this affects the enforcement of scope restrictions
and the strength of the authenticator as a something you have authentication factor.
A 3-tier hierarchy for attestation certificates is RECOMMENDED (i.e., Attestation Root, Attestation Issuing CA, Attestation
Certificate). It is also RECOMMENDED that for each WebAuthn Authenticator device line (i.e., model), a separate issuing CA is
used to help facilitate isolating problems with a specific version of an authenticator model.
If the attestation root certificate is not dedicated to a single WebAuthn Authenticator device line (i.e., AAGUID), the AAGUID
SHOULD be specified in the attestation certificate itself, so that it can be verified against the authenticator data.
13.3.2. Attestation Certificate and Attestation Certificate CA Compromise
Origin substitution: The user agent accepts a origin supplied by the calling
Remote desktop web client rather than deriving it from the current execution context.
Any user agent granting this permission MUST therefore trust that the caller
accurately and honestly supplies the origin of the remote Relying Party.
RP ID validation: The RP ID validatation is delegated to the remote client as remote client
has all the necessary context of validating the origin to account for related origins and platform specific app deployment models.
Any user agent granting this permission MUST therefore trust that the remote client has
accurately and honestly validated RP ID against all the origin checks.
Per-origin configuration mechanism required: As this extension’s permissions are per origin,
user agents MUST only provide configuration mechanisms which are per-origin basis
via user agent policy (e.g. UA settings or enterprise policy).
User agents that grant this extension SHOULD clearly communicate to users when a
remote-desktop-proxied WebAuthn operation is in progress, so that users understand
that their authenticator is being used on behalf of a remotely hosted application.
The Relying Party can automatically support multiple types of user verification - for example PIN, biometrics and/or future
methods - with little or no code change, and can let each user decide which they prefer to use via their choice of
authenticator.
The Relying Party does not need to store additional secrets in order to gain the above benefits.
13.5.2. Visibility Considerations for Embedded Usage
Simplistic use of WebAuthn in an embedded context, e.g., within iframes as described in § 5.10 Using Web Authentication within iframe elements, may make users vulnerable to UI Redressing attacks, also known as "Clickjacking". This is where an attacker overlays their own UI on top of a Relying Party’s intended UI and attempts to trick the user into performing unintended actions with the Relying Party. For example, using these techniques, an attacker might be able to trick users into purchasing items, transferring money, etc.
Even though WebAuthn-specific UI is typically handled by the client platform and thus is not vulnerable to UI Redressing, it is likely important for an Relying Party having embedded WebAuthn-wielding content to ensure that their content’s UI is visible to the user. An emerging means to do so is by observing the status of the experimental Intersection Observer v2’s isVisible attribute. For example, the Relying Party’s script running in the embedded context could pre-emptively load itself in a popup window if it detects isVisble being set to false, thus side-stepping any occlusion of their content.
13.5.3. Cryptographic Challenges
As a cryptographic protocol, Web Authentication is dependent upon randomized challenges
to avoid replay attacks. Therefore, the values of both PublicKeyCredentialCreationOptions.challenge and PublicKeyCredentialRequestOptions.challenge MUST be randomly generated
by Relying Parties in an environment they trust (e.g., on the server-side), and the
returned challenge value in the client’s
response MUST match what was generated. This SHOULD be done in a fashion that does not rely
upon a client’s behavior, e.g., the Relying Party SHOULD store the challenge temporarily
until the operation is complete. Tolerating a mismatch will compromise the security
of the protocol.
In order to prevent replay attacks, the challenges MUST contain enough entropy to make guessing them infeasible. Challenges SHOULD
therefore be at least 16 bytes long.
Such an attack would potentially be detectable; since the Relying Party has registered the attacker’s credential public key rather
than the user’s, the attacker must tamper with all subsequent authentication ceremonies with that Relying Party: unscathed
ceremonies will fail, potentially revealing the attack.
If attestation certificate validation fails due to a revoked intermediate attestation CA certificate, and the Relying Party’s policy
requires rejecting the registration/authentication request in these situations, then it is RECOMMENDED that the Relying Party also
un-registers (or marks with a trust level equivalent to "self attestation") public key credentials that were registered
after the CA compromise date using an attestation certificate chaining up to the same intermediate CA. It is thus RECOMMENDED
that Relying Parties remember intermediate attestation CA certificates during registration in order to un-register
related public key credentials if the registration was performed after revocation of such certificates.
In this case the allowCredentials argument risks leaking information
about which user accounts have WebAuthn credentials registered and which do not,
which may be a signal of account protection strength.
For example, say an attacker can initiate an authentication ceremony by providing only a username,
and the Relying Party responds with a non-empty allowCredentials for some user accounts,
and with failure or a password challenge for other user accounts.
The attacker can then conclude that the latter user accounts
likely do not require a WebAuthn assertion for successful authentication,
and thus focus an attack on those likely weaker accounts.
Code injection can happen in several ways;
this section attempts to point out some likely scenarios and suggest suitable mitigations,
but is not an exhaustive list.
Malicous code could be injected by a third-party script included by the Relying Party,
either intentionally or due to a security vulnerability in the third party.
The Relying Party SHOULD use Content Security Policy [CSP2],
and/or other appropriate technologies available at the time, to limit what script can run on its
origins.
The Relying Party MUST NOT accept unexpected values of origin,
as doing so could allow a malicious website to obtain valid credentials.
Although the scope of WebAuthn credentials prevents their use on domains
outside the RP ID they were registered for,
the Relying Party’s origin validation serves as an additional layer of protection
in case a faulty authenticator fails to enforce credential scope.
See also § 13.5.8 Code injection attacks for discussion of potentially malicious subdomains.
Validation MAY be performed by exact string matching or any other method as needed by the Relying Party.
For example:
A web application served only at https://example.org SHOULD require
origin to exactly equal https://example.org.
This is the simplest case, where origin is expected
to be the string https:// followed by the RP ID.
A web application served at a small number of domains might require
origin to exactly equal some element of a list of allowed origins,
for example the list ["https://example.org", "https://login.example.org"].
A web application leveraging related origin requests might also require
origin to exactly equal some element of a list of allowed origins,
for example the list ["https://example.co.uk", "https://example.de", "https://myexamplerewards.com"].
This list will typically match the origins listed in the well-known URI for the RP ID. See § 5.11 Using Web Authentication across related origins.
A web application served at a large set of domains that changes often might parse
origin structurally and require that the URL scheme is https
and that the authority equals or is any subdomain of the RP ID - for example,
example.org or any subdomain of example.org).
A web application with a companion native application might allow
origin to be an operating system dependent
identifier for the native application. For example, such a Relying Party might require that
origin exactly equals some element of the list
["https://example.org", "example-os:appid:204ffa1a5af110ac483f131a1bef8a841a7adb0d8d135908bbd964ed05d2653b"].
Similar considerations apply when validating the topOrigin member of the client data.
When topOrigin is present, the Relying Party MUST validate that its value is expected.
This validation MAY be performed by exact string matching or any other method as needed by the Relying Party.
For example:
A web application that does not wish to be embedded in a cross-origin iframe
might require topOrigin to exactly equal origin.
A web application that wishes to be embedded in a cross-origin iframe on a small number of domains
might require topOrigin to exactly equal some element of a list of allowed origins,
for example the list ["https://example-partner1.org", "https://login.partner2-example.org"].
A web application that wishes to be embedded in a cross-origin iframe on a large number of domains
might allow any value of topOrigin, or use a dynamic procedure
to determine whether a given topOrigin value is allowed for a particular ceremony.
This section is divided by audience;
general privacy considerations are direct subsections of this section,
while privacy considerations specifically for authenticator, client and Relying Party implementers
are grouped into respective subsections.
14.1. De-anonymization Prevention Measures
This section is not normative.
Many aspects of the design of the Web Authentication API are motivated by privacy concerns. The main concern considered in
this specification is the protection of the user’s personal identity, i.e., the identification of a human being or a correlation
of separate identities as belonging to the same human being. Although the Web Authentication API does not use or provide any
form of global identity, the following kinds of potentially correlatable identifiers are used:
These identities are obviously used by each Relying Party to identify a user in their system. They are also visible to the
client in the communication with the authenticator.
The user’s biometric characteristic(s), e.g., fingerprints or facial recognition data [ISOBiometricVocabulary].
Some of the above information is necessarily shared with the Relying Party. The following sections describe the measures taken to
prevent malicious Relying Parties from using it to discover a user’s personal identity.
Attestation certificates and attestation key pairs can be used to track users
or link various online identities of the same user together.
This can be mitigated in several ways, including:
[UAFProtocol] requires that at least 100,000 authenticator devices share the same attestation certificate in order to produce
sufficiently large groups. This may serve as guidance about suitable batch sizes.
Note: In various places outside this specification, the term "Privacy CA" is used to refer to what is termed here
as an Anonymization CA. Because the Trusted Computing Group (TCG) also used the term "Privacy CA" to refer to what
the TCG now refers to as an Attestation CA (ACA) [TCG-CMCProfile-AIKCertEnroll], we are using the term Anonymization CA here to try to mitigate
confusion in the specific context of this specification.
14.4.2. Privacy of personally identifying information Stored in Authenticators
Authenticators MAY provide additional information to clients outside what’s defined by this specification, e.g.,
to enable the client to provide a rich UI with which the user can pick which credential to use for an authentication ceremony. If an authenticator chooses to do so, it SHOULD NOT expose personally identifying information unless successful user verification has been
performed. If the authenticator supports user verification with more than one concurrently enrolled user, the
authenticator SHOULD NOT expose personally identifying information of users other than the currently verified user. Consequently, an
authenticator that is not capable of user verification SHOULD NOT store personally identifying information.
These recommendations serve to prevent an adversary with physical access to an authenticator from extracting personally identifying information about the
authenticator’s enrolled user(s).
If the above cases are distinguishable, information is leaked by which a malicious Relying Party could identify the user by probing for
which credentials are available. For example, one such information leak is if the client returns a
failure response as soon as an excluded authenticator becomes available. In this case - especially if the excluded
authenticator is a platform authenticator - the Relying Party could detect that the ceremony was canceled
before the user could feasibly have canceled it manually, and thus conclude that at least one of the credentials listed in the excludeCredentials parameter is available to the user.
The above is not a concern, however, if the user has consented to create a new credential before a
distinguishable error is returned, because in this case the user has confirmed intent to share the information that would be
leaked.
A named credential is available, but the user does not consent to use it.
If the above cases are distinguishable, information is leaked by which a malicious Relying Party could identify the user by probing
for which credentials are available.
For example, one such information leak may happen if the client displays instructions and controls
for canceling or proceeding with the authentication ceremony
only after discovering an authenticator that contains a named credential.
In this case, if the Relying Party is aware of this client behavior,
the Relying Party could detect that the ceremony was canceled by the user and not the timeout, and thus conclude that at least
one of the credentials listed in the allowCredentials parameter is
available to the user.
This concern may be addressed by displaying controls allowing the user to cancel an authentication ceremony at any time,
regardless of whether any named credentials are available.
The getClientCapabilities method assists WebAuthn Relying Parties in crafting registration and authentication experiences which have a high chance of success with the client and/or user.
A WebAuthn Client’s support or lack of support of a capability may pose a fingerprinting risk. To reduce this risk, clients SHOULD prefer to omit a key from the returned record rather than returning a value of false. Omitting the key (as described in § 5.1.7 Availability of client capabilities - PublicKeyCredential’s getClientCapabilities() Method) provides less fingerprinting surface than explicitly confirming a feature is unsupported. Client implementations MAY also wish to limit capability disclosures based on client policy and/or user consent.
While initiating a registration or authentication ceremony, there is a risk that the WebAuthn Relying Party might leak sensitive
information about its registered users. For example, if a Relying Party uses e-mail addresses as usernames and an attacker attempts to
initiate an authenticationceremony for "alex.mueller@example.com" and the Relying Party responds with a failure, but then
successfully initiates an authentication ceremony for "j.doe@example.com", then the attacker can conclude that "j.doe@example.com"
is registered and "alex.mueller@example.com" is not. The Relying Party has thus leaked the possibly sensitive information that
"j.doe@example.com" has a user account at this Relying Party.
The following is a non-normative, non-exhaustive list of measures the Relying Party may implement to mitigate or prevent information
leakage due to such an attack:
When initiating a registration ceremony, disallow registration of usernames that are syntactically valid e-mail
addresses.
Note: The motivation for this suggestion is that in this case the Relying Party probably has no choice but to fail the
registration ceremony if the user attempts to register a username that is already registered, and an information
leak might therefore be unavoidable. By disallowing e-mail addresses as usernames, the impact of the leakage can be
mitigated since it will be less likely that a user has the same username at this Relying Party as at other Relying Parties.
If the Relying Party uses e-mail addresses to identify users:
When initiating a registration ceremony, interrupt the user interaction after the e-mail address is supplied and
send a message to this address, containing an unpredictable one-time code and instructions for how to use it to
proceed with the ceremony. Display the same message to the user in the web interface regardless of the contents of the
sent e-mail and whether or not this e-mail address was already registered.
Note: This suggestion can be similarly adapted for other externally meaningful identifiers, for example, national ID
numbers or credit card numbers — if they provide similar out-of-band contact information, for example,
conventional postal address.
Note: The username may be "provided" in various Relying Party-specific fashions: login form, session cookie, etc.
Note: If returned imaginary values noticeably differ from actual ones, clever attackers may be able to discern them and
thus be able to test for existence of actual accounts. Examples of noticeably different values include if the values
are always the same for all username inputs, or are different in repeated attempts with the same username input. The
allowCredentials member could therefore be populated with pseudo-random values
derived deterministically from the username, for example.
When verifying an AuthenticatorAssertionResponse response from the authenticator, make it indistinguishable whether
verification failed because the signature is invalid or because no such user or credential is registered.
Perform a multi-step authentication ceremony, e.g., beginning with supplying username and password or a session cookie,
before initiating the WebAuthn ceremony as a subsequent step.
This moves the username enumeration problem from the WebAuthn step
to the preceding authentication step, where it may be easier to solve.
In this case the allowCredentials argument risks leaking personally identifying information,
since it exposes the user’s credential IDs to an unauthenticated caller.
Credential IDs are designed to not be correlatable between Relying Parties,
but the length of a credential ID might be a hint as to what type of authenticator created it.
It is likely that a user will use the same username and set of authenticators for several Relying Parties,
so the number of credential IDs in allowCredentials and their lengths
might serve as a global correlation handle to de-anonymize the user.
Knowing a user’s credential IDs also makes it possible to confirm guesses about the user’s identity
given only momentary physical access to one of the user’s authenticators.
In order to prevent such information leakage, the Relying Party could for example:
Perform a separate authentication step,
such as username and password authentication or session cookie authentication,
before initiating the WebAuthn authentication ceremony and exposing the user’s credential IDs.
User verification-capable authenticators, whether roaming or platform, should offer users more than one user verification method. For example, both fingerprint sensing and PIN entry. This allows for fallback to other user verification means if the selected one is not working for some reason. Note that in the case of roaming authenticators, the authenticator and platform might work together to provide a user verification method such as PIN entry [FIDO-CTAP].
Relying Parties, at registration time, SHOULD provide affordances for users to complete future authorization gestures correctly. This could involve naming the authenticator, choosing a picture to associate with the device, or entering freeform text instructions (e.g., as a reminder-to-self).
All examples use the RP IDexample.org, the originhttps://example.org
and, where applicable, the topOriginhttps://example.com.
Examples include no attestation when not noted otherwise.
Note that composite objects such as clientDataJSON, attestationObject and attestation certificates
may contain additional, usually constant, data not mentioned explicitly in the pseudocode.
All random values are deterministically generated using HKDF-SHA-256 [RFC5869]
from the base input key material denoted in CDDL as 'WebAuthn test vectors',
or equivalently as h'576562417574686e207465737420766563746f7273'.
ECDSA signatures use a deterministic nonce [RFC6979].
The RSA key in the examples is constructed from the two smallest Mersenne primes 2p - 1 such that p ≥ 1024.
Although each example uses a different AAGUID, the AAGUID would normally be constant for a given authenticator.
Note:Authenticators implementing CTAP2 [FIDO-CTAP] return attestation objects
using different keys than those defined in this specification.
These examples reflect the attestation object format expected by WebAuthn Relying Parties,
so attestation objects emitted from CTAP2 need their keys translated
in order to be bitwise identical to these examples.
16.1. Attestation trust root certificate
All examples that include attestation use the attestation trust root certificate
given as attestation_ca_cert below, encoded in X.509 DER [RFC5280]:
This section lists example values for the pseudo-random function (prf) extension.
Because the prf extension integrates with the CTAP2 hmac-secret extension [FIDO-CTAP],
the examples are divided into two sections:
example inputs and outputs for the WebAuthn prf extension, relevant to WebAuthn Clients and WebAuthn Relying Parties;
and example mappings between the WebAuthn prf extension and the CTAP2 hmac-secret extension,
relevant to WebAuthn Clients and WebAuthn Authenticator.
16.17.1.1. Web Authentication API
The following examples may be used to test WebAuthn Client implementations of and WebAuthn Relying Party usage of the prf extension.
The examples are not exhaustive.
prf eval first Uint8Array
prf enabled
prf enabled
prf enabled results first ArrayBuffer
prf
prf results first ArrayBuffer
The results.second output
is present if and only if the results output is present
and the second input was present in the chosen PRF inputs:
prf
eval
first Uint8Array
second Uint8Array
evalByCredential
first Uint8Array
prf results first ArrayBuffer
prf
prf results first ArrayBuffer second ArrayBuffer
prf
evalByCredential
first Uint8Array
second Uint8Array
prf
results
first Uint8Array
second Uint32Array
Pseudo-random values used in this section were generated as follows:
"e02eZ9lPp0UdkF4vGRO4-NxlhWBkL1FCmsmb1tTfRyE" = Base64Url(SHA-256(UTF-8("WebAuthn PRF test vectors") || 0x00))
h'c4172e982e9097c39a6c0cb720cb375b92e3fcad154a63e43a93f1096b1e1973' = SHA-256(UTF-8("WebAuthn PRF test vectors") || 0x01)
16.17.1.2. CTAP2 hmac-secret extension
The following examples may be used to test WebAuthn Client implementations
of how the prf extension uses the [FIDO-CTAP]hmac-secret extension.
The examples are given in CDDL [RFC8610] notation.
The examples are not exhaustive.
The following shared definitions are used in all subsequent examples:
h
h
h
The first and second inputs
are mapped in the examples as prf_eval_first and prf_eval_second, respectively.
The prf_results_first and prf_results_second values in the examples
are mapped to the
results.first
and results.second
outputs, respectively.
Single input case using PIN protocol 2:
h
h
h
h
h
h
h
Two input case using PIN protocol 2:
h
h
h
h
h
h
h
h
h
h
h
Single input case using PIN protocol 1:
h
h
h
h
h
h
h
Inputs and pseudo-random values used in this section were generated as follows:
authenticator_key_agreement_public_key = P256-Public-Key(sk)
where sk = SHA-256(seed || 0x05)
authenticator_cred_random = SHA-256(seed || 0x06)
iv in single-input salt_enc with PIN protocol 2: Truncated SHA-256(seed || 0x07)
iv in two-input salt_enc with PIN protocol 2: Truncated SHA-256(seed || 0x08)
iv in single-input output_enc with PIN protocol 2: Truncated SHA-256(seed || 0x09)
iv in two-input output_enc with PIN protocol 2: Truncated SHA-256(seed || 0x0a)
17. Acknowledgements
We thank the following people for their reviews of, and contributions to, this specification:
Yuriy Ackermann,
James Barclay,
Richard Barnes,
Dominic Battré,
Julien Cayzac,
Domenic Denicola,
Rahul Ghosh,
Brad Hill,
Nidhi Jaju,
Jing Jin,
Wally Jones,
Ian Kilpatrick,
Axel Nennker,
Zack Newman,
Yoshikazu Nojima,
Kimberly Paulhamus,
Adam Powers,
Yaron Sheffer,
Anne van Kesteren,
Johan Verrept,
and
Boris Zbarsky.