1. Introduction
This section is not normative.
This specification defines an API enabling the creation and use of strong, attested, scoped, public key-based credentials by web applications, for the purpose of strongly authenticating users. A public key credential is created and stored by a WebAuthn Authenticator at the behest of a WebAuthn Relying Party, subject to user consent. Subsequently, the public key credential can only be accessed by origins belonging to that Relying Party. This scoping is enforced jointly by conforming User Agents and authenticators. Additionally, privacy across Relying Parties is maintained; Relying Parties are not able to detect any properties, or even the existence, of credentials scoped to other Relying Parties.
Relying Parties employ the Web Authentication API during two distinct, but related, ceremonies involving a user. The first
is Registration, where a public key credential is created on an authenticator, and scoped to a Relying Party with the present user’s account (the account might already exist or might be created at this time). The second is Authentication, where the Relying Party is presented with an Authentication Assertion proving the presence
and consent of the user who registered the public key credential. Functionally, the Web Authentication
API comprises a PublicKeyCredential
which extends the Credential Management API [CREDENTIAL-MANAGEMENT-1], and
infrastructure which allows those credentials to be used with navigator.credentials.create()
and navigator.credentials.get()
. The former is used during Registration, and the
latter during Authentication.
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.
All audiences ought to begin with § 1.2 Use Cases, § 1.3 Sample API Usage Scenarios, and § 4 Terminology, and should also refer to [WebAuthnAPIGuide] for an overall tutorial. Beyond that, the intended audiences for this document are the following main groups:
-
Relying Party web application developers, especially those responsible for Relying Party web application login flows, account recovery flows, user account database content, etc.
-
Web framework developers
-
The above two audiences should in particular refer to § 7 WebAuthn Relying Party Operations. The introduction to § 5 Web Authentication API may be helpful, though readers should realize that the § 5 Web Authentication API section is targeted specifically at user agent developers, not web application developers. Additionally, if they intend to verify authenticator attestations, then § 6.5 Attestation and § 8 Defined Attestation Statement Formats will also be relevant. § 9 WebAuthn Extensions, and § 10 Defined Extensions will be of interest if they wish to make use of extensions. Finally, they should read § 13.4 Security considerations for Relying Parties and § 14.6 Privacy considerations for Relying Parties and consider which challenges apply to their application and users.
-
-
User agent developers
-
OS platform developers, responsible for OS platform API design and implementation in regards to platform-specific authenticator APIs, platform WebAuthn Client instantiation, etc.
-
The above two audiences should read § 5 Web Authentication API very carefully, along with § 9 WebAuthn Extensions if they intend to support extensions. They should also carefully read § 14.5 Privacy considerations for clients.
-
-
Authenticator developers. These readers will want to pay particular attention to § 6 WebAuthn Authenticator Model, § 8 Defined Attestation Statement Formats, § 9 WebAuthn Extensions, and § 10 Defined Extensions. They should also carefully read § 13.3 Security considerations for authenticators and § 14.4 Privacy considerations for authenticators.
It is important for Web Authentication deployments' end-to-end security that the role of each component—the Relying Party server, the client, and the authenticator— as well as § 13 Security Considerations and § 14 Privacy Considerations, are understood by all audiences.
1.2. Use Cases
The below use case scenarios illustrate use of two very different types of authenticators, as well as outline further scenarios. Additional scenarios, including sample code, are given later in § 1.3 Sample API Usage Scenarios.
1.2.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 register this device with 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.2. Authentication
-
On a laptop or desktop:
-
User pairs their phone with the laptop or desktop via Bluetooth.
-
User navigates to example.com in a browser and initiates signing in.
-
User gets a message from the browser, "Please complete this action on your 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.3. New Device Registration
This use case scenario illustrates how a Relying Party can leverage a combination of a roaming authenticator (e.g., a USB security key fob) and a platform authenticator (e.g., a built-in fingerprint sensor) such that the user has:
-
a "primary" roaming authenticator that they use to authenticate on new-to-them client devices (e.g., laptops, desktops) or on such client devices that lack a platform authenticator, and
-
a low-friction means to strongly re-authenticate on client devices having platform authenticators.
Note: This approach of registering multiple authenticators for an account is also useful in account recovery use cases.
-
First, on a desktop computer (lacking a platform authenticator):
-
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. -
User navigates to account security settings and selects "Register security key".
-
Website prompts the user to plug in a USB security key fob; the user does.
-
The USB security key blinks to indicate the user should press the button on it; the user does.
-
Website shows message, "Registration complete."
Note: Since this computer lacks a platform authenticator, the website may require the user to present their USB security key from time to time or each time the user interacts with the website. This is at the website’s discretion.
-
-
Later, on their laptop (which features a platform authenticator):
-
User navigates to example.com in a browser and initiates signing in.
-
Website prompts the user to plug in their USB security key.
-
User plugs in the previously registered USB security key and presses the button.
-
Website shows that the user is signed in, and navigates to the signed-in page.
-
Website prompts, "Do you want to register this computer with example.com?"
-
User agrees.
-
Laptop prompts the user for a previously configured authorization gesture (PIN, biometric, etc.); the user provides this.
-
Website shows message, "Registration complete."
-
User signs out.
-
-
Later, again on their laptop:
-
User navigates to example.com in a browser and initiates signing in.
-
Website shows message, "Please follow your computer’s prompts to complete sign in."
-
Laptop prompts the user for an authorization gesture (PIN, biometric, etc.); the user provides this.
-
Website shows that the user is signed in, and navigates to the signed-in page.
-
1.2.4. 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 "fob" with USB or USB+NFC/BLE 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 fob.
-
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 first-factor 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.
1.3.1. Registration
This is the first-time flow, in which a new credential is created and registered with the server. In this flow, the WebAuthn Relying Party does not have a preference for platform authenticator or roaming authenticators.
-
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:
if ( ! window. PublicKeyCredential) { /* Client not capable. Handle error. */ } var publicKey= { // The challenge is produced by the server; see the Security Considerations challenge: new Uint8Array([ 21 , 31 , 105 /* 29 more random bytes generated by the server */ ]), // Relying Party: rp: { name: "ACME Corporation" }, // User: user: { id: Uint8Array. from( window. atob( "MIIBkzCCATigAwIBAjCCAZMwggE4oAMCAQIwggGTMII=" ), c=> c. charCodeAt( 0 )), name: "alex.mueller@example.com" , displayName: "Alex Müller" , }, // This Relying Party will accept either an ES256 or RS256 credential, but // prefers an ES256 credential. pubKeyCredParams: [ { type: "public-key" , alg: - 7 // "ES256" as registered in the IANA COSE Algorithms registry }, { type: "public-key" , alg: - 257 // Value registered by this specification for "RS256" } ], authenticatorSelection: { // Try to use UV if possible. This is also the default. userVerification: "preferred" }, timeout: 360000 , // 6 minutes excludeCredentials: [ // Don’t re-register any authenticator that has one of these credentials { "id" : Uint8Array. from( window. atob( "ufJWp8YGlibm1Kd9XQBWN1WAw2jy5In2Xhon9HAqcXE=" ), c=> c. charCodeAt( 0 )), "type" : "public-key" }, { "id" : Uint8Array. from( window. atob( "E/e1dhZc++mIsz4f9hb6NifAzJpF1V4mEtRlIPBiWdY=" ), c=> c. charCodeAt( 0 )), "type" : "public-key" } ], // Make excludeCredentials check backwards compatible with credentials registered with U2F extensions: { "appidExclude" : "https://acme.example.com" } }; // Note: The following call will cause the authenticator to display UI. navigator. credentials. create({ publicKey}) . then( function ( newCredentialInfo) { // Send new credential info to server for verification and registration. }). catch ( function ( err) { // No acceptable authenticator or user refused consent. Handle appropriately. });
1.3.2. Registration Specifically with User-Verifying Platform Authenticator
This is an example flow for when the WebAuthn Relying Party is specifically interested in creating a public key credential with a user-verifying platform authenticator.
-
The user visits example.com and clicks on the login button, which redirects the user to login.example.com.
-
The user enters a username and password to log in. After successful login, the user is redirected back to example.com.
-
The Relying Party script runs the code snippet below.
-
The user agent checks if a user-verifying platform authenticator is available. If not, terminate this flow.
-
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.
-
if ( ! window. PublicKeyCredential) { /* Client not capable of the API. Handle error. */ } PublicKeyCredential. isUserVerifyingPlatformAuthenticatorAvailable() . then( function ( uvpaAvailable) { // If there is a user-verifying platform authenticator if ( uvpaAvailable) { // Render some RP-specific UI and get a Promise for a Boolean value return askIfUserWantsToCreateCredential(); } }). then( function ( userSaidYes) { // If there is a user-verifying platform authenticator // AND the user wants to create a credential if ( userSaidYes) { var publicKeyOptions= { /* Public key credential creation options. */ }; return navigator. credentials. create({ "publicKey" : publicKeyOptions}); } }). then( function ( newCredentialInfo) { if ( newCredentialInfo) { // Send new credential info to server for verification and registration. } }). catch ( function ( err) { // Something went wrong. Handle appropriately. });
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 obtains a biometric or other authorization gesture from the user.
-
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:
if ( ! window. PublicKeyCredential) { /* Client not capable. Handle error. */ } // credentialId is generated by the authenticator and is an opaque random byte array var credentialId= new Uint8Array([ 183 , 148 , 245 /* more random bytes previously generated by the authenticator */ ]); var options= { // The challenge is produced by the server; see the Security Considerations challenge: new Uint8Array([ 4 , 101 , 15 /* 29 more random bytes generated by the server */ ]), timeout: 120000 , // 2 minutes allowCredentials: [{ type: "public-key" , id: credentialId}] }; navigator. credentials. get({ "publicKey" : options}) . then( function ( assertion) { // Send assertion to server for verification }). catch ( function ( err) { // No acceptable credential or user refused consent. Handle appropriately. });
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.
if ( ! window. PublicKeyCredential) { /* Client not capable. Handle error. */ } var encoder= new TextEncoder(); var acceptableCredential1= { type: "public-key" , id: encoder. encode( "BA44712732CE" ) }; var acceptableCredential2= { type: "public-key" , id: encoder. encode( "BG35122345NF" ) }; var options= { // The challenge is produced by the server; see the Security Considerations challenge: new Uint8Array([ 8 , 18 , 33 /* 29 more random bytes generated by the server */ ]), timeout: 120000 , // 2 minutes allowCredentials: [ acceptableCredential1, acceptableCredential2], extensions: { 'credProps' : true } }; navigator. credentials. get({ "publicKey" : options}) . then( function ( assertion) { // Send assertion to server for verification }). catch ( function ( err) { // No acceptable credential or user refused consent. Handle appropriately. });
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.
const authAbortController= new AbortController(); const authAbortSignal= authAbortController. signal; authAbortSignal. onabort= function () { // Once the page knows the abort started, inform user it is attempting to abort. } var options= { // A list of options. } navigator. credentials. create({ publicKey: options, signal: authAbortSignal}) . then( function ( attestation) { // Register the user. }). catch ( function ( error) { if ( error== "AbortError" ) { // Inform user the credential hasn’t been created. // Let the server know a key hasn’t been created. } }); // Assume widget shows up whenever authentication occurs. if ( widget== "disappear" ) { authAbortController. abort(); }
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 DOMString
s, for
example in transports
.
2.2. Authenticators
A WebAuthn Authenticator MUST provide the operations defined by § 6 WebAuthn Authenticator Model, and those operations MUST behave as described there. This is a set of functional and security requirements for an authenticator to be usable by a Conforming User Agent.
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.
2.2.1. Backwards Compatibility with FIDO U2F
Authenticators that only support the § 8.6 FIDO U2F Attestation Statement Format have no mechanism to store a user handle, so the returned userHandle
will always be null.
2.3. WebAuthn Relying Parties
A WebAuthn Relying Party MUST behave as described in § 7 WebAuthn Relying Party Operations to obtain all the security benefits offered by this specification. See § 13.4.1 Security Benefits for WebAuthn Relying Parties for further discussion of this.
2.4. All Conformance Classes
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) [RFC8152]. The IANA COSE Algorithms registry [IANA-COSE-ALGS-REG] established by this specification is also used.
- Credential Management
-
The API described in this document is an extension of the
Credential
concept defined in [CREDENTIAL-MANAGEMENT-1]. - DOM
-
DOMException
and the DOMException values used in this specification are defined in [DOM4]. - ECMAScript
-
%ArrayBuffer% is defined in [ECMAScript].
- HTML
-
The concepts of browsing context, origin, opaque origin, tuple origin, relevant settings object, and is a registrable domain suffix of or is equal to are defined in [HTML].
- URL
- Web IDL
-
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
Promise
s, which are now the preferred mechanism for asynchronous interaction in all new web APIs. - FIDO AppID
-
The algorithms for determining the FacetID of a calling application and determining if a caller’s FacetID is authorized for an AppID (used only in the AppID extension) are defined by [FIDO-APPID].
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].
4. Terminology
- Attestation
-
Generally, attestation is a statement serving to bear witness, confirm, or authenticate. In the WebAuthn context, attestation is employed to attest to the provenance of an authenticator and the data it emits; including, for example: credential IDs, credential key pairs, signature counters, etc. An attestation statement is conveyed in an attestation object during registration. See also § 6.5 Attestation and Figure 6. Whether or how the client conveys the attestation statement and AAGUID portions of the attestation object to the Relying Party is described by attestation conveyance.
- Attestation Certificate
-
A X.509 Certificate for the attestation key pair used by an authenticator to attest to its manufacture and capabilities. At registration time, the authenticator uses the attestation private key to sign the Relying Party-specific credential public key (and additional data) that it generates and returns via the authenticatorMakeCredential operation. Relying Parties use the attestation public key conveyed in the attestation certificate to verify the attestation signature. Note that in the case of self attestation, the authenticator has no distinct attestation key pair nor attestation certificate, see self attestation for details.
- Authentication
- Authentication Ceremony
-
The ceremony where a user, and the user’s client (containing at least one authenticator) work in concert to cryptographically prove to a Relying Party that the user controls the credential private key of a previously-registered public key credential (see Registration). Note that this includes a test of user presence or user verification.
The WebAuthn authentication ceremony is defined in § 7.2 Verifying an Authentication Assertion, and is initiated by the Relying Party calling
with anavigator.credentials.get()
publicKey
argument. See § 5 Web Authentication API for an introductory overview and § 1.3.3 Authentication for implementation examples. - Authentication Assertion
- Assertion
-
The cryptographically signed
AuthenticatorAssertionResponse
object returned by an authenticator as the result of an authenticatorGetAssertion operation.This corresponds to the [CREDENTIAL-MANAGEMENT-1] specification’s single-use credentials.
- Authenticator
- WebAuthn Authenticator
-
A cryptographic entity, existing in hardware or software, that can register a user with a given Relying Party and later assert possession of the registered public key credential, and optionally verify the user, when requested by the Relying Party. Authenticators can report information regarding their type and security characteristics via attestation during registration.
A WebAuthn Authenticator could be a roaming authenticator, a dedicated hardware subsystem integrated into the client device, or a software component of the client or client device.
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.
- Authorization Gesture
-
An authorization gesture is a physical interaction performed by a user with an authenticator as part of a ceremony, such as registration or authentication. By making such an authorization gesture, a user provides consent for (i.e., authorizes) a ceremony to proceed. This MAY involve user verification if the employed authenticator is capable, or it MAY involve a simple test of user presence.
- Biometric Recognition
-
The automated recognition of individuals based on their biological and behavioral characteristics [ISOBiometricVocabulary].
- Biometric Authenticator
-
Any authenticator that implements biometric recognition.
- Bound credential
-
A public key credential source or public key credential is said to be bound to its managing authenticator. This means that only the managing authenticator can generate assertions for the public key credential sources bound to it.
- Ceremony
-
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.
- Client
- WebAuthn Client
-
Also referred to herein as simply a client. See also Conforming User Agent. A WebAuthn Client is an intermediary entity typically implemented in the user agent (in whole, or in part). Conceptually, it underlies the Web Authentication API and embodies the implementation of the
[[Create]](origin, options, sameOriginWithAncestors)
and[[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
internal methods. It is responsible for both marshalling the inputs for the underlying authenticator operations, and for returning the results of the latter operations to the Web Authentication API's callers.The WebAuthn Client runs on, and is distinct from, a WebAuthn Client Device.
- Client Device
- WebAuthn Client Device
-
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.
The distinctions between a WebAuthn Client device and a client are:
-
a single client device MAY support running multiple clients, i.e., browser implementations, which all have access to the same authenticators available on that client device, and
-
platform authenticators are bound to a client device rather than a WebAuthn Client.
A client device and a client together constitute a client platform.
-
- Client Platform
-
A client device and a client together make up a client platform. A single hardware device MAY be part of multiple distinct client platforms at different times by running different operating systems and/or clients.
- Client-Side
-
This refers in general to the combination of the user’s client platform, authenticators, and everything gluing it all together.
- Client-side discoverable Public Key Credential Source
- Client-side discoverable Credential
- Discoverable Credential
- [DEPRECATED] Resident Credential
- [DEPRECATED] Resident Key
- Client-side discoverable Credential
-
Note: Historically, client-side discoverable credentials have been known as resident credentials or resident keys. Due to the phrases
ResidentKey
andresidentKey
being widely used in both the WebAuthn API and also in the Authenticator Model (e.g., in dictionary member names, algorithm variable names, and operation parameters) the usage ofresident
within their names has not been changed for backwards compatibility purposes. Also, the term resident key is defined here as equivalent to a client-side discoverable credential.A Client-side discoverable Public Key Credential Source, or Discoverable Credential for short, is a public key credential source that is discoverable and usable in authentication ceremonies where the Relying Party does not provide any credential IDs, i.e., the Relying Party invokes
navigator.credentials.get()
with an emptyallowCredentials
argument. This means that the Relying Party does not necessarily need to first identify the user.As a consequence, a discoverable credential capable authenticator can generate an assertion signature for a discoverable credential given only an RP ID, which in turn necessitates that the public key credential source is stored in the authenticator or client platform. This is in contrast to a Server-side Public Key Credential Source, which requires that the authenticator is given both the RP ID and the credential ID but does not require client-side storage of the public key credential source.
See also: client-side credential storage modality and non-discoverable credential.
Note: Client-side discoverable credentials are also usable in authentication ceremonies where credential IDs are given, i.e., when calling
navigator.credentials.get()
with a non-emptyallowCredentials
argument. - Conforming User Agent
-
A user agent implementing, in cooperation with the underlying client device, the Web Authentication API and algorithms given in this specification, and handling communication between authenticators and Relying Parties.
- Credential ID
-
A probabilistically-unique byte sequence identifying a public key credential source and its authentication assertions.
Credential IDs are generated by authenticators in two forms:
-
At least 16 bytes that include at least 100 bits of entropy, or
-
The public key credential source, without its Credential ID or mutable items, encrypted so only its managing authenticator can decrypt it. This form allows the authenticator to be nearly stateless, by having the Relying Party store any necessary state.
Note: [FIDO-UAF-AUTHNR-CMDS] includes guidance on encryption techniques under "Security Guidelines".
Relying Parties do not need to distinguish these two Credential ID forms.
-
- Credential Key Pair
- Credential Private Key
- Credential Public Key
- User Public Key
- Credential Private Key
-
A credential key pair is a pair of asymmetric cryptographic keys generated by an authenticator and scoped to a specific WebAuthn Relying Party. It is the central part of a public key credential.
A credential public key is the public key portion of a credential key pair. The credential public key is returned to the Relying Party during a registration ceremony.
A credential private key is the private key portion of a credential key pair. The credential private key is bound to a particular authenticator - its managing authenticator - and is expected to never be exposed to any other party, not even to the owner of the authenticator.
Note that in the case of self attestation, the credential key pair is also used as the attestation key pair, see self attestation for details.
Note: The credential public key is referred to as the user public key in FIDO UAF [UAFProtocol], and in FIDO U2F [FIDO-U2F-Message-Formats] and some parts of this specification that relate to it.
- Credential Properties
-
A credential property is some characteristic property of a public key credential source, such as whether it is a client-side discoverable credential or a server-side credential.
- Human Palatability
-
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].
- Non-Discoverable Credential
-
This is a credential whose credential ID must be provided in
allowCredentials
when callingnavigator.credentials.get()
because it is not client-side discoverable. See also server-side credentials. - Public Key Credential Source
-
A credential source ([CREDENTIAL-MANAGEMENT-1]) used by an authenticator to generate authentication assertions. A public key credential source consists of a struct with the following items:
- type
-
whose value is of
PublicKeyCredentialType
, defaulting topublic-key
. - id
- privateKey
- rpId
-
The Relying Party Identifier, for the Relying Party this public key credential source is scoped to.
- userHandle
-
The user handle associated when this public key credential source was created. This item is nullable.
- otherUI
-
OPTIONAL other information used by the authenticator to inform its UI. For example, this might include the user’s
displayName
. otherUI is a mutable item and SHOULD NOT be bound to the public key credential source in a way that prevents otherUI from being updated.
The authenticatorMakeCredential operation creates a public key credential source bound to a managing authenticator and returns the credential public key associated with its credential private key. The Relying Party can use this credential public key to verify the authentication assertions created by this public key credential source.
- Public Key Credential
-
Generically, a credential is data one entity presents to another in order to authenticate the former to the latter [RFC4949]. The term public key credential refers to one of: a public key credential source, the possibly-attested credential public key corresponding to a public key credential source, or an authentication assertion. Which one is generally determined by context.
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)
- "Signed value"
- [RFC4949] "credential"
At registration time, the authenticator creates an asymmetric key pair, and stores its private key portion and information from the Relying Party into a public key credential source. The public key portion is returned to the Relying Party, who then stores it in conjunction with the present user’s account. Subsequently, only that Relying Party, as identified by its RP ID, is able to employ the public key credential in authentication ceremonies, via the
get()
method. The Relying Party uses its stored copy of the credential public key to verify the resultant authentication assertion. - Rate Limiting
-
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.
- Registration
- Registration Ceremony
-
The ceremony where a user, a Relying Party, and the user’s client (containing at least one authenticator) work in concert to create a public key credential and associate it with the user’s Relying Party account. Note that this includes employing a test of user presence or user verification. After a successful registration ceremony, the user can be authenticated by an authentication ceremony.
The WebAuthn registration ceremony is defined in § 7.1 Registering a New Credential, and is initiated by the Relying Party calling
with anavigator.credentials.create()
publicKey
argument. See § 5 Web Authentication API for an introductory overview and § 1.3.1 Registration for implementation examples. - Relying Party
- Relying Party Identifier
- RP ID
-
In the context of the WebAuthn API, a relying party identifier is a valid domain string identifying the WebAuthn Relying Party on whose behalf a given registration or authentication ceremony is being performed. A public key credential can only be used for authentication with the same entity (as identified by RP ID) it was registered with.
By default, the RP ID for a WebAuthn operation is set to the caller’s origin's effective domain. This default MAY be overridden by the caller, as long as the caller-specified RP ID value is a registrable domain suffix of or is equal to the caller’s origin's effective domain. See also § 5.1.3 Create a New Credential - PublicKeyCredential’s [[Create]](origin, options, sameOriginWithAncestors) Method and § 5.1.4 Use an Existing Credential to Make an Assertion - PublicKeyCredential’s [[Get]](options) Method.
Note: 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:-
The RP ID must be equal to the origin's effective domain, or a registrable domain suffix of the origin's effective domain.
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) andexample.com
, but notm.login.example.com
and notcom
.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.
These restrictions on origin values apply to WebAuthn Clients.
Other specifications mimicking the WebAuthn API to enable WebAuthn public key credentials on non-Web platforms (e.g. native mobile applications), MAY define different rules for binding a caller to a Relying Party Identifier. Though, the RP ID syntaxes MUST conform to either valid domain strings or URIs [RFC3986] [URL].
-
- Server-side Public Key Credential Source
- Server-side Credential
- [DEPRECATED] Non-Resident Credential
- Server-side Credential
-
Note: Historically, server-side credentials have been known as non-resident credentials. For backwards compatibility purposes, the various WebAuthn API and Authenticator Model components with various forms of
resident
within their names have not been changed.A Server-side Public Key Credential Source, or Server-side Credential for short, is a public key credential source that is only usable in an authentication ceremony when the Relying Party supplies its credential ID in
navigator.credentials.get()
'sallowCredentials
argument. This means that the Relying Party must manage the credential’s storage and discovery, as well as be able to first identify the user in order to discover the credential IDs to supply in thenavigator.credentials.get()
call.Client-side storage of the public key credential source is not required for a server-side credential. This is in contrast to a client-side discoverable credential, which instead does not require the user to first be identified in order to provide the user’s credential IDs to a
navigator.credentials.get()
call.See also: server-side credential storage modality and non-discoverable credential.
- Test of User Presence
-
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
-
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.
- User Handle
-
The user handle is specified by a Relying Party, as the value of
, and used to map a specific public key credential to a specific user account with the Relying Party. Authenticators in turn map RP IDs and user handle pairs to public key credential sources.user
.id
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.
- User Verification
-
The technical process by which an authenticator locally authorizes the invocation of the authenticatorMakeCredential and authenticatorGetAssertion operations. User verification MAY be instigated through various authorization gesture modalities; for example, through a touch plus pin code, password entry, or biometric recognition (e.g., presenting a fingerprint) [ISOBiometricVocabulary]. The intent is to distinguish individual users.
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 Relying Party account(s) using that device.
Note: Invocation of the authenticatorMakeCredential and authenticatorGetAssertion operations implies use of key material managed by the authenticator.Also, for security, user verification and use of credential private keys must all occur within the logical security boundary defining the authenticator.
User verification procedures MAY implement rate limiting as a protection against brute force attacks.
- User Present
- UP
-
Upon successful completion of a user presence test, the user is said to be "present".
- User Verified
- UV
-
Upon successful completion of a user verification process, the user is said to be "verified".
- WebAuthn Relying Party
-
The entity whose web application utilizes the Web Authentication API to register and authenticate users.
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.
5. Web Authentication API
This section normatively specifies the API for creating and using public key credentials. The basic idea is that the credentials belong to the user and are managed by a WebAuthn Authenticator, with which the WebAuthn Relying Party interacts through the client platform. Relying Party scripts can (with the user’s consent) request the browser to create a new credential for future use by the Relying Party. See Figure , below.
Scripts can also request the user’s permission to perform authentication operations with an existing credential. See Figure , below.
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.
Additionally, to maintain user privacy and prevent malicious Relying Parties from probing for the presence of public key credentials belonging to other Relying Parties, each credential is also scoped to a Relying Party Identifier, or RP ID. This RP ID is provided by the client to the authenticator for all operations, and the authenticator ensures that credentials created by a Relying Party can only be used in operations requested by the same RP ID. Separating the origin from the RP ID in this way allows the API to be used in cases where a single Relying Party maintains multiple origins.
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.
5.1. PublicKeyCredential
Interface
In all current engines.
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNone
The PublicKeyCredential
interface inherits from Credential
[CREDENTIAL-MANAGEMENT-1], and contains the attributes
that are returned to the caller when a new credential is created, or a new assertion is requested.
PublicKeyCredential/getClientExtensionResults
In all current engines.
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNone
In all current engines.
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNone
[SecureContext ,Exposed =Window ]interface PublicKeyCredential :Credential { [SameObject ]readonly attribute ArrayBuffer ; [
rawId SameObject ]readonly attribute AuthenticatorResponse response ;AuthenticationExtensionsClientOutputs (); };
getClientExtensionResults
id
-
This attribute is inherited from
Credential
, thoughPublicKeyCredential
overridesCredential
's getter, instead returning the base64url encoding of the data contained in the object’s[[identifier]]
internal slot. rawId
-
This attribute returns the
ArrayBuffer
contained in the[[identifier]]
internal slot. -
In all current engines.
Firefox60+Safari13+Chrome67+
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNoneresponse
, of type AuthenticatorResponse, readonly -
This attribute contains the authenticator's response to the client’s request to either create a public key credential, or generate an authentication assertion. If the
PublicKeyCredential
is created in response tocreate()
, this attribute’s value will be anAuthenticatorAttestationResponse
, otherwise, thePublicKeyCredential
was created in response toget()
, and this attribute’s value will be anAuthenticatorAssertionResponse
. getClientExtensionResults()
-
This operation returns the value of
[[clientExtensionsResults]]
, which is a map containing extension identifier → client extension output entries produced by the extension’s client extension processing. [[type]]
-
The
PublicKeyCredential
interface object's[[type]]
internal slot's value is the string "public-key
".Note: This is reflected via the
type
attribute getter inherited fromCredential
. [[discovery]]
-
The
PublicKeyCredential
interface object's[[discovery]]
internal slot's value is "remote
". [[identifier]]
-
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.
Note: This API does not constrain the format or length of this identifier, except that it 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.
[[clientExtensionsResults]]
-
This internal slot contains the results of processing client extensions requested by the Relying Party upon the Relying Party's invocation of either
navigator.credentials.create()
ornavigator.credentials.get()
.
PublicKeyCredential
's interface object inherits Credential
's implementation of [[CollectFromCredentialStore]](origin, options, sameOriginWithAncestors)
, and defines its own
implementation of [[Create]](origin, options, sameOriginWithAncestors)
, [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
, and [[Store]](credential, sameOriginWithAncestors)
.
5.1.1. CredentialCreationOptions
Dictionary Extension
To support registration via navigator.credentials.create()
, this document extends
the CredentialCreationOptions
dictionary as follows:
partial dictionary CredentialCreationOptions {PublicKeyCredentialCreationOptions ; };
publicKey
5.1.2. CredentialRequestOptions
Dictionary Extension
To support obtaining assertions via navigator.credentials.get()
, this document extends the CredentialRequestOptions
dictionary as follows:
partial dictionary CredentialRequestOptions {PublicKeyCredentialRequestOptions ; };
publicKey
5.1.3. Create a New Credential - PublicKeyCredential’s [[Create]](origin, options, sameOriginWithAncestors)
Method
PublicKeyCredential
's interface object's implementation of the [[Create]](origin,
options, sameOriginWithAncestors)
internal method [CREDENTIAL-MANAGEMENT-1] allows WebAuthn Relying Party scripts to call navigator.credentials.create()
to request the creation of a new public key credential source, bound to an authenticator. This navigator.credentials.create()
operation can be aborted by leveraging the AbortController
;
see DOM §3.3 Using AbortController and AbortSignal objects in APIs for detailed instructions.
This internal method accepts three arguments:
origin
-
This argument is the relevant settings object's origin, as determined by the calling
create()
implementation. options
-
This argument is a
CredentialCreationOptions
object whoseoptions.
member contains apublicKey
PublicKeyCredentialCreationOptions
object specifying the desired attributes of the to-be-created public key credential. sameOriginWithAncestors
-
This argument is a Boolean value which is
true
if and only if the caller’s environment settings object is same-origin with its ancestors. It isfalse
if caller is cross-origin.Note: Invocation of this internal method indicates that it was allowed by permissions policy, which is evaluated at the [CREDENTIAL-MANAGEMENT-1] level. See § 5.9 Permissions Policy integration.
Note: This algorithm is synchronous: the Promise
resolution/rejection is handled by navigator.credentials.create()
.
Note: All BufferSource
objects used in this algorithm must be snapshotted when the algorithm begins, to
avoid potential synchronization issues. The algorithm 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:
-
Assert:
options.
is present.publicKey
-
If sameOriginWithAncestors is
false
, return a "NotAllowedError
"DOMException
.Note: This "sameOriginWithAncestors" restriction aims to address a tracking concern raised in Issue #1336. This may be revised in future versions of this specification.
-
Let options be the value of
options.
.publicKey
-
If the
timeout
member of options 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 thetimeout
member of options is not present, then set lifetimeTimer to a client-specific default.Recommended ranges and defaults for the
timeout
member of options are as follows. Ifoptions.
authenticatorSelection
.userVerification
- is set to
discouraged
-
Recommended range: 30000 milliseconds to 180000 milliseconds.
Recommended default value: 120000 milliseconds (2 minutes).
- is set to
required
orpreferred
-
Recommended range: 30000 milliseconds to 600000 milliseconds.
Recommended default value: 300000 milliseconds (5 minutes).
Note: The user agent should take cognitive guidelines into considerations regarding timeout for users with special needs.
- is set to
-
If the length of
options.
is not between 1 and 64 bytes (inclusive) then return auser
.id
TypeError
. -
Let callerOrigin be
origin
. If callerOrigin is an opaque origin, return aDOMException
whose name is "NotAllowedError
", and terminate this algorithm. -
Let effectiveDomain be the callerOrigin’s effective domain. If effective domain is not a valid domain, then return a
DOMException
whose name is "SecurityError
" and terminate this algorithm.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.
-
- is present
-
If
options.
is not a registrable domain suffix of and is not equal to effectiveDomain, return arp
.id
DOMException
whose name is "SecurityError
", and terminate this algorithm. - Is not present
Note:
options.
represents the caller’s RP ID. The RP ID defaults to being the caller’s origin's effective domain unless the caller has explicitly setrp
.id
options.
when callingrp
.id
create()
. -
Let credTypesAndPubKeyAlgs be a new list whose items are pairs of
PublicKeyCredentialType
and aCOSEAlgorithmIdentifier
. -
If
options.
’s sizepubKeyCredParams
- is zero
-
Append the following pairs of
PublicKeyCredentialType
andCOSEAlgorithmIdentifier
values to credTypesAndPubKeyAlgs:-
public-key
and-7
("ES256"). -
public-key
and-257
("RS256").
-
- is non-zero
-
For each current of
options.
:pubKeyCredParams
-
If
current.
does not contain atype
PublicKeyCredentialType
supported by this implementation, then continue. -
Let alg be
current.
.alg
-
Append the pair of
current.
and alg to credTypesAndPubKeyAlgs.type
If credTypesAndPubKeyAlgs is empty, return a
DOMException
whose name is "NotSupportedError
", and terminate this algorithm. -
-
Let clientExtensions be a new map and let authenticatorExtensions be a new map.
-
If the
extensions
member of options is present, then for each extensionId → clientExtensionInput ofoptions.
:extensions
-
If extensionId is not supported by this client platform or is not a registration extension, then continue.
-
Set clientExtensions[extensionId] to clientExtensionInput.
-
If extensionId is not an authenticator extension, then continue.
-
Let authenticatorExtensionInput be the (CBOR) result of running extensionId’s client extension processing algorithm on clientExtensionInput. If the algorithm returned an error, continue.
-
Set authenticatorExtensions[extensionId] to the base64url encoding of authenticatorExtensionInput.
-
-
Let collectedClientData be a new
CollectedClientData
instance whose fields are:type
-
The string "webauthn.create".
challenge
-
The base64url encoding of options.
challenge
. origin
-
The serialization of callerOrigin.
crossOrigin
-
The inverse of the value of the
sameOriginWithAncestors
argument passed to this internal method. tokenBinding
-
The status of Token Binding between the client and the callerOrigin, as well as the Token Binding ID associated with callerOrigin, if one is available.
-
Let clientDataJSON be the JSON-compatible serialization of client data constructed from collectedClientData.
-
Let clientDataHash be the hash of the serialized client data represented by clientDataJSON.
-
If the
options.
is present and its aborted flag is set tosignal
true
, return aDOMException
whose name is "AbortError
" and terminate this algorithm. -
Let issuedRequests be a new ordered set.
-
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.
-
Start lifetimeTimer.
-
While lifetimeTimer has not expired, perform the following actions depending upon lifetimeTimer, and the state and response for each authenticator in authenticators:
- If lifetimeTimer expires,
-
For each authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove authenticator from issuedRequests.
- If the user exercises a user agent user-interface option to cancel the process,
-
For each authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove authenticator from issuedRequests. Return a
DOMException
whose name is "NotAllowedError
". - If the
options.
is present and its aborted flag is set tosignal
true
, -
For each authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove authenticator from issuedRequests. Then return a
DOMException
whose name is "AbortError
" and terminate this algorithm. - If an authenticator becomes available on this client device,
-
Note: This includes the case where an authenticator was available upon lifetimeTimer initiation.
-
This authenticator is now the candidate authenticator.
-
If
options.
is present:authenticatorSelection
-
If
options.
is present and its value is not equal to authenticator’s authenticator attachment modality, continue.authenticatorSelection
.authenticatorAttachment
-
If
options.
authenticatorSelection
.residentKey
- is present and set to
required
-
If the authenticator is not capable of storing a client-side discoverable public key credential source, continue.
- is present and set to
preferred
ordiscouraged
-
No effect.
- is not present
-
if
options.
is set toauthenticatorSelection
.requireResidentKey
true
and the authenticator is not capable of storing a client-side discoverable public key credential source, continue.
- is present and set to
-
If
options.
is set toauthenticatorSelection
.userVerification
required
and the authenticator is not capable of performing user verification, continue.
-
-
Let requireResidentKey be the effective resident key requirement for credential creation, a Boolean value, as follows:
If
options.
authenticatorSelection
.residentKey
- is present and set to
required
-
Let requireResidentKey be
true
. - is present and set to
preferred
-
If the authenticator
- is capable of client-side credential storage modality
-
Let requireResidentKey be
true
. - is not capable of client-side credential storage modality, or if the client cannot determine authenticator capability,
-
Let requireResidentKey be
false
.
- is present and set to
discouraged
-
Let requireResidentKey be
false
. - is not present
-
Let requireResidentKey be the value of
options.
.authenticatorSelection
.requireResidentKey
- is present and set to
-
Let userVerification be the effective user verification requirement for credential creation, a Boolean value, as follows. If
options.
authenticatorSelection
.userVerification
- is set to
required
-
Let userVerification be
true
. - is set to
preferred
-
If the authenticator
- is capable of user verification
-
Let userVerification be
true
. - is not capable of user verification
-
Let userVerification be
false
.
- is set to
discouraged
-
Let userVerification be
false
.
- is set to
-
Let enterpriseAttestationPossible be a Boolean value, as follows. If
options.
attestation
- is set to
enterprise
-
Let enterpriseAttestationPossible be
true
if the user agent wishes to support enterprise attestation foroptions.
(see Step 8, above). Otherwiserp
.id
false
. - otherwise
-
Let enterpriseAttestationPossible be
false
.
- is set to
-
Let excludeCredentialDescriptorList be a new list.
-
For each credential descriptor C in
options.
:excludeCredentials
-
If
C.
is not empty, and authenticator is connected over a transport not mentioned intransports
C.
, the client MAY continue.transports
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.
are not accurate. For example, stored transport hints could become inaccurate as a result of software upgrades adding new connectivity options.transports
-
Otherwise, Append C to excludeCredentialDescriptorList.
-
Invoke the authenticatorMakeCredential operation on authenticator with clientDataHash,
options.
,rp
options.
, requireResidentKey, userVerification, credTypesAndPubKeyAlgs, excludeCredentialDescriptorList, enterpriseAttestationPossible, and authenticatorExtensions as parameters.user
-
-
Append authenticator to issuedRequests.
-
- If an authenticator ceases to be available on this client device,
-
Remove authenticator from issuedRequests.
- If any authenticator returns a status indicating that the user cancelled the operation,
-
-
Remove authenticator from issuedRequests.
-
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
", -
-
Remove authenticator from issuedRequests.
-
For each remaining authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove it from issuedRequests.
-
Return a
DOMException
whose name is "InvalidStateError
" and terminate this algorithm.
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
", -
Remove authenticator from issuedRequests.
Note: This case does not imply user consent for the operation, so details about the error are hidden from the Relying Party in order to prevent leak of potentially identifying information. See § 14.5.1 Registration Ceremony Privacy for details.
- If any authenticator indicates success,
-
-
Remove authenticator from issuedRequests. This authenticator is now the selected authenticator.
-
Let credentialCreationData be a struct whose items are:
attestationObjectResult
-
whose value is the bytes returned from the successful authenticatorMakeCredential operation.
Note: this value is
attObj
, as defined in § 6.5.4 Generating an Attestation Object. clientDataJSONResult
-
whose value is the bytes of clientDataJSON.
attestationConveyancePreferenceOption
-
whose value is the value of options.
attestation
. clientExtensionResults
-
whose value is an
AuthenticationExtensionsClientOutputs
object containing extension identifier → client extension output entries. The entries are created by running each extension’s client extension processing algorithm to create the client extension outputs, for each client extension inoptions.
.extensions
-
Let constructCredentialAlg be an algorithm that takes a global object global, and whose steps are:
-
If
credentialCreationData.attestationConveyancePreferenceOption
’s value is- "none"
-
Replace potentially uniquely identifying information with non-identifying versions of the same:
-
If the AAGUID in the attested credential data is 16 zero bytes,
credentialCreationData.attestationObjectResult.fmt
is "packed", and "x5c" is absent fromcredentialCreationData.attestationObjectResult
, then self attestation is being used and no further action is needed. -
Otherwise
-
Replace the AAGUID in the attested credential data with 16 zero bytes.
-
Set the value of
credentialCreationData.attestationObjectResult.fmt
to "none", and set the value ofcredentialCreationData.attestationObjectResult.attStmt
to be an empty CBOR map. (See § 8.7 None Attestation Statement Format and § 6.5.4 Generating an Attestation Object).
-
-
- "indirect"
-
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).
- "direct" or "enterprise"
-
Convey the authenticator's AAGUID and attestation statement, unaltered, to the Relying Party.
-
Let attestationObject be a new
ArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofcredentialCreationData.attestationObjectResult
’s value. -
Let id be
attestationObject.authData.attestedCredentialData.credentialId
. -
Let pubKeyCred be a new
PublicKeyCredential
object associated with global whose fields are:[[identifier]]
-
id
response
-
A new
AuthenticatorAttestationResponse
object associated with global whose fields are:clientDataJSON
-
A new
ArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofcredentialCreationData.clientDataJSONResult
. attestationObject
-
attestationObject
[[transports]]
-
A sequence of zero or more unique
DOMString
s, in lexicographical order, that the authenticator is believed to support. The values SHOULD be members ofAuthenticatorTransport
, 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.
Note: How user agents discover transports supported by a given authenticator is outside the scope of this specification, but may include information from an attestation certificate (for example [FIDO-Transports-Ext]), metadata communicated in an authenticator protocol such as CTAP2, or special-case knowledge about a platform authenticator.
[[clientExtensionsResults]]
-
A new
ArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofcredentialCreationData.clientExtensionResults
.
-
Return pubKeyCred.
-
-
For each remaining authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove it from issuedRequests.
-
Return constructCredentialAlg and terminate this algorithm.
-
-
Return a
DOMException
whose name is "NotAllowedError
". In order to prevent information leak that could identify the user without consent, this step MUST NOT be executed before lifetimeTimer has expired. See § 14.5.1 Registration Ceremony Privacy for details.
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.
5.1.4. Use an Existing Credential to Make an Assertion - PublicKeyCredential’s [[Get]](options)
Method
WebAuthn Relying Parties call navigator.credentials.get({publicKey:..., ...})
to
discover and use an existing public key credential, with the user’s consent. Relying Party script optionally specifies some criteria
to indicate what credential sources are acceptable to it. The client platform locates credential sources matching the specified criteria, and guides the user to pick one that the script will be allowed to use. The user may choose to
decline the entire interaction even if a credential source is present, for example to maintain privacy. If the user picks a credential source, the user agent then uses § 6.3.3 The authenticatorGetAssertion Operation to sign a Relying Party-provided challenge and other collected data into an assertion, which is used as a credential.
The get()
implementation [CREDENTIAL-MANAGEMENT-1] calls PublicKeyCredential.
to collect any credentials that
should be available without user mediation (roughly, this specification’s authorization gesture), and if it does not find
exactly one of those, it then calls [[CollectFromCredentialStore]]()
PublicKeyCredential.
to have
the user select a credential source.[[DiscoverFromExternalSource]]()
Since this specification requires an authorization gesture to create any credentials, the PublicKeyCredential.
internal method inherits the default behavior of [[CollectFromCredentialStore]](origin, options, sameOriginWithAncestors)
Credential.[[CollectFromCredentialStore]]()
, of returning an empty set.
This navigator.credentials.get()
operation can be aborted by leveraging the AbortController
;
see DOM §3.3 Using AbortController and AbortSignal objects in APIs for detailed instructions.
5.1.4.1. PublicKeyCredential’s [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
Method
[[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
This internal method accepts three arguments:
origin
-
This argument is the relevant settings object's origin, as determined by the calling
get()
implementation, i.e.,CredentialsContainer
's Request aCredential
abstract operation. options
-
This argument is a
CredentialRequestOptions
object whoseoptions.
member contains apublicKey
PublicKeyCredentialRequestOptions
object specifying the desired attributes of the public key credential to discover. sameOriginWithAncestors
-
This argument is a Boolean value which is
true
if and only if the caller’s environment settings object is same-origin with its ancestors. It isfalse
if caller is cross-origin.Note: Invocation of this internal method indicates that it was allowed by permissions policy, which is evaluated at the [CREDENTIAL-MANAGEMENT-1] level. See § 5.9 Permissions Policy integration.
Note: This algorithm is synchronous: the Promise
resolution/rejection is handled by navigator.credentials.get()
.
Note: All BufferSource
objects used in this algorithm must be snapshotted when the algorithm begins, to
avoid potential synchronization issues. The algorithm 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:
-
Assert:
options.
is present.publicKey
-
Let options be the value of
options.
.publicKey
-
If the
timeout
member of options 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 thetimeout
member of options is not present, then set lifetimeTimer to a client-specific default.Recommended ranges and defaults for the
timeout
member of options are as follows. Ifoptions.
userVerification
- is set to
discouraged
-
Recommended range: 30000 milliseconds to 180000 milliseconds.
Recommended default value: 120000 milliseconds (2 minutes).
- is set to
required
orpreferred
-
Recommended range: 30000 milliseconds to 600000 milliseconds.
Recommended default value: 300000 milliseconds (5 minutes).
Note: The user agent should take cognitive guidelines into considerations regarding timeout for users with special needs.
- is set to
-
Let callerOrigin be
origin
. If callerOrigin is an opaque origin, return aDOMException
whose name is "NotAllowedError
", and terminate this algorithm. -
Let effectiveDomain be the callerOrigin’s effective domain. If effective domain is not a valid domain, then return a
DOMException
whose name is "SecurityError
" and terminate this algorithm.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.
-
If options.
rpId
is not present, then set rpId to effectiveDomain.Otherwise:
-
If options.
rpId
is not a registrable domain suffix of and is not equal to effectiveDomain, return aDOMException
whose name is "SecurityError
", and terminate this algorithm. -
Set rpId to options.
rpId
.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 options.
rpId
when callingget()
.
-
-
Let clientExtensions be a new map and let authenticatorExtensions be a new map.
-
If the
extensions
member of options is present, then for each extensionId → clientExtensionInput ofoptions.
:extensions
-
If extensionId is not supported by this client platform or is not an authentication extension, then continue.
-
Set clientExtensions[extensionId] to clientExtensionInput.
-
If extensionId is not an authenticator extension, then continue.
-
Let authenticatorExtensionInput be the (CBOR) result of running extensionId’s client extension processing algorithm on clientExtensionInput. If the algorithm returned an error, continue.
-
Set authenticatorExtensions[extensionId] to the base64url encoding of authenticatorExtensionInput.
-
-
Let collectedClientData be a new
CollectedClientData
instance whose fields are:type
-
The string "webauthn.get".
challenge
-
The base64url encoding of options.
challenge
origin
-
The serialization of callerOrigin.
crossOrigin
-
The inverse of the value of the
sameOriginWithAncestors
argument passed to this internal method. tokenBinding
-
The status of Token Binding between the client and the callerOrigin, as well as the Token Binding ID associated with callerOrigin, if one is available.
-
Let clientDataJSON be the JSON-compatible serialization of client data constructed from collectedClientData.
-
Let clientDataHash be the hash of the serialized client data represented by clientDataJSON.
-
If the
options.
is present and its aborted flag is set tosignal
true
, return aDOMException
whose name is "AbortError
" and terminate this algorithm. -
Let issuedRequests be a new ordered set.
-
Let savedCredentialIds be a new map.
-
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.
-
Start lifetimeTimer.
-
While lifetimeTimer has not expired, perform the following actions depending upon lifetimeTimer, and the state and response for each authenticator in authenticators:
- If lifetimeTimer expires,
-
For each authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove authenticator from issuedRequests.
- If the user exercises a user agent user-interface option to cancel the process,
-
For each authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove authenticator from issuedRequests. Return a
DOMException
whose name is "NotAllowedError
". - If the
signal
member is present and the aborted flag is set totrue
, -
For each authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove authenticator from issuedRequests. Then return a
DOMException
whose name is "AbortError
" and terminate this algorithm. - If issuedRequests is empty,
options.
is not empty, and no authenticator will become available for any public key credentials therein,allowCredentials
-
Indicate to the user that no eligible credential could be found. When the user acknowledges the dialog, return a
DOMException
whose name is "NotAllowedError
".Note: One way a client platform can determine that no authenticator will become available is by examining the
members of the presenttransports
items ofPublicKeyCredentialDescriptor
options.
, if any. For example, if allallowCredentials
items list onlyPublicKeyCredentialDescriptor
, but all platform authenticators have been tried, then there is no possibility of satisfying the request. Alternatively, allinternal
items may listPublicKeyCredentialDescriptor
that the client platform does not support.transports
- If an authenticator becomes available on this client device,
-
Note: This includes the case where an authenticator was available upon lifetimeTimer initiation.
-
If
options.
is set touserVerification
required
and the authenticator is not capable of performing user verification, continue. -
Let userVerification be the effective user verification requirement for assertion, a Boolean value, as follows. If
options.
userVerification
- is set to
required
-
Let userVerification be
true
. - is set to
preferred
-
If the authenticator
- is capable of user verification
-
Let userVerification be
true
. - is not capable of user verification
-
Let userVerification be
false
.
- is set to
discouraged
-
Let userVerification be
false
.
- is set to
-
If
options.
allowCredentials
- is not empty
-
-
Let allowCredentialDescriptorList be a new list.
-
Execute a client platform-specific procedure to determine which, if any, public key credentials described by
options.
are bound to this authenticator, by matching with rpId,allowCredentials
options.
, andallowCredentials
.id
options.
. Set allowCredentialDescriptorList to this filtered list.allowCredentials
.type
-
Let distinctTransports be a new ordered set.
-
If allowCredentialDescriptorList has exactly one value, set
savedCredentialIds[authenticator]
toallowCredentialDescriptorList[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.
to distinctTransports.transports
Note: This will aggregate only distinct values of
transports
(for this authenticator) in distinctTransports due to the properties of ordered sets. -
If distinctTransports
- is not empty
-
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.
- is empty
-
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.
-
- is empty
-
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.
-
Append authenticator to issuedRequests.
-
- If an authenticator ceases to be available on this client device,
-
Remove authenticator from issuedRequests.
- If any authenticator returns a status indicating that the user cancelled the operation,
-
-
Remove authenticator from issuedRequests.
-
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,
-
Remove authenticator from issuedRequests.
- If any authenticator indicates success,
-
-
Remove authenticator from issuedRequests.
-
Let assertionCreationData be a struct whose items are:
credentialIdResult
-
If
savedCredentialIds[authenticator]
exists, set the value of credentialIdResult to be the bytes ofsavedCredentialIds[authenticator]
. Otherwise, set the value of credentialIdResult to be the bytes of the credential ID returned from the successful authenticatorGetAssertion operation, as defined in § 6.3.3 The authenticatorGetAssertion Operation. clientDataJSONResult
-
whose value is the bytes of clientDataJSON.
authenticatorDataResult
-
whose value is the bytes of the authenticator data returned by the authenticator.
signatureResult
-
whose value is the bytes of the signature value returned by the authenticator.
userHandleResult
-
If the authenticator returned a user handle, set the value of userHandleResult to be the bytes of the returned user handle. Otherwise, set the value of userHandleResult to null.
clientExtensionResults
-
whose value is an
AuthenticationExtensionsClientOutputs
object containing extension identifier → client extension output entries. The entries are created by running each extension’s client extension processing algorithm to create the client extension outputs, for each client extension inoptions.
.extensions
-
Let constructAssertionAlg be an algorithm that takes a global object global, and whose steps are:
-
Let pubKeyCred be a new
PublicKeyCredential
object associated with global whose fields are:[[identifier]]
-
A new
ArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofassertionCreationData.credentialIdResult
. response
-
A new
AuthenticatorAssertionResponse
object associated with global whose fields are:clientDataJSON
-
A new
ArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofassertionCreationData.clientDataJSONResult
. authenticatorData
-
A new
ArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofassertionCreationData.authenticatorDataResult
. signature
-
A new
ArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofassertionCreationData.signatureResult
. userHandle
-
If
assertionCreationData.userHandleResult
is null, set this field to null. Otherwise, set this field to a newArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofassertionCreationData.userHandleResult
.
[[clientExtensionsResults]]
-
A new
ArrayBuffer
, created using global’s %ArrayBuffer%, containing the bytes ofassertionCreationData.clientExtensionResults
.
-
Return pubKeyCred.
-
-
For each remaining authenticator in issuedRequests invoke the authenticatorCancel operation on authenticator and remove it from issuedRequests.
-
Return constructAssertionAlg and terminate this algorithm.
-
-
Return a
DOMException
whose name is "NotAllowedError
". In order to prevent information leak that could identify the user without consent, this step MUST NOT be executed before lifetimeTimer has expired. See § 14.5.2 Authentication Ceremony Privacy for details.
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 with which to complete the operation.
5.1.5. Store an Existing Credential - PublicKeyCredential’s [[Store]](credential, sameOriginWithAncestors)
Method
The [[Store]](credential, sameOriginWithAncestors)
method is not supported
for Web Authentication’s PublicKeyCredential
type, so it always returns an error.
Note: This algorithm is synchronous; the Promise
resolution/rejection is handled by navigator.credentials.store()
.
This internal method accepts two arguments:
credential
-
This argument is a
PublicKeyCredential
object. sameOriginWithAncestors
-
This argument is a Boolean value which is
true
if and only if the caller’s environment settings object is same-origin with its ancestors.
When this method is invoked, the user agent MUST execute the following algorithm:
-
Return a
DOMException
whose name is "NotSupportedError
", and terminate this algorithm
5.1.6. Preventing Silent Access to an Existing Credential - PublicKeyCredential’s [[preventSilentAccess]](credential, sameOriginWithAncestors)
Method
Calling the [[preventSilentAccess]](credential, sameOriginWithAncestors)
method
will have no effect on authenticators that require an authorization gesture,
but setting that flag may potentially exclude authenticators that can operate without user intervention.
This internal method accepts no arguments.
5.1.7. Availability of User-Verifying Platform Authenticator - PublicKeyCredential’s isUserVerifyingPlatformAuthenticatorAvailable()
Method
WebAuthn Relying Parties use this method to determine whether they can create a new credential using a user-verifying platform authenticator.
Upon invocation, the client employs a client platform-specific procedure to discover available user-verifying platform authenticators.
If any are discovered, the promise is resolved with the value of true
.
Otherwise, the promise is resolved with the value of false
.
Based on the result, the Relying Party can take further actions to guide the user to create a credential.
This method has no arguments and returns a Boolean value.
PublicKeyCredential/isUserVerifyingPlatformAuthenticatorAvailable
In all current engines.
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNone
partial interface PublicKeyCredential {static Promise <boolean >(); };
isUserVerifyingPlatformAuthenticatorAvailable
Note: Invoking this method from a browsing context where the Web Authentication API is "disabled" according to the allowed to use algorithm—i.e., by a permissions policy—will result in the promise being rejected with a DOMException
whose name is "NotAllowedError
". See also § 5.9 Permissions Policy integration.
5.2. Authenticator Responses (interface AuthenticatorResponse
)
In all current engines.
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNone
Authenticators respond to Relying Party requests by returning an object derived from the AuthenticatorResponse
interface:
[SecureContext ,Exposed =Window ]interface AuthenticatorResponse { [SameObject ]readonly attribute ArrayBuffer clientDataJSON ; };
-
AuthenticatorResponse/clientDataJSON
In all current engines.
Firefox60+Safari13+Chrome67+
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNoneclientDataJSON
, of type ArrayBuffer, readonly -
This attribute contains a JSON-compatible serialization of the client data, the hash of which is passed to the authenticator by the client in its call to either
create()
orget()
(i.e., the client data itself is not sent to the authenticator).
5.2.1. Information About Public Key Credential (interface AuthenticatorAttestationResponse
)
AuthenticatorAttestationResponse
In all current engines.
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung Internet10.0+Opera MobileNone
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.
AuthenticatorAttestationResponse/getTransports
In no current engines.
OperaNoneEdgeNone
Edge (Legacy)NoneIENone
Firefox for AndroidNoneiOS SafariNoneChrome for AndroidNoneAndroid WebViewNoneSamsung InternetNoneOpera MobileNone
[SecureContext ,Exposed =Window ]interface AuthenticatorAttestationResponse :AuthenticatorResponse { [SameObject ]readonly attribute ArrayBuffer attestationObject ;sequence <DOMString >();
getTransports ArrayBuffer ();
getAuthenticatorData ArrayBuffer ?();
getPublicKey COSEAlgorithmIdentifier (); };
getPublicKeyAlgorithm
clientDataJSON
-
This attribute, inherited from
AuthenticatorResponse
, contains the JSON-compatible serialization of client data (see § 6.5 Attestation) passed to the authenticator by the client in order to generate this credential. The exact JSON serialization MUST be preserved, as the hash of the serialized client data has been computed over it. -
AuthenticatorAttestationResponse/attestationObject
In all current engines.
Firefox60+Safari13+Chrome67+
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung Internet10.0+Opera MobileNoneattestationObject
, of type ArrayBuffer, readonly -
This attribute contains an attestation object, which is opaque to, and cryptographically protected against tampering by, the client. The attestation object contains both authenticator data and an attestation statement. The former contains the AAGUID, a unique credential ID, and the credential public key. The contents of the attestation statement are determined by the attestation statement format used by the authenticator. It also contains any additional information that the Relying Party's server requires to validate the attestation statement, as well as to decode and validate the authenticator data along with the JSON-compatible serialization of client data. For more details, see § 6.5 Attestation, § 6.5.4 Generating an Attestation Object, and Figure 6.
getTransports()
-
This operation returns the value of
[[transports]]
. getAuthenticatorData()
-
This operation returns the authenticator data contained within
attestationObject
. See § 5.2.1.1 Easily accessing credential data. getPublicKey()
-
This operation returns the DER SubjectPublicKeyInfo of the new credential, or null if this is not available. See § 5.2.1.1 Easily accessing credential data.
getPublicKeyAlgorithm()
-
This operation returns the
COSEAlgorithmIdentifier
of the new credential. See § 5.2.1.1 Easily accessing credential data. [[transports]]
-
This internal slot contains a sequence of zero or more unique
DOMString
s 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 ofAuthenticatorTransport
but Relying Parties MUST ignore unknown values.
5.2.1.1. Easily accessing credential data
Every user of the [[Create]](origin, options, sameOriginWithAncestors)
method will need to parse and store the returned credential public key in order to verify future authentication assertions. However, the credential public key is in [RFC8152] (COSE) format, inside the credentialPublicKey member of the attestedCredentialData, inside the authenticator data, inside the attestation object conveyed by AuthenticatorAttestationResponse
.attestationObject
. Relying Parties wishing to use attestation are obliged to do the work of parsing the attestationObject
and obtaining the credential public key because that public key copy is the one the authenticator signed. However, many valid WebAuthn use cases do not require attestation. For those uses, user agents can do the work of parsing, expose the authenticator data directly, and translate the credential public key into a more convenient format.
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
.
Use of getPublicKey()
does impose some limitations: by using pubKeyCredParams
, a Relying Party can negotiate with the authenticator to use public key algorithms that the user agent may not understand. However, if the Relying Party does so, the user agent will not be able to translate the resulting credential public key into SubjectPublicKeyInfo format and the return value of getPublicKey()
will be null.
User agents MUST be able to return a non-null value for getPublicKey()
when the credential public key has a COSEAlgorithmIdentifier
value of:
-
-7 (ES256), where kty is 2 (with uncompressed points) and crv is 1 (P-256).
-
-257 (RS256).
-
-8 (EdDSA), where crv is 6 (Ed25519).
A SubjectPublicKeyInfo does not include information about the signing algorithm (for example, which hash function to use) that is included in the COSE public key. To provide this, getPublicKeyAlgorithm()
returns the COSEAlgorithmIdentifier
for the credential public key.
To remove the need to parse CBOR at all in many cases, getAuthenticatorData()
returns the authenticator data from attestationObject
. The authenticator data contains other fields that are encoded in a binary format. However, helper functions are not provided to access them because Relying Parties already need to extract those fields when getting an assertion. In contrast to credential creation, where signature verification is optional, Relying Parties should always be verifying signatures from an assertion and thus must extract fields from the signed authenticator data. The same functions used there will also serve during credential creation.
Note: getPublicKey()
and getAuthenticatorData()
were only added in level two of this spec. Relying Parties SHOULD use feature detection before using these functions by testing the value of 'getPublicKey' in AuthenticatorAttestationResponse.prototype
. Relying Parties that require this function to exist may not interoperate with older user-agents.
5.2.2. Web Authentication Assertion (interface AuthenticatorAssertionResponse
)
AuthenticatorAssertionResponse
In all current engines.
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNone
The AuthenticatorAssertionResponse
interface represents an authenticator's response to a client’s request for
generation of a new authentication assertion given the WebAuthn Relying Party's challenge and OPTIONAL list of credentials it is
aware of. This response contains a cryptographic signature proving possession of the credential private key, and
optionally evidence of user consent to a specific transaction.
[SecureContext ,Exposed =Window ]interface AuthenticatorAssertionResponse :AuthenticatorResponse { [SameObject ]readonly attribute ArrayBuffer authenticatorData ; [SameObject ]readonly attribute ArrayBuffer signature ; [SameObject ]readonly attribute ArrayBuffer ?userHandle ; };
clientDataJSON
-
This attribute, inherited from
AuthenticatorResponse
, contains the JSON-compatible serialization of client data (see § 5.8.1 Client Data Used in WebAuthn Signatures (dictionary CollectedClientData)) passed to the authenticator by the client in order to generate this assertion. The exact JSON serialization MUST be preserved, as the hash of the serialized client data has been computed over it. -
AuthenticatorAssertionResponse/authenticatorData
In all current engines.
Firefox60+Safari13+Chrome67+
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNoneauthenticatorData
, of type ArrayBuffer, readonly -
This attribute contains the authenticator data returned by the authenticator. See § 6.1 Authenticator Data.
-
AuthenticatorAssertionResponse/signature
In all current engines.
Firefox60+Safari13+Chrome67+
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNonesignature
, of type ArrayBuffer, readonly -
This attribute contains the raw signature returned from the authenticator. See § 6.3.3 The authenticatorGetAssertion Operation.
-
AuthenticatorAssertionResponse/userHandle
In all current engines.
Firefox60+Safari13+Chrome67+
OperaNoneEdge79+
Edge (Legacy)18IENone
Firefox for Android60+iOS Safari13.3+Chrome for Android70+Android WebView70+Samsung InternetNoneOpera MobileNoneuserHandle
, of type ArrayBuffer, readonly, nullable -
This attribute contains the user handle returned from the authenticator, or null if the authenticator did not return a user handle. See § 6.3.3 The authenticatorGetAssertion Operation.
5.3. Parameters for Credential Generation (dictionary PublicKeyCredentialParameters
)
dictionary PublicKeyCredentialParameters {required DOMString type ;required COSEAlgorithmIdentifier alg ; };
type
, of type DOMString-
This member specifies the type of credential to be created. The value SHOULD be a member of
PublicKeyCredentialType
but client platforms MUST ignore unknown values, ignoring anyPublicKeyCredentialParameters
with an unknowntype
. alg
, of type COSEAlgorithmIdentifier-
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
)
PublicKeyCredentialCreationOptions
In all current engines.
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+
dictionary PublicKeyCredentialCreationOptions {required PublicKeyCredentialRpEntity rp ;required PublicKeyCredentialUserEntity user ;required BufferSource challenge ;required sequence <PublicKeyCredentialParameters >pubKeyCredParams ;unsigned long timeout ;sequence <PublicKeyCredentialDescriptor >excludeCredentials = [];AuthenticatorSelectionCriteria authenticatorSelection ;DOMString attestation = "none";AuthenticationExtensionsClientInputs extensions ; };
-
PublicKeyCredentialCreationOptions/rp
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+rp
, of type PublicKeyCredentialRpEntity -
This member contains data about the Relying Party responsible for the request.
Its value’s
name
member is REQUIRED. See § 5.4.1 Public Key Entity Description (dictionary PublicKeyCredentialEntity) for further details.Its value’s
id
member specifies the RP ID the credential should be scoped to. If omitted, its value will be theCredentialsContainer
object’s relevant settings object's origin's effective domain. See § 5.4.2 Relying Party Parameters for Credential Generation (dictionary PublicKeyCredentialRpEntity) for further details. -
PublicKeyCredentialCreationOptions/user
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+user
, of type PublicKeyCredentialUserEntity -
This member contains data about the user account for which the Relying Party is requesting attestation.
Its value’s
name
,displayName
andid
members are REQUIRED. See § 5.4.1 Public Key Entity Description (dictionary PublicKeyCredentialEntity) and § 5.4.3 User Account Parameters for Credential Generation (dictionary PublicKeyCredentialUserEntity) for further details. -
PublicKeyCredentialCreationOptions/challenge
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+challenge
, of type BufferSource -
This member contains a challenge intended to be used for generating the newly created credential’s attestation object. See the § 13.4.3 Cryptographic Challenges security consideration.
-
PublicKeyCredentialCreationOptions/pubKeyCredParams
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+pubKeyCredParams
, of type sequence<PublicKeyCredentialParameters> -
This member contains information about the desired properties of the credential to be created. The sequence is ordered from most preferred to least preferred. The client makes a best-effort to create the most preferred credential that it can.
-
PublicKeyCredentialCreationOptions/timeout
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+timeout
, of type unsigned long -
This member specifies a time, in milliseconds, that the caller is willing to wait for the call to complete. This is treated as a hint, and MAY be overridden by the client.
-
PublicKeyCredentialCreationOptions/excludeCredentials
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+excludeCredentials
, of type sequence<PublicKeyCredentialDescriptor>, defaulting to[]
-
This member is intended for use by Relying Parties that wish to limit the creation of multiple credentials for the same account on a single authenticator. The client is requested to return an error if the new credential would be created on an authenticator that also contains one of the credentials enumerated in this parameter.
-
PublicKeyCredentialCreationOptions/authenticatorSelection
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+authenticatorSelection
, of type AuthenticatorSelectionCriteria -
This member is intended for use by Relying Parties that wish to select the appropriate authenticators to participate in the
create()
operation. -
PublicKeyCredentialCreationOptions/attestation
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+attestation
, of type DOMString, defaulting to"none"
-
This member is intended for use by Relying Parties that wish to express their preference for attestation conveyance. Its values SHOULD be members of
AttestationConveyancePreference
. Client platforms MUST ignore unknown values, treating an unknown value as if the member does not exist. Its default value is "none". extensions
, of type AuthenticationExtensionsClientInputs-
This member contains additional parameters requesting additional processing by the client and authenticator. For example, the caller may request that only authenticators with certain capabilities be used to create the credential, or that particular information be returned in the attestation object. Some extensions are defined in § 9 WebAuthn Extensions; consult the IANA "WebAuthn Extension Identifiers" registry [IANA-WebAuthn-Registries] established by [RFC8809] for an up-to-date list of registered WebAuthn Extensions.
5.4.1. Public Key Entity Description (dictionary PublicKeyCredentialEntity
)
The PublicKeyCredentialEntity
dictionary describes a user account, or a WebAuthn Relying Party, which a public key credential is
associated with or scoped to, respectively.
dictionary PublicKeyCredentialEntity {required DOMString name ; };
name
, of type DOMString-
A human-palatable name for the entity. Its function depends on what the
PublicKeyCredentialEntity
represents:-
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 "ОАО Примертех".-
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. -
This string MAY contain language and direction metadata. Relying Parties SHOULD consider providing this information. See § 6.4.2 Language and Direction Encoding about how this metadata is encoded.
-
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.
-
-
When inherited by
PublicKeyCredentialUserEntity
, it is a human-palatable identifier for a user account. It is intended only for display, i.e., aiding the user in determining the difference between user accounts with similardisplayName
s. For example, "alexm", "alex.mueller@example.com" or "+14255551234".-
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. -
This string MAY contain language and direction metadata. Relying Parties SHOULD consider providing this information. See § 6.4.2 Language and Direction Encoding about how this metadata is encoded.
-
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 clients, client platforms, or authenticators display a
name
's value, they should always use UI elements to provide a clear boundary around the displayed value, and not allow overflow into other elements [css-overflow-3].Authenticators MAY truncate a
name
member’s value so that it fits within 64 bytes, if the authenticator stores the value. See § 6.4.1 String Truncation about truncation and other considerations. -
5.4.2. Relying Party Parameters for Credential Generation (dictionary PublicKeyCredentialRpEntity
)
The PublicKeyCredentialRpEntity
dictionary is used to supply additional Relying Party attributes when creating a new credential.
dictionary PublicKeyCredentialRpEntity :PublicKeyCredentialEntity {DOMString id ; };
id
, of type DOMString-
A unique identifier for the Relying Party entity, which sets the RP ID.
5.4.3. User Account Parameters for Credential Generation (dictionary PublicKeyCredentialUserEntity
)
The PublicKeyCredentialUserEntity
dictionary is used to supply additional user account attributes when creating a new
credential.
dictionary PublicKeyCredentialUserEntity :PublicKeyCredentialEntity {required BufferSource id ;required DOMString displayName ; };
id
, of type BufferSource-
The user handle of the user account entity. 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.
To ensure secure operation, authentication and authorization decisions MUST be made on the basis of this
id
member, not thedisplayName
norname
members. See Section 6.1 of [RFC8266].The user handle MUST NOT contain personally identifying information about the user, such as a username or e-mail address; see § 14.6.1 User Handle Contents for details. The user handle MUST NOT be empty, though it MAY be null.
Note: the user handle ought not be a constant value across different accounts, even for non-discoverable credentials, because some authenticators always create discoverable credentials. Thus a constant user handle would prevent a user from using such an authenticator with more than one account at the Relying Party.
displayName
, of type DOMString-
A human-palatable name for the user account, intended only for display. For example, "Alex Müller" or "田中倫". The Relying Party SHOULD let the user choose this, and SHOULD NOT restrict the choice more than necessary.
-
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, or displaying the value to the user. -
This string MAY contain language and direction metadata. Relying Parties SHOULD consider providing this information. See § 6.4.2 Language and Direction Encoding about how this metadata is encoded.
-
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 the value to the user or including the value as a parameter of the authenticatorMakeCredential operation.
When clients, client platforms, or authenticators display a
displayName
's value, they should always use UI elements to provide a clear boundary around the displayed value, and not allow overflow into other elements [css-overflow-3].Authenticators MUST accept and store a 64-byte minimum length for a
displayName
member’s value. Authenticators MAY truncate adisplayName
member’s value so that it fits within 64 bytes. See § 6.4.1 String Truncation about truncation and other considerations. -
5.4.4. Authenticator Selection Criteria (dictionary AuthenticatorSelectionCriteria
)
WebAuthn Relying Parties may use the AuthenticatorSelectionCriteria
dictionary to specify their requirements regarding authenticator
attributes.
dictionary AuthenticatorSelectionCriteria {DOMString authenticatorAttachment ;DOMString residentKey ;boolean requireResidentKey =false ;DOMString userVerification = "preferred"; };
authenticatorAttachment
, of type DOMString-
If this member is present, eligible authenticators are filtered to only authenticators attached with the specified § 5.4.5 Authenticator Attachment Enumeration (enum AuthenticatorAttachment). The value SHOULD be a member of
AuthenticatorAttachment
but client platforms MUST ignore unknown values, treating an unknown value as if the member does not exist. residentKey
, of type DOMString-
Specifies the extent to which the Relying Party desires to create a client-side discoverable credential. For historical reasons the naming retains the deprecated “resident” terminology. The value SHOULD be a member of
ResidentKeyRequirement
but client platforms MUST ignore unknown values, treating an unknown value as if the member does not exist. If no value is given then the effective value isrequired
ifrequireResidentKey
istrue
ordiscouraged
if it isfalse
or absent.See
ResidentKeyRequirement
for the description ofresidentKey
's values and semantics. requireResidentKey
, of type boolean, defaulting tofalse
-
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 torequired
. userVerification
, of type DOMString, defaulting to"preferred"
-
This member describes the Relying Party's requirements regarding user verification for the
create()
operation. Eligible authenticators are filtered to only those capable of satisfying this requirement. The value SHOULD be a member ofUserVerificationRequirement
but client platforms MUST ignore unknown values, treating an unknown value as if the member does not exist.
5.4.5. Authenticator Attachment Enumeration (enum AuthenticatorAttachment
)
This enumeration’s values describe authenticators' attachment modalities. Relying Parties use this to express a preferred authenticator attachment modality when calling navigator.credentials.create()
to create a credential.
enum AuthenticatorAttachment {"platform" ,"cross-platform" };
Note: The AuthenticatorAttachment
enumeration is deliberately not referenced, see § 2.1.1 Enumerations as DOMString types.
platform
-
This value indicates platform attachment.
cross-platform
-
This value indicates cross-platform attachment.
Note: An authenticator attachment modality selection option is available only in the [[Create]](origin, options,
sameOriginWithAncestors)
operation. The Relying Party may use it to, for example, ensure the user has a roaming credential for
authenticating on another client device; or to specifically register a platform credential for easier reauthentication using a
particular client device. The [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
operation has no authenticator attachment modality selection option, so the Relying Party SHOULD accept any of the user’s registered credentials. The client and user will then use whichever is available and convenient at the time.
5.4.6. Resident Key Requirement Enumeration (enum ResidentKeyRequirement
)
enum ResidentKeyRequirement {"discouraged" ,"preferred" ,"required" };
Note: The ResidentKeyRequirement
enumeration is deliberately not referenced, see § 2.1.1 Enumerations as DOMString types.
This enumeration’s values describe the Relying Party's requirements for client-side discoverable credentials (formerly known as resident credentials or resident keys):
discouraged
-
This value indicates the Relying Party prefers creating a server-side credential, but will accept a client-side discoverable credential.
Note: A Relying Party cannot require that a created credential is a server-side credential and the Credential Properties Extension may not return a value for the
rk
property. Because of this, it may be the case that it does not know if a credential is a server-side credential or not and thus does not know whether creating a second credential with the same user handle will evict the first. preferred
-
This value indicates the Relying Party strongly prefers creating a client-side discoverable credential, but will accept a server-side credential. For example, user agents SHOULD guide the user through setting up user verification if needed to create a client-side discoverable credential in this case. This takes precedence over the setting of
userVerification
. required
-
This value indicates the Relying Party requires a client-side discoverable credential, and is prepared to receive an error if a client-side discoverable credential cannot be created.
Note: Relying Parties can seek information on whether or not the authenticator created a client-side discoverable credential by inspecting the Credential Properties Extension's return value in light of
the value provided for options.
.
This is useful when values of authenticatorSelection
.residentKey
discouraged
or preferred
are used for options.
, because in those cases it is possible for an authenticator to create either a client-side discoverable credential or a server-side credential.authenticatorSelection
.residentKey
5.4.7. Attestation Conveyance Preference Enumeration (enum AttestationConveyancePreference
)
WebAuthn Relying Parties may use AttestationConveyancePreference
to specify their preference regarding attestation conveyance during credential generation.
enum AttestationConveyancePreference {"none" ,"indirect" ,"direct" ,"enterprise" };
Note: The AttestationConveyancePreference
enumeration is deliberately not referenced, see § 2.1.1 Enumerations as DOMString types.
none
-
This value indicates that the Relying Party is not interested in authenticator attestation. For example, in order to potentially avoid having to obtain user consent to relay identifying information to the Relying Party, or to save a roundtrip to an Attestation CA or Anonymization CA.
This is the default value.
indirect
-
This value indicates that the Relying Party prefers an attestation conveyance yielding verifiable attestation statements, but allows the client to decide how to obtain such attestation statements. The client MAY replace the authenticator-generated attestation statements with attestation statements generated by an Anonymization CA, in order to protect the user’s privacy, or to assist Relying Parties with attestation verification in a heterogeneous ecosystem.
Note: There is no guarantee that the Relying Party will obtain a verifiable attestation statement in this case. For example, in the case that the authenticator employs self attestation.
direct
-
This value indicates that the Relying Party wants to receive the attestation statement as generated by the authenticator.
enterprise
-
This value indicates that the Relying Party wants to receive an attestation statement that may include uniquely identifying information. 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.
If permitted, the user agent SHOULD signal to the authenticator (at invocation time) that enterprise attestation is requested, and convey the resulting AAGUID and attestation statement, unaltered, to the Relying Party.
5.5. Options for Assertion Generation (dictionary PublicKeyCredentialRequestOptions
)
PublicKeyCredentialRequestOptions
In all current engines.
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebView67+Samsung InternetNoneOpera Mobile48+
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.
dictionary PublicKeyCredentialRequestOptions {required BufferSource challenge ;unsigned long timeout ;USVString rpId ;sequence <PublicKeyCredentialDescriptor >allowCredentials = [];DOMString userVerification = "preferred";AuthenticationExtensionsClientInputs extensions ; };
-
PublicKeyCredentialRequestOptions/challenge
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebView67+Samsung InternetNoneOpera Mobile48+challenge
, of type BufferSource -
This member represents a challenge that the selected authenticator signs, along with other data, when producing an authentication assertion. See the § 13.4.3 Cryptographic Challenges security consideration.
-
PublicKeyCredentialRequestOptions/timeout
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebView67+Samsung InternetNoneOpera Mobile48+timeout
, of type unsigned long -
This OPTIONAL member specifies a time, in milliseconds, that the caller is willing to wait for the call to complete. The value is treated as a hint, and MAY be overridden by the client.
-
PublicKeyCredentialRequestOptions/rpId
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebView67+Samsung InternetNoneOpera Mobile48+rpId
, of type USVString -
This OPTIONAL member specifies the relying party identifier claimed by the caller. If omitted, its value will be the
CredentialsContainer
object’s relevant settings object's origin's effective domain. -
PublicKeyCredentialRequestOptions/allowCredentials
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebView67+Samsung InternetNoneOpera Mobile48+allowCredentials
, of type sequence<PublicKeyCredentialDescriptor>, defaulting to[]
-
This OPTIONAL member contains a list of
PublicKeyCredentialDescriptor
objects representing public key credentials acceptable to the caller, in descending order of the caller’s preference (the first item in the list is the most preferred credential, and so on down the list). -
PublicKeyCredentialRequestOptions/userVerification
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebView67+Samsung InternetNoneOpera Mobile48+userVerification
, of type DOMString, defaulting to"preferred"
-
This OPTIONAL member describes the Relying Party's requirements regarding user verification for the
get()
operation. The value SHOULD be a member ofUserVerificationRequirement
but client platforms MUST ignore unknown values, treating an unknown value as if the member does not exist. Eligible authenticators are filtered to only those capable of satisfying this requirement. -
PublicKeyCredentialCreationOptions/extensions
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebViewNoneSamsung InternetNoneOpera Mobile48+PublicKeyCredentialRequestOptions/extensions
In all current engines.
Firefox60+Safari13+Chrome67+
Opera54+Edge79+
Edge (Legacy)NoneIENone
Firefox for Android?iOS Safari13.3+Chrome for Android67+Android WebView67+Samsung InternetNoneOpera Mobile48+extensions
, of type AuthenticationExtensionsClientInputs -
This OPTIONAL member contains additional parameters requesting additional processing by the client and authenticator. For example, if transaction confirmation is sought from the user, then the prompt string might be included as an extension.
5.6. Abort Operations with AbortSignal
Developers are encouraged to leverage the AbortController
to manage the [[Create]](origin, options, sameOriginWithAncestors)
and [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
operations.
See DOM §3.3 Using AbortController and AbortSignal objects in APIs section for detailed instructions.
Note: DOM §3.3 Using AbortController and AbortSignal objects in APIs section specifies that web platform APIs integrating with the AbortController
must reject the promise immediately once the aborted flag is set.
Given the complex inheritance and parallelization structure of the [[Create]](origin, options, sameOriginWithAncestors)
and [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
methods, the algorithms for the two APIs fulfills this
requirement by checking the aborted flag in three places. In the case of [[Create]](origin, options, sameOriginWithAncestors)
, the aborted flag is checked first in Credential Management 1 §2.5.4 Create a Credential immediately before calling [[Create]](origin, options, sameOriginWithAncestors)
,
then in § 5.1.3 Create a New Credential - PublicKeyCredential’s [[Create]](origin, options, sameOriginWithAncestors) Method right before authenticator sessions start, and finally
during authenticator sessions. The same goes for [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
.
The visibility and focus state of the Window object determines whether the [[Create]](origin, options, sameOriginWithAncestors)
and [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
operations
should continue. When the Window object associated with the [Document loses focus, [[Create]](origin, options, sameOriginWithAncestors)
and [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
operations
SHOULD be aborted.
The WHATWG HTML WG is discussing whether to provide a hook when a browsing context gains or loses focuses. If a hook is provided, the above paragraph will be updated to include the hook. See WHATWG HTML WG Issue #2711 for more details.
5.7. WebAuthn Extensions Inputs and Outputs
The subsections below define the data types used for conveying WebAuthn extension inputs and outputs.
Note: Authenticator extension outputs are conveyed as a part of Authenticator data (see Table 1).
Note: The types defined below — AuthenticationExtensionsClientInputs
and AuthenticationExtensionsClientOutputs
— are applicable to both registration extensions and authentication extensions. The "Authentication..." portion of their names should be regarded as meaning "WebAuthentication..."
5.7.1. Authentication Extensions Client Inputs (dictionary AuthenticationExtensionsClientInputs
)
dictionary { };
AuthenticationExtensionsClientInputs
This is a dictionary containing the client extension input values for zero or more WebAuthn Extensions.
5.7.2. Authentication Extensions Client Outputs (dictionary AuthenticationExtensionsClientOutputs
)
dictionary { };
AuthenticationExtensionsClientOutputs
This is a dictionary containing the client extension output values for zero or more WebAuthn Extensions.
5.7.3. Authentication Extensions Authenticator Inputs (CDDL type AuthenticationExtensionsAuthenticatorInputs
)
AuthenticationExtensionsAuthenticatorInputs = { * $$extensionInput .within ( tstr => any ) }
The CDDL type AuthenticationExtensionsAuthenticatorInputs
defines a CBOR map
containing the authenticator extension input values for zero or more WebAuthn Extensions.
Extensions can add members as described in § 9.3 Extending Request Parameters.
This type is not exposed to the Relying Party, but is used by the client and authenticator.
5.7.4. Authentication Extensions Authenticator Outputs (CDDL type AuthenticationExtensionsAuthenticatorOutputs
)
AuthenticationExtensionsAuthenticatorOutputs = { * $$extensionOutput .within ( tstr => any ) }
The CDDL type AuthenticationExtensionsAuthenticatorOutputs
defines a CBOR map
containing the authenticator extension output values for zero or more WebAuthn Extensions.
Extensions can add members as described in § 9.3 Extending Request Parameters.
5.8. Supporting Data Structures
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.
Note: The CollectedClientData
may be extended in the future. Therefore it’s critical when parsing to be tolerant of unknown keys and of any reordering of the keys. See also § 5.8.1.2 Limited Verification Algorithm.
dictionary CollectedClientData {required DOMString type ;required DOMString challenge ;required DOMString origin ;boolean crossOrigin ;TokenBinding tokenBinding ; };dictionary {
TokenBinding required DOMString status ;DOMString id ; };enum {
TokenBindingStatus "present" ,"supported" };
type
, of type DOMString-
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).
challenge
, of type DOMString-
This member contains the base64url encoding of the challenge provided by the Relying Party. See the § 13.4.3 Cryptographic Challenges security consideration.
origin
, of type DOMString-
This member contains the fully qualified origin of the requester, as provided to the authenticator by the client, in the syntax defined by [RFC6454].
crossOrigin
, of type boolean-
This member contains the inverse of the
sameOriginWithAncestors
argument value that was passed into the internal method. tokenBinding
, of type TokenBinding-
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.
status
, of type DOMString-
This member SHOULD be a member of
TokenBindingStatus
but client platforms MUST ignore unknown values, treating an unknown value as if thetokenBinding
member does not exist. When known, this member is one of the following:supported
-
Indicates the client supports token binding, but it was not negotiated when communicating with the Relying Party.
present
-
Indicates token binding was used when communicating with the Relying Party. In this case, the
id
member MUST be present.
Note: The
TokenBindingStatus
enumeration is deliberately not referenced, see § 2.1.1 Enumerations as DOMString types. id
, of type DOMString-
This member MUST be present if
status
ispresent
, and MUST be a base64url encoding of the Token Binding ID that was used when communicating with the Relying Party.
Note: Obtaining a Token Binding ID is a client platform-specific operation.
The CollectedClientData
structure is used by the client to compute the following quantities:
- JSON-compatible serialization of client data
-
This is the result of performing the JSON-compatible serialization algorithm on the
CollectedClientData
dictionary. - Hash of the serialized client data
-
This is the hash (computed using SHA-256) of the JSON-compatible serialization of client data, as constructed by the client.
5.8.1.1. Serialization
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 three 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.
-
Let result be an empty byte string.
-
Append 0x7b2274797065223a (
{"type":
) to result. -
Append CCDToString(
type
) to result. -
Append 0x2c226368616c6c656e6765223a (
,"challenge":
) to result. -
Append CCDToString(
challenge
) to result. -
Append 0x2c226f726967696e223a (
,"origin":
) to result. -
Append CCDToString(
origin
) to result. -
Append 0x2c2263726f73734f726967696e223a (
,"crossOrigin":
) to result. -
If
crossOrigin
is not present, or isfalse
:-
Append 0x66616c7365 (
false
) to result.
-
-
Otherwise:
-
Append 0x74727565 (
true
) to result.
-
-
Create a temporary copy of the
CollectedClientData
and remove the fieldstype
,challenge
,origin
, andcrossOrigin
(if present). -
If no fields remain in the temporary copy then:
-
Append 0x7d (
}
) to result.
-
-
Otherwise:
-
Invoke serialize JSON to bytes on the temporary copy to produce a byte string remainder.
-
Append 0x2c (
,
) to result. -
Remove the leading byte from remainder.
-
Append remainder to result.
-
-
The result of the serialization is the value of result.
The function CCDToString is used in the above algorithm and is defined as:
-
Let encoded be an empty byte string.
-
Append 0x22 (
"
) to encoded. -
Invoke ToString on the given object to convert to a string.
-
For each code point in the resulting string, if the code point:
- is in the set {U+0020, U+0021, U+0023–U+005B, U+005D–U+10FFFF}
-
Append the UTF-8 encoding of that code point to encoded.
- is U+0022
-
Append 0x5c22 (
\"
) to encoded. - is U+005C
-
Append 0x5c5c (\\) to encoded.
- otherwise
-
Append 0x5c75 (
\u
) to encoded, followed by four, lower-case hex digits that, when interpreted as a base-16 number, represent that code point.
-
Append 0x22 (
"
) to encoded. -
The result of this function is the value of encoded.
5.8.1.2. Limited Verification Algorithm
Verifiers may use the following algorithm to verify an encoded CollectedClientData
if they cannot support a full JSON parser:
-
The inputs to the algorithm are:
-
A bytestring, clientDataJSON, that contains
clientDataJSON
— the serializedCollectedClientData
that is to be verified. -
A string, type, that contains the expected
type
. -
A byte string, challenge, that contains the challenge byte string that was given in the
PublicKeyCredentialRequestOptions
orPublicKeyCredentialCreationOptions
. -
A string, origin, that contains the expected
origin
that issued the request to the user agent. -
A boolean, crossOrigin, that is true if, and only if, the request should have been performed within a cross-origin
iframe
.
-
-
Let expected be an empty byte string.
-
Append 0x7b2274797065223a (
{"type":
) to expected. -
Append CCDToString(type) to expected.
-
Append 0x2c226368616c6c656e6765223a (
,"challenge":
) to expected. -
Perform base64url encoding on challenge to produce a string, challengeBase64.
-
Append CCDToString(challengeBase64) to expected.
-
Append 0x2c226f726967696e223a (
,"origin":
) to expected. -
Append CCDToString(origin) to expected.
-
Append 0x2c2263726f73734f726967696e223a (
,"crossOrigin":
) to expected. -
If crossOrigin is true:
-
Append 0x74727565 (
true
) to expected.
-
-
Otherwise, i.e. crossOrigin is false:
-
Append 0x66616c7365 (
false
) to expected.
-
-
If expected is not a prefix of clientDataJSON then the verification has failed.
-
If clientDataJSON is not at least one byte longer than expected then the verification has failed.
-
If the byte of clientDataJSON at the offset equal to the length of expected:
- is 0x7d
-
The verification is successful.
- is 0x2c
-
The verification is successful.
- otherwise
-
The verification has failed.
5.8.1.3. Future development
In order to remain compatible with the limited verification algorithm, future versions of this specification must not remove any of the fields type
, challenge
, origin
, or crossOrigin
from CollectedClientData
. They also must not change the serialization algorithm to change the order in which those fields are serialized.
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 fifth key–value pair may not appear fifth (or at all) if generated by a user agent working from a previous version.
5.8.2. Credential Type Enumeration (enum PublicKeyCredentialType
)
enum PublicKeyCredentialType {"public-key" };
Note: The PublicKeyCredentialType
enumeration is deliberately not referenced, see § 2.1.1 Enumerations as DOMString types.
Currently one credential type is defined, namely "public-key
".
5.8.3. Credential Descriptor (dictionary PublicKeyCredentialDescriptor
)
dictionary PublicKeyCredentialDescriptor {required DOMString type ;required BufferSource id ;sequence <DOMString >transports ; };
This dictionary contains the attributes that are specified by a caller when referring to a public key credential as an input
parameter to the create()
or get()
methods. It mirrors the fields of the PublicKeyCredential
object returned by the latter methods.
type
, of type DOMString-
This member contains the type of the public key credential the caller is referring to. The value SHOULD be a member of
PublicKeyCredentialType
but client platforms MUST ignore anyPublicKeyCredentialDescriptor
with an unknowntype
. id
, of type BufferSource-
This member contains the credential ID of the public key credential the caller is referring to.
transports
, of type sequence<DOMString>-
This OPTIONAL member contains a hint as to how the client might communicate with the managing authenticator of the public key credential the caller is referring to. The values SHOULD be members of
AuthenticatorTransport
but client platforms MUST ignore unknown values.The
getTransports()
operation can provide suitable values for this member. When registering a new credential, the Relying Party SHOULD store the value returned fromgetTransports()
. When creating aPublicKeyCredentialDescriptor
for that credential, the Relying Party SHOULD retrieve that stored value and set it as the value of thetransports
member.
5.8.4. Authenticator Transport Enumeration (enum AuthenticatorTransport
)
enum AuthenticatorTransport {"usb" ,"nfc" ,"ble" ,"internal" };
Note: The AuthenticatorTransport
enumeration is deliberately not referenced, see § 2.1.1 Enumerations as DOMString types.
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).
internal
-
Indicates the respective authenticator is contacted using a client device-specific transport, i.e., it is a platform authenticator. These authenticators are not removable from the client device.
5.8.5. Cryptographic Algorithm Identifier (typedef COSEAlgorithmIdentifier
)
typedef long ;
COSEAlgorithmIdentifier
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 ES256 (-7) MUST specify P-256 (1) as the crv parameter and MUST NOT use the compressed point form.
-
Keys with algorithm ES384 (-35) MUST specify P-384 (2) as the crv parameter and MUST NOT use the compressed point form.
-
Keys with algorithm ES512 (-36) MUST specify P-521 (3) as the crv parameter and MUST NOT use the compressed point form.
-
Keys with algorithm EdDSA (-8) MUST specify Ed25519 (6) 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
)
enum UserVerificationRequirement {"required" ,"preferred" ,"discouraged" };
A WebAuthn Relying Party may require user verification for some of its operations but not for others, and may use this type to express its needs.
Note: The UserVerificationRequirement
enumeration is deliberately not referenced, see § 2.1.1 Enumerations as DOMString types.
required
-
This value indicates that the Relying Party requires user verification for the operation and will fail the operation if the response does not have the UV flag set.
preferred
-
This value indicates that the Relying Party prefers user verification for the operation if possible, but will not fail the operation if the response does not have the UV flag set.
discouraged
-
This value indicates that 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).
5.9. Permissions Policy integration
Headers/Feature-Policy/publickey-credentials-get
In only one current engine.
OperaNoneEdge84+
Edge (Legacy)NoneIENone
Firefox for AndroidNoneiOS SafariNoneChrome for Android84+Android WebView84+Samsung InternetNoneOpera MobileNone
This specification defines one policy-controlled feature identified by
the feature-identifier token "publickey-credentials-get
".
Its default allowlist is 'self
'. [Permissions-Policy]
A Document
's permissions policy determines whether any content in that document is allowed to successfully invoke the Web Authentication API, i.e., via navigator.credentials.get({publicKey:..., ...})
.
If disabled in any document, no content in the document will be allowed to use the foregoing methods: attempting to do so will return an error.
Note: Algorithms specified in [CREDENTIAL-MANAGEMENT-1] perform the actual permissions policy evaluation. This is because such policy evaluation needs to occur when there is access to the current settings object. The [[Create]](origin, options, sameOriginWithAncestors)
and [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
internal methods do not have such access since they are invoked in parallel (by algorithms specified in [CREDENTIAL-MANAGEMENT-1]).
5.10. Using Web Authentication within iframe
elements
The Web Authentication API is disabled by default in cross-origin iframe
s.
To override this default policy and indicate that a cross-origin iframe
is allowed to invoke the Web Authentication API's [[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)
method, specify the allow
attribute on the iframe
element and include the publickey-credentials-get
feature-identifier token in the allow
attribute’s value.
Relying Parties utilizing the WebAuthn API in an embedded context should review § 13.4.2 Visibility Considerations for Embedded Usage regarding UI redressing and its possible mitigations.
6. WebAuthn Authenticator Model
The Web Authentication API implies a specific abstract functional model for a WebAuthn Authenticator. This section describes that authenticator model.
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.2. Responses.
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.
Relying Parties may influence authenticator selection, if they deem necessary, by stipulating various authenticator characteristics when creating credentials and/or when generating assertions, through use of credential creation options or assertion generation options, respectively. The algorithms underlying the WebAuthn API marshal these options and pass them to the applicable authenticator operations defined below.
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.
Each authenticator stores a credentials map, a map from (rpId, [userHandle]) to public key credential source.
Additionally, each authenticator has an AAGUID, which is a 128-bit identifier indicating the type (e.g. make and model) of the authenticator. The AAGUID MUST be chosen by the manufacturer to be identical across all substantially identical authenticators made by that manufacturer, 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 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:
-
An attestation signature is produced when a new public key credential is created via an authenticatorMakeCredential operation. An attestation signature provides cryptographic proof of certain properties of the authenticator and the credential. For instance, an attestation signature asserts the authenticator type (as denoted by its AAGUID) and the credential public key. The attestation signature is signed by an attestation private key, which is chosen depending on the type of attestation desired. For more details on attestation, see § 6.5 Attestation.
-
An assertion signature is produced when the authenticatorGetAssertion method is invoked. It represents an assertion by the authenticator that the user has consented to a specific transaction, such as logging in, or completing a purchase. Thus, an assertion signature asserts that the authenticator possessing a particular credential private key has established, to the best of its ability, that the user requesting this transaction is the same user who consented to creating that particular public key credential. It also asserts additional information, termed client data, that may be useful to the caller, such as the means by which user consent was provided, and the prompt shown to the user by the authenticator. The assertion signature format is illustrated in Figure 4, below.
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 .
Name | Length (in bytes) | Description |
---|---|---|
rpIdHash | 32 | SHA-256 hash of the RP ID the credential is scoped to. |
flags | 1 |
Flags (bit 0 is the least significant bit):
|
signCount | 4 | Signature counter, 32-bit unsigned big-endian integer. |
attestedCredentialData | variable (if present) | attested credential data (if present). See § 6.5.1 Attested Credential Data for details. Its length depends on the length of the credential ID and credential public key being attested. |
extensions | variable (if present) | Extension-defined authenticator data. This is a CBOR [RFC8949] map with extension identifiers as keys, and authenticator extension outputs as values. See § 9 WebAuthn Extensions for details. |
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.
Authenticators perform the following steps to generate an authenticator data structure:
-
The
UP
flag SHALL be set if and only if the authenticator performed a test of user presence. TheUV
flag SHALL be set if and only if the authenticator performed user verification. TheRFU
bits SHALL be set to zero.Note: If the authenticator performed both a test of user presence and user verification, possibly combined in a single authorization gesture, then the authenticator will set both the
UP
flag and theUV
flag. -
For attestation signatures, the authenticator MUST set the AT flag and include the
attestedCredentialData
. For assertion signatures, the AT flag MUST NOT be set and theattestedCredentialData
MUST NOT be included. -
If the authenticator does not include any extension data, it MUST set the
ED
flag to zero, and to one if extension data is included.
Figure shows a visual representation of the authenticator data structure.
Determining attested credential data's length, which is variable, involves determining credentialPublicKey
’s beginning location given the preceding credentialId
’s length, and then determining the credentialPublicKey
’s length (see also Section 7 of [RFC8152]).
6.1.1. Signature Counter Considerations
Authenticators SHOULD implement a signature counter feature. These counters are conceptually stored for each credential
by the authenticator, or globally for the authenticator as a whole. The initial value of a credential’s signature counter is specified in the signCount
value of the authenticator data returned by authenticatorMakeCredential. The signature counter is incremented for each successful authenticatorGetAssertion operation by some positive value, and subsequent values are returned to the WebAuthn Relying Party within the authenticator data again. The signature counter's purpose is to aid Relying Parties in detecting cloned authenticators. Clone
detection is more important for authenticators with limited protection measures.
A Relying Party stores the signature counter of the most recent authenticatorGetAssertion operation. (Or the counter from the authenticatorMakeCredential operation if no authenticatorGetAssertion has ever been performed on a credential.) In subsequent authenticatorGetAssertion operations, the Relying Party compares the stored signature counter value with the new signCount
value returned in the assertion’s authenticator data. If either is non-zero, and the new signCount
value is less than or equal to the stored value, a cloned authenticator may exist, or the authenticator may be malfunctioning.
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.
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).
6.1.2. FIDO U2F Signature Format Compatibility
The format for assertion signatures, which sign over the concatenation of an authenticator data structure and the hash of the serialized client data, are compatible with the FIDO U2F authentication signature format (see Section 5.4 of [FIDO-U2F-Message-Formats]).
This is because the first 37 bytes of the signed data in a FIDO U2F authentication response message constitute a valid authenticator data structure, and the remaining 32 bytes are the hash of the serialized client data. In this authenticator data structure, the rpIdHash
is the FIDO U2F application parameter, all flags
except UP
are always zero, and the attestedCredentialData
and extensions
are never present. FIDO U2F authentication signatures can therefore be verified by
the same procedure as other assertion signatures generated by the authenticatorMakeCredential operation.
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 example:
-
When authenticating for the first time on a particular client device, a roaming authenticator is typically needed since the user doesn’t yet have a platform credential on that client device.
-
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.
-
Passwordless multi-factor authentication requires an authenticator capable of user verification, and in some cases also discoverable credential capable.
-
A laptop computer might support connecting to roaming authenticators via USB and Bluetooth, while a mobile phone might only support NFC.
The above examples illustrate the the primary authenticator type characteristics:
-
Whether the authenticator is a roaming or platform authenticator — the authenticator attachment modality. A roaming authenticator can support one or more transports for communicating with the client.
-
Whether the authenticator is capable of user verification — the authentication factor capability.
-
Whether the authenticator is discoverable credential capable — the credential storage modality.
These characteristics are independent and may in theory be combined in any way, but Table lists and names some authenticator types of particular interest.
Authenticator Type | Authenticator Attachment Modality | Credential Storage Modality | Authentication Factor Capability |
---|---|---|---|
Second-factor platform authenticator | platform | Either | Single-factor capable |
User-verifying platform authenticator | platform | Either | Multi-factor capable |
Second-factor roaming authenticator | cross-platform | Server-side storage | Single-factor capable |
First-factor roaming authenticator | cross-platform | Client-side storage | Multi-factor capable |
A second-factor platform authenticator is convenient to use for re-authentication on the same client device, and can be used to add an extra layer of security both when initiating a new session and when resuming an existing session. A second-factor roaming authenticator is more likely to be used to authenticate on a particular client device for the first time, or on a client device shared between multiple users.
User-verifying platform authenticators and first-factor roaming authenticators enable passwordless multi-factor authentication. In addition to the proof of possession of the credential private key, these authenticators support user verification as a second authentication factor, typically a PIN or biometric recognition. The authenticator can thus act as two kinds of authentication factor, which enables multi-factor authentication while eliminating the need to share a password with the Relying Party.
The four combinations not named in Table have less distinguished use cases:
-
The credential storage modality is less relevant for a platform authenticator than for a roaming authenticator, since users using a platform authenticator can typically be identified by a session cookie or the like (i.e., ambient credentials).
-
A roaming authenticator that is discoverable credential capable but not multi-factor capable can be used for single-factor authentication without a username, where the user is automatically identified by the user handle and possession of the credential private key is used as the only authentication factor. This can be useful in some situations, but makes the user particularly vulnerable to theft of the authenticator.
-
A roaming authenticator that is multi-factor capable but not discoverable credential capable can be used for multi-factor authentication, but requires the user to be identified first which risks leaking personally identifying information; see § 14.6.3 Privacy leak via credential IDs.
The following subsections define the aspects authenticator attachment modality, credential storage modality and authentication factor capability in more depth.
6.2.1. Authenticator Attachment Modality
Clients can communicate with authenticators using a variety of mechanisms. For example, a client MAY use a client device-specific API to communicate with an authenticator which is physically bound to a client device. On the other hand, a client can use a variety of standardized cross-platform transport protocols such as Bluetooth (see § 5.8.4 Authenticator Transport Enumeration (enum AuthenticatorTransport)) to discover and communicate with cross-platform attached authenticators. We refer to authenticators that are part of the client device as platform authenticators, while those that are reachable via cross-platform transport protocols are referred to as roaming authenticators.
-
A platform authenticator is attached using a client device-specific transport, called platform attachment, and is usually not removable from the client device. A public key credential bound to a platform authenticator is called a platform credential.
-
A roaming authenticator is attached using cross-platform transports, called cross-platform attachment. Authenticators of this class are removable from, and can "roam" between, client devices. A public key credential bound to a roaming authenticator is called a roaming credential.
Some