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 an authenticator at the behest of a 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.
Broadly, compliant authenticators protect public key credentials, and interact with user agents to implement the Web Authentication API. Some authenticators may run on the same computing device (e.g., smart phone, tablet, desktop PC) as the user agent is running on. For instance, such an authenticator might consist of a Trusted Execution Environment (TEE) applet, a Trusted Platform Module (TPM), or a Secure Element (SE) integrated into the computing device in conjunction with some means for user verification, along with appropriate platform software to mediate access to these components' functionality. Other authenticators may operate autonomously from the computing device running the user agent, and be accessed over a transport such as Universal Serial Bus (USB), Bluetooth Low Energy (BLE) or Near Field Communications (NFC).
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 §12 Sample scenarios.
A variety of additional use cases and configurations are also possible, including (but not limited to):
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.
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-1]
As described in §1.1 Use Cases, an authenticator may be implemented in the operating system underlying the User Agent, or in external hardware, or a combination of both.
This specification relies on several other underlying specifications, listed below and in Terms defined by reference.
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].
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 an authenticator, with which the Relying Party interacts through the client (consisting of the browser and underlying OS platform). Scripts can (with the user’s consent) request the browser to create a new credential for future use by the Relying Party. Scripts can also request the user’s permission to perform authentication operations with an existing credential. All such operations are performed in the authenticator and are mediated by the browser and/or 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.2 Authenticator operations, the full origin of the requester is included, and signed over, in the attestation object produced when a new credential is created as well as in all assertions produced by WebAuthn credentials.
The client facilitates these security measures by providing the Relying Party's origin and RP ID to the authenticator for each operation. Since this is an integral part of the WebAuthn security model, user agents only expose this API to callers in secure contexts.
The Web Authentication API is defined by the union of the Web IDL fragments presented in the following sections. A combined IDL listing is given in the IDL Index.
The [[Store]](credential)
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 method accepts a single argument:
credential
This argument is a PublicKeyCredential
object.
When this method is invoked, the user agent MUST execute the following algorithm:
Return a DOMException
whose name is "NotSupportedError
", and terminate this algorithm
isPlatformAuthenticatorAvailable()
methodRelying Parties use this method to determine whether they can create a new credential using a platform authenticator. Upon invocation, the client employs a platform-specific procedure to discover available platform authenticators. If successful, the client then assesses whether the user is willing to create a credential using one of the available platform authenticators. This assessment may include various factors, such as:
Whether the user is running in private or incognito mode.
Whether the user has configured the client to not create such credentials.
Whether the user has previously expressed an unwillingness to create a new credential for this Relying Party, either through configuration or by declining a user interface prompt.
The user’s explicitly stated intentions, determined through user interaction.
This method has no arguments and returns a boolean value.
If the promise will return False, the client SHOULD wait a fixed period of time from the invocation of the method before returning False. This is done so that callers can not distinguish between the case where the user was unwilling to create a credential using one of the available platform authenticators and the case where no platform authenticator exists. Trying to make these cases indistinguishable is done in an attempt to not provide additional information that could be used for fingerprinting. A timeout value on the order of 10 minutes is recommended; this is enough time for successful user interactions to be performed but short enough that the dangling promise will still be resolved in a reasonably timely fashion.
partial interface PublicKeyCredential { static Promise < boolean > isPlatformAuthenticatorAvailable
(); };
AuthenticatorResponse
)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; };
AuthenticatorAttestationResponse
)The AuthenticatorAttestationResponse
interface represents the authenticator's response to a client’s request for the creation of a new public key credential. It contains information about the new credential that can be used to identify it for later use, and metadata that can be used by the Relying Party to assess the characteristics of the credential during registration.
[SecureContext, Exposed=Window] interface AuthenticatorAttestationResponse : AuthenticatorResponse { [SameObject] readonly attribute ArrayBuffer attestationObject; };
clientDataJSON
This attribute, inherited from AuthenticatorResponse
, contains the JSON-serialized client data (see §6.3 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.
attestationObject
, of type ArrayBuffer, readonlyThis 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-serialized client data. For more details, see §6.3 Attestation, §6.3.4 Generating an Attestation Object, and Figure 3.
AuthenticatorAssertionResponse
)The AuthenticatorAssertionResponse
interface represents an authenticator's response to a client’s request for generation of a new authentication assertion given the 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; };
PublicKeyCredentialParameters
)dictionary PublicKeyCredentialParameters { required PublicKeyCredentialType type; required COSEAlgorithmIdentifier alg; };This dictionary is used to supply additional parameters when creating a new credential.
The type
member specifies the type of credential to be created.
The alg
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.
MakePublicKeyCredentialOptions
)dictionary MakePublicKeyCredentialOptions { required PublicKeyCredentialRpEntity rp; required PublicKeyCredentialUserEntity user; required BufferSource challenge; required sequence<PublicKeyCredentialParameters> pubKeyCredParams; unsigned long timeout; sequence<PublicKeyCredentialDescriptor> excludeCredentials = []; AuthenticatorSelectionCriteria authenticatorSelection; AuthenticationExtensions extensions; };
rp
, of type PublicKeyCredentialRpEntityThis member contains data about the Relying Party responsible for the request.
Its value’s name
member is required, and contains the friendly name of the Relying Party (e.g. "Acme Corporation", "Widgets, Inc.", or "Awesome Site".
Its value’s id
member specifies the relying party identifier with which the credential should be associated. If omitted, its value will be the CredentialsContainer
object’s relevant settings object's origin's effective domain.
user
, of type PublicKeyCredentialUserEntityThis member contains data about the user account for which the Relying Party is requesting attestation.
Its value’s name
member is required, and contains a name for the user account (e.g., "john.p.smith@example.com" or "+14255551234").
Its value’s displayName
member is required, and contains a friendly name for the user account (e.g., "John P. Smith").
Its value’s id
member is required and contains the user handle for the account, specified by the Relying Party.
challenge
, of type BufferSourceThis member contains a challenge intended to be used for generating the newly created credential’s attestation object.
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 platform makes a best-effort to create the most preferred credential that it can.
timeout
, of type unsigned longThis 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 platform.
excludeCredentials
, of type sequence<PublicKeyCredentialDescriptor>, defaulting to None
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 platform 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.
authenticatorSelection
, of type AuthenticatorSelectionCriteriaThis member is intended for use by Relying Parties that wish to select the appropriate authenticators to participate in the create()
or get()
operation.
extensions
, of type AuthenticationExtensionsThis member contains additional parameters requesting additional processing by the client and authenticator. For example, the caller may request that only authenticators with certain capabilies 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 Identifier" registry established by [WebAuthn-Registries] for an up-to-date list of registered WebAuthn Extensions.
PublicKeyCredentialEntity
)The PublicKeyCredentialEntity
dictionary describes a user account, or a Relying Party, with which a public key credential is associated.
dictionary PublicKeyCredentialEntity { DOMString name; USVString icon; };
name
, of type DOMStringA human-friendly identifier for the entity. For example, this could be a company name for a Relying Party, or a user’s name. This identifier is intended for display.
icon
, of type USVStringA serialized URL which resolves to an image associated with the entity. For example, this could be a user’s avatar or a Relying Party's logo. This URL MUST be an a priori authenticated URL.
PublicKeyCredentialRpEntity
)The PublicKeyCredentialRpEntity
dictionary is used to supply additional Relying Party attributes when creating a new credential.
dictionary PublicKeyCredentialRpEntity : PublicKeyCredentialEntity { DOMString id; };
PublicKeyCredentialUserEntity
)The PublicKeyCredentialUserEntity
dictionary is used to supply additional user account attributes when creating a new credential.
dictionary PublicKeyCredentialUserEntity : PublicKeyCredentialEntity { BufferSource id; DOMString displayName; };
id
, of type BufferSourceThe user handle of the user account entity.
displayName
, of type DOMStringA friendly name for the user account (e.g., "John P. Smith").
AuthenticatorSelectionCriteria
)Relying Parties may use the AuthenticatorSelectionCriteria
dictionary to specify their requirements regarding authenticator attributes.
dictionary AuthenticatorSelectionCriteria { AuthenticatorAttachment authenticatorAttachment; boolean requireResidentKey = false; boolean requireUserVerification = false; };
AuthenticatorAttachment
)enum AuthenticatorAttachment {"platform"
, // Platform attachment"cross-platform"
// Cross-platform attachment };
Clients may communicate with authenticators using a variety of mechanisms. For example, a client may use a platform-specific API to communicate with an authenticator which is physically bound to a platform. On the other hand, a client may 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. Therefore, we use AuthenticatorAttachment
to describe an authenticator's attachment modality. We define authenticators that are part of the client’s platform as having a platform attachment, and refer to them as platform authenticators. While those that are reachable via cross-platform transport protocols are defined as having cross-platform attachment, and refer to them as roaming authenticators.
This distinction is important because there are use-cases where only platform authenticators are acceptable to a Relying Party, and conversely ones where only roaming authenticators are employed. As a concrete example of the former, a credential on a platform authenticator may be used by Relying Parties to quickly and conveniently reauthenticate the user with a minimum of friction, e.g., the user will not have to dig around in their pocket for their key fob or phone. As a concrete example of the latter, when the user is accessing the Relying Party from a given client for the first time, they may be required to use a roaming authenticator which was originally registered with the Relying Party using a different client.
PublicKeyCredentialRequestOptions
)The PublicKeyCredentialRequestOptions
dictionary supplies get()
with the data it needs to generate an assertion. Its challenge
member must be present, while its other members are optional.
dictionary PublicKeyCredentialRequestOptions { required BufferSource challenge; unsigned long timeout; USVString rpId; sequence<PublicKeyCredentialDescriptor> allowCredentials = []; AuthenticationExtensions extensions; };
challenge
, of type BufferSourceThis member represents a challenge that the selected authenticator signs, along with other data, when producing an authentication assertion.
timeout
, of type unsigned longThis 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 platform.
rpId
, of type USVStringThis 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.
allowCredentials
, of type sequence<PublicKeyCredentialDescriptor>, defaulting to None
This optional member contains a list of PublicKeyCredentialDescriptor
object representing public key credentials acceptable to the caller, in decending order of the caller’s preference (the first item in the list is the most preferred credential, and so on down the list).
extensions
, of type AuthenticationExtensionsThis 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.
AbortSignal
Developers are encouraged to leverage the AbortController
to manage the [[Create]](options)
and [[DiscoverFromExternalSource]](options)
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]](options)
and [[DiscoverFromExternalSource]](options)
methods, the algorithms for the two APIs fulfills this requirement by checking the aborted flag in three places. In the case of [[Create]](options)
, the aborted flag is checked first in Credential Management 1 §2.5.4 Create a Credential right before calling [[Create]](options)
, then in §5.1.3 Create a new credential - PublicKeyCredential’s [[Create]](options) method right before authenticator sessions start, and finally during authenticator sessions. The same goes for [[DiscoverFromExternalSource]](options)
.
The visibility and focus state of the Window object determines whether the [[Create]](options)
and [[DiscoverFromExternalSource]](options)
operations should continue. When the Window object associated with the [Document loses focus, [[Create]](options)
and [[DiscoverFromExternalSource]](options)
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.
typedef record<DOMString, any> AuthenticationExtensions
;
This is a dictionary containing zero or more WebAuthn extensions, as defined in §9 WebAuthn Extensions. An AuthenticationExtensions instance can contain either client extensions or authenticator extensions, depending upon context.
The public key credential type uses certain data structures that are specified in supporting specifications. These are as follows.
CollectedClientData
)The client data represents the contextual bindings of both the Relying Party and the client platform. It is a key-value mapping with string-valued keys. Values may be any type that has a valid encoding in JSON. Its structure is defined by the following Web IDL.
dictionary CollectedClientData { required DOMString challenge; required DOMString origin; required DOMString hashAlgorithm; DOMString tokenBindingId; AuthenticationExtensions clientExtensions; AuthenticationExtensions authenticatorExtensions; };The
challenge
member contains the base64url encoding of the challenge provided by the RP.The origin
member contains the fully qualified origin of the requester, as provided to the authenticator by the client, in the syntax defined by [RFC6454].
The hashAlgorithm
member is a recognized algorithm name that supports the "digest"
operation, which specifies the algorithm used to compute the hash of the serialized client data. This algorithm is chosen by the client at its sole discretion.
The tokenBindingId
member contains the base64url encoding of the Token Binding ID that this client uses for the Token Binding protocol when communicating with the Relying Party. This can be omitted if no Token Binding has been negotiated between the client and the Relying Party.
The optional clientExtensions
and authenticatorExtensions
members contain additional parameters generated by processing the extensions passed in by the Relying Party. WebAuthn extensions are detailed in Section §9 WebAuthn Extensions.
This structure is used by the client to compute the following quantities:
JSON-serialized client dataThis is the UTF-8 encoding of the result of calling the initial value of JSON.stringify
on a CollectedClientData
dictionary.
This is the hash (computed using hashAlgorithm
) of the JSON-serialized client data, as constructed by the client.
PublicKeyCredentialType
)enum PublicKeyCredentialType { "public-key" };This enumeration defines the valid credential types. It is an extension point; values may be added to it in the future, as more credential types are defined. The values of this enumeration are used for versioning the Authentication Assertion and attestation structures according to the type of the authenticator.
Currently one credential type is defined, namely "public-key
".
PublicKeyCredentialDescriptor
)dictionary PublicKeyCredentialDescriptor { required PublicKeyCredentialType type; required BufferSource id; sequence<AuthenticatorTransport> transports
; };
This dictionary contains the attributes that are specified by a caller when referring to a 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
member contains the type of the credential the caller is referring to.The id
member contains the identifier of the credential that the caller is referring to.
AuthenticatorTransport
)enum AuthenticatorTransport { "usb", "nfc", "ble" };Authenticators may communicate with Clients using a variety of transports. This enumeration defines a hint as to how Clients might communicate with a particular Authenticator in order to obtain an assertion for a specific credential. Note that these hints represent the Relying Party's best belief as to how an Authenticator may be reached. A Relying Party may obtain a list of transports hints from some attestation statement formats or via some out-of-band mechanism; it is outside the scope of this specification to define that mechanism.
usb
- the respective Authenticator may be contacted over USB.nfc
- the respective Authenticator may be contacted over Near Field Communication (NFC).ble
- the respective Authenticator may be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE).typedef long COSEAlgorithmIdentifier
;
A COSEAlgorithmIdentifier
's value is a number identifying a cryptographic algorithm. The algorithm identifiers SHOULD be values registered in the IANA COSE Algorithms registry [IANA-COSE-ALGS-REG], for instance, -7
for "ES256" and -257
for "RS256".The API defined in this specification implies a specific abstract functional model for an authenticator. This section describes the 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 platform, MUST be indistinguishable from the behavior specified in §5 Web Authentication API.
For authenticators, this model defines the logical operations that they must support, and the data formats that they expose to the client and the Relying Party. However, it does not define the details of how authenticators communicate with the client platform, unless they are required for interoperability with Relying Parties. For instance, this abstract model does not define protocols for connecting authenticators to clients over transports such as USB or NFC. Similarly, this abstract model does not define specific error codes or methods of returning them; however, it does define error behavior in terms of the needs of the client. Therefore, specific error codes are mentioned as a means of showing which error conditions must be distinguishable (or not) from each other in order to enable a compliant and secure client implementation.
In this abstract model, the authenticator provides key management and cryptographic signatures. It may be embedded in the WebAuthn client, or housed in a separate device entirely. The authenticator may itself 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 some number of public key credentials. Each public key credential has an identifier which is unique (or extremely unlikely to be duplicated) among all public key credentials. Each credential is also associated with a Relying Party, whose identity is represented by a Relying Party Identifier (RP ID).
Each authenticator has an AAGUID, which is a 128-bit identifier that indicates 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 probability 1-2-128 or greater) from the AAGUIDs of all other types of authenticators. The RP 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 RP 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 platform 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 platform 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 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.3 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 2, below.
The formats of these signatures, as well as the procedures for generating them, are specified below.
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 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 components.
The authenticator data structure is a byte array of 37 bytes or more, as follows.
NOTE: The names in the Name column in the above table are only for reference within this document, and are not present in the actual representation of the authenticator data.
The RP ID is originally received from the client when the credential is created, and again when an assertion is generated. However, it differs from other client data in some important ways. First, unlike the client data, the RP ID of a credential does not change between operations but instead remains the same for the lifetime of that credential. Secondly, it is validated by the authenticator during the authenticatorGetAssertion operation, by verifying that the RP ID associated with the requested credential exactly matches the RP ID supplied by the client, and that the RP ID is a registrable domain suffix of or is equal to the effective domain of the RP’s origin's effective domain.
The UP
flag SHALL be set if and only if the authenticator detected a user through an authenticator specific gesture. The RFU
bits SHALL be set to zero.
For attestation signatures, the authenticator MUST set the AT flag and include the attestedCredentialData
. For authentication signatures, the AT flag MUST NOT be set and the attestedCredentialData
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.
The figure below shows a visual representation of the authenticator data structure.
Note that the authenticator data describes its own length: If the AT and ED flags are not set, it is always 37 bytes long. The attested credential data (which is only present if the AT flag is set) describes its own length. If the ED flag is set, then the total length is 37 bytes plus the length of the attested credential data, plus the length of the CBOR map that follows.
Authenticators MUST implement a signature counter feature. The signature counter is incremented for each successful authenticatorGetAssertion operation by some positive value, and its value is returned to the Relying Party within the authenticator data. 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.
An Relying Party stores the signature counter of the most recent authenticatorGetAssertion operation. Upon a new authenticatorGetAssertion operation, the Relying Party compares the stored signature counter value with the new signCount
value returned in the assertion’s authenticator data. If this 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-RP ID 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).
A client must connect to an authenticator in order to invoke any of the operations of that authenticator. This connection defines an authenticator session. An authenticator must maintain isolation between sessions. It may do this by only allowing one session to exist at any particular time, or by providing more complicated session management.
The following operations can be invoked by the client in an authenticator session.
This operation must be invoked in an authenticator session which has no other operations in progress. It takes the following input parameters:
hashThe hash of the serialized client data, provided by the client.
rpEntityThe Relying Party's PublicKeyCredentialRpEntity
.
The user account’s PublicKeyCredentialUserEntity
, containing the user handle given by the Relying Party.
options.authenticatorSelection
.requireResidentKey
.
options.authenticatorSelection
.requireUserVerification
.
A sequence of pairs of PublicKeyCredentialType
and public key algorithms (COSEAlgorithmIdentifier
) requested by the Relying Party. This sequence is ordered from most preferred to least preferred. The platform makes a best-effort to create the most preferred credential that it can.
An optional list of PublicKeyCredentialDescriptor
objects provided by the Relying Party with the intention that, if any of these are known to the authenticator, it should not create a new credential. excludeCredentialDescriptorList contains a list of known credentials.
A map from extension identifiers to their authenticator extension inputs, created by the client based on the extensions requested by the Relying Party, if any.
When this operation is invoked, the authenticator must perform the following procedure:
Check if all the supplied parameters are syntactically well-formed and of the correct length. If not, return an error code equivalent to "UnknownError
" and terminate the operation.
Check if at least one of the specified combinations of PublicKeyCredentialType
and cryptographic parameters in credTypesAndPubKeyAlgs is supported. If not, return an error code equivalent to "NotSupportedError
" and terminate the operation.
Check if a credential matching an item of excludeCredentialDescriptorList is present on this authenticator. If so, return an error code equivalent to "NotAllowedError
" and terminate the operation.
If requireResidentKey is true and the authenticator cannot store a Client-side-resident Credential Private Key, return an error code equivalent to "ConstraintError
" and terminate the operation.
If requireUserVerification is true and the authenticator cannot perform user verification, return an error code equivalent to "ConstraintError
" and terminate the operation.
Prompt the user for consent to create a new credential. The prompt for obtaining this consent is shown by the authenticator if it has its own output capability, or by the user agent otherwise. If the user denies consent, return an error code equivalent to "NotAllowedError
" and terminate the operation. The Authenticator and user agent MAY skip this prompt if the Authenticator is a platform authenticator and excludeCredentialDescriptorList is empty.
Once user consent has been obtained, generate a new credential object:
Let (publicKey,privateKey) be a new set of cryptographic keys using the combination of PublicKeyCredentialType
and cryptographic parameters represented by the first item in credTypesAndPubKeyAlgs that is supported by this authenticator.
Let credentialId be a new identifier for this credential that is globally unique with high probability across all credentials with the same type across all authenticators.
Let userHandle be userEntity.
.id
Associate the credentialId and privateKey with rpEntity.
and userHandle.id
Delete any older credentials with the same rpEntity.
and userHandle that are stored locally by the authenticator.id
If any error occurred while creating the new credential object, return an error code equivalent to "UnknownError
" and terminate the operation.
Let processedExtensions be the result of authenticator extension processing for each supported extension identifier/input pair in extensions.
If the authenticator supports:
a per-RP ID signature counterallocate the counter, associate it with the RP ID, and initialize the counter value as zero.
a global signature counterUse the global signature counter's actual value when generating authenticator data.
a per credential signature counterallocate the counter, associate it with the new credential, and initialize the counter value as zero.
Let attestedCredentialData be the attested credential data byte array including the credentialId and publicKey.
Let authenticatorData be the byte array specified in §6.1 Authenticator data, including attestedCredentialData as the attestedCredentialData
and processedExtensions, if any, as the extensions
.
Return the attestation object for the new credential created by the procedure specified in §6.3.4 Generating an Attestation Object using an authenticator-chosen attestation statement format, authenticatorData, and hash. For more details on attestation, see §6.3 Attestation.
On successful completion of this operation, the authenticator returns the attestation object to the client.
This operation must be invoked in an authenticator session which has no other operations in progress. It takes the following input parameters:
rpIdThe caller’s RP ID, as determined by the user agent and the client.
hashThe hash of the serialized client data, provided by the client.
allowCredentialDescriptorListAn optional list of PublicKeyCredentialDescriptor
s describing credentials acceptable to the Relying Party (possibly filtered by the client), if any.
A map from extension identifiers to their authenticator extension inputs, created by the client based on the extensions requested by the Relying Party, if any.
When this method is invoked, the authenticator must perform the following procedure:
Check if all the supplied parameters are syntactically well-formed and of the correct length. If not, return an error code equivalent to "UnknownError
" and terminate the operation.
If allowCredentialDescriptorList was not supplied, set it to a list of all credentials stored for rpId (as determined by an exact match of rpId).
Remove any items from allowCredentialDescriptorList that are not present on this authenticator.
If allowCredentialDescriptorList is now empty, return an error code equivalent to "NotAllowedError
" and terminate the operation.
Prompt the user to select a credential selectedCredential from allowCredentialDescriptorList. Obtain user consent for using selectedCredential. The prompt for obtaining this consent may be shown by the authenticator if it has its own output capability, or by the user agent otherwise.
Let processedExtensions be the result of authenticator extension processing for each supported extension identifier/input pair in extensions.
Increment the RP ID-associated signature counter or the global signature counter value, depending on which approach is implemented by the authenticator, by some positive value.
Let authenticatorData be the byte array specified in §6.1 Authenticator data including processedExtensions, if any, as the extensions
and excluding attestedCredentialData
.
Let signature be the assertion signature of the concatenation authenticatorData || hash
using the private key of selectedCredential as shown in Figure 2, below. A simple, undelimited concatenation is safe to use here because the authenticator data describes its own length. The hash of the serialized client data (which potentially has a variable length) is always the last element.
If any error occurred while generating the assertion signature, return an error code equivalent to "UnknownError
" and terminate the operation.
Return to the user agent:
selectedCredential’s credential ID, if either a list of credentials of length 2 or greater was supplied by the client, or no such list was supplied.
Note: If the client supplies a list of exactly one credential and it was successfully employed, then its credential ID is not returned since the client already knows it.
authenticatorData
signature
The user handle associated with selectedCredential.
If the authenticator cannot find any credential corresponding to the specified Relying Party that matches the specified criteria, it terminates the operation and returns an error.
If the user refuses consent, the authenticator returns an appropriate error status to the client.
This operation takes no input parameters and returns no result.
When this operation is invoked by the client in an authenticator session, it has the effect of terminating any authenticatorMakeCredential or authenticatorGetAssertion operation currently in progress in that authenticator session. The authenticator stops prompting for, or accepting, any user input related to authorizing the canceled operation. The client ignores any further responses from the authenticator for the canceled operation.
This operation is ignored if it is invoked in an authenticator session which does not have an authenticatorMakeCredential or authenticatorGetAssertion operation currently in progress.
Authenticators must also provide some form of attestation. The basic requirement is that the authenticator can produce, for each credential public key, an attestation statement verifable by the Relying Party. Typically, this attestation statement contains a signature by an attestation private key over the attested credential public key and a challenge, as well as a certificate or similar data providing provenance information for the attestation public key, enabling the Relying Party to make a trust decision. However, if an attestation key pair is not available, then the authenticator MUST perform self attestation of the credential public key with the corresponding credential private key. All this information is returned by authenticators any time a new public key credential is generated, in the overall form of an attestation object. The relationship of the attestation object with authenticator data (containing attested credential data) and the attestation statement is illustrated in figure 3, below.
An important component of the attestation object is the attestation statement. This is a specific type of signed data object, containing statements about a public key credential itself and the authenticator that created it. It contains an attestation signature created using the key of the attesting authority (except for the case of self attestation, when it is created using the credential private key). In order to correctly interpret an attestation statement, a Relying Party needs to understand these two aspects of attestation:
The attestation statement format is the manner in which the signature is represented and the various contextual bindings are incorporated into the attestation statement by the authenticator. In other words, this defines the syntax of the statement. Various existing devices and platforms (such as TPMs and the Android OS) have previously defined attestation statement formats. This specification supports a variety of such formats in an extensible way, as defined in §6.3.2 Attestation Statement Formats.
The attestation type defines the semantics of attestation statements and their underlying trust models. Specifically, it defines how a Relying Party establishes trust in a particular attestation statement, after verifying that it is cryptographically valid. This specification supports a number of attestation types, as described in §6.3.3 Attestation Types.
In general, there is no simple mapping between attestation statement formats and attestation types. For example, the "packed" attestation statement format defined in §8.2 Packed Attestation Statement Format can be used in conjunction with all attestation types, while other formats and types have more limited applicability.
The privacy, security and operational characteristics of attestation depend on:
It is expected that most authenticators will support a small number of attestation types and attestation statement formats, while Relying Parties will decide what attestation types are acceptable to them by policy. Relying Parties will also need to understand the characteristics of the authenticators that they trust, based on information they have about these authenticators. For example, the FIDO Metadata Service [FIDOMetadataService] provides one way to access such information.
Attested credential data is a variable-length byte array added to the authenticator data when generating an attestation object for a given credential. It has the following format:
Name | Length (in bytes) | Description |
---|---|---|
aaguid | 16 | The AAGUID of the authenticator. |
credentialIdLength | 2 | Byte length L of Credential ID |
credentialId | L | Credential ID |
credentialPublicKey | variable | The credential public key encoded in COSE_Key format, as defined in Section 7 of [RFC8152]. The encoded credential public key MUST contain the "alg" parameter and MUST NOT contain any other optional parameters. The "alg" parameter MUST contain a COSEAlgorithmIdentifier value. |
NOTE: The names in the Name column in the above table are only for reference within this document, and are not present in the actual representation of the attested credential data.
As described above, an attestation statement format is a data format which represents a cryptographic signature by an authenticator over a set of contextual bindings. Each attestation statement format MUST be defined using the following template:
The initial list of specified attestation statement formats is in §8 Defined Attestation Statement Formats.
WebAuthn supports multiple attestation types:
Basic AttestationIn the case of basic attestation [UAFProtocol], the authenticator’s attestation key pair is specific to an authenticator model. Thus, authenticators of the same model often share the same attestation key pair. See §6.3.5.1 Privacy for futher information.
Self AttestationIn the case of self attestation, also known as surrogate basic attestation [UAFProtocol], the Authenticator does not have any specific attestation key. Instead it uses the authentication key itself to create the attestation signature. Authenticators without meaningful protection measures for an attestation private key typically use this attestation type.
Privacy CAIn this case, the Authenticator owns an authenticator-specific (endorsement) key. This key is used to securely communicate with a trusted third party, the Privacy CA. The Authenticator can generate multiple attestation key pairs and asks the Privacy CA to issue an attestation certificate for it. Using this approach, the Authenticator can limit the exposure of the endorsement key (which is a global correlation handle) to Privacy CA(s). Attestation keys can be requested for each public key credential individually.
Note: This concept typically leads to multiple attestation certificates. The attestation certificate requested most recently is called "active".
Elliptic Curve based Direct Anonymous Attestation (ECDAA)In this case, the Authenticator receives direct anonymous attestation (DAA) credentials from a single DAA-Issuer. These DAA credentials are used along with blinding to sign the attested credential data. The concept of blinding avoids the DAA credentials being misused as global correlation handle. WebAuthn supports DAA using elliptic curve cryptography and bilinear pairings, called ECDAA (see [FIDOEcdaaAlgorithm]) in this specification. Consequently we denote the DAA-Issuer as ECDAA-Issuer (see [FIDOEcdaaAlgorithm]).
To generate an attestation object (see: Figure 3) given:
attestationFormatAn attestation statement format.
authDataA byte array containing authenticator data.
hashThe hash of the serialized client data.
the authenticator MUST:
Let attStmt be the result of running attestationFormat’s signing procedure given authData and hash.
Let fmt be attestationFormat’s attestation statement format identifier
Return the attestation object as a CBOR map with the following syntax, filled in with variables initialized by this algorithm:
attObj = { authData: bytes, $$attStmtType } attStmtTemplate = ( fmt: text, attStmt: { * tstr => any } ; Map is filled in by each concrete attStmtType ) ; Every attestation statement format must have the above fields attStmtTemplate .within $$attStmtType
Attestation keys may be used to track users or link various online identities of the same user together. This may be mitigated in several ways, including:
A WebAuthn authenticator manufacturer may choose to ship all of their devices with the same (or a fixed number of) attestation key(s) (called Basic Attestation). This will anonymize the user at the risk of not being able to revoke a particular attestation key should its WebAuthn Authenticator be compromised.
A WebAuthn Authenticator may be capable of dynamically generating different attestation keys (and requesting related certificates) per origin (following the Privacy CA approach). For example, a WebAuthn Authenticator can ship with a master attestation key (and certificate), and combined with a cloud operated privacy CA, can dynamically generate per origin attestation keys and attestation certificates.
A WebAuthn Authenticator can implement Elliptic Curve based direct anonymous attestation (see [FIDOEcdaaAlgorithm]). Using this scheme, the authenticator generates a blinded attestation signature. This allows the Relying Party to verify the signature using the ECDAA-Issuer public key, but the attestation signature does not serve as a global correlation handle.
When an intermediate CA or a root CA used for issuing attestation certificates is compromised, WebAuthn authenticator attestation keys are still safe although their certificates can no longer be trusted. A WebAuthn Authenticator manufacturer that has recorded the public attestation keys for their devices can issue new attestation certificates for these keys from a new intermediate CA or from a new root CA. If the root CA changes, the Relying Parties must update their trusted root certificates accordingly.
A WebAuthn Authenticator attestation certificate must be revoked by the issuing CA if its key has been compromised. A WebAuthn Authenticator manufacturer may need to ship a firmware update and inject new attestation keys and certificates into already manufactured WebAuthn Authenticators, if the exposure was due to a firmware flaw. (The process by which this happens is out of scope for this specification.) If the WebAuthn Authenticator manufacturer does not have this capability, then it may not be possible for Relying Parties to trust any further attestation statements from the affected WebAuthn Authenticators.
If attestation certificate validation fails due to a revoked intermediate attestation CA certificate, and the Relying Party's policy requires rejecting the registration/authentication request in these situations, then it is recommended that the Relying Party also un-registers (or marks with a trust level equivalent to "self attestation") public key credentials that were registered after the CA compromise date using an attestation certificate chaining up to the same intermediate CA. It is thus recommended that Relying Parties remember intermediate attestation CA certificates during Authenticator registration in order to un-register related public key credentials if the registration was performed after revocation of such certificates.
If an ECDAA attestation key has been compromised, it can be added to the RogueList (i.e., the list of revoked authenticators) maintained by the related ECDAA-Issuer. The Relying Party should verify whether an authenticator belongs to the RogueList when performing ECDAA-Verify (see section 3.6 in [FIDOEcdaaAlgorithm]). For example, the FIDO Metadata Service [FIDOMetadataService] provides one way to access such information.
A 3-tier hierarchy for attestation certificates is recommended (i.e., Attestation Root, Attestation Issuing CA, Attestation Certificate). It is also recommended that for each WebAuthn Authenticator device line (i.e., model), a separate issuing CA is used to help facilitate isolating problems with a specific version of a device.
If the attestation root certificate is not dedicated to a single WebAuthn Authenticator device line (i.e., AAGUID), the AAGUID should be specified in the attestation certificate itself, so that it can be verified against the authenticator data.
Upon successful execution of create()
or get()
, the Relying Party's script receives a PublicKeyCredential
containing an AuthenticatorAttestationResponse
or AuthenticatorAssertionResponse
structure, respectively, from the client. It must then deliver the contents of this structure to the Relying Party server, using methods outside the scope of this specification. This section describes the operations that the Relying Party must perform upon receipt of these structures.
When registering a new credential, represented by a AuthenticatorAttestationResponse
structure, as part of a registration ceremony, a Relying Party MUST proceed as follows:
Perform JSON deserialization on the clientDataJSON
field of the AuthenticatorAttestationResponse
object to extract the client data C claimed as collected during the credential creation.
Verify that the challenge
in C matches the challenge that was sent to the authenticator in the create()
call.
Verify that the origin
in C matches the Relying Party's origin.
Verify that the tokenBindingId
in C matches the Token Binding ID for the TLS connection over which the attestation was obtained.
Verify that the clientExtensions
in C is a subset of the extensions requested by the RP and that the authenticatorExtensions
in C is also a subset of the extensions requested by the RP.
Compute the hash of clientDataJSON
using the algorithm identified by C.
.hashAlgorithm
Perform CBOR decoding on the attestationObject
field of the AuthenticatorAttestationResponse
structure to obtain the attestation statement format fmt, the authenticator data authData, and the attestation statement attStmt.
Verify that the RP ID hash in authData is indeed the SHA-256 hash of the RP ID expected by the RP.
Determine the attestation statement format by performing an USASCII case-sensitive match on fmt against the set of supported WebAuthn Attestation Statement Format Identifier values. The up-to-date list of registered WebAuthn Attestation Statement Format Identifier values is maintained in the in the IANA registry of the same name [WebAuthn-Registries].
Verify that attStmt is a correct attestation statement, conveying a valid attestation signature, by using the attestation statement format fmt’s verification procedure given attStmt, authData and the hash of the serialized client data computed in step 6.
Note: Each attestation statement format specifies its own verification procedure. See §8 Defined Attestation Statement Formats for the initially-defined formats, and [WebAuthn-Registries] for the up-to-date list.
If validation is successful, obtain a list of acceptable trust anchors (attestation root certificates or ECDAA-Issuer public keys) for that attestation type and attestation statement format fmt, from a trusted source or from policy. For example, the FIDO Metadata Service [FIDOMetadataService] provides one way to obtain such information, using the aaguid
in the attestedCredentialData
in authData.
Assess the attestation trustworthiness using the outputs of the verification procedure in step 10, as follows:
If the attestation statement attStmt verified successfully and is found to be trustworthy, then register the new credential with the account that was denoted in the options
.user
passed to create()
, by associating it with the credentialId
and credentialPublicKey
in the attestedCredentialData
in authData, as appropriate for the Relying Party's system.
If the attestation statement attStmt successfully verified but is not trustworthy per step 12 above, the Relying Party SHOULD fail the registration ceremony.
NOTE: However, if permitted by policy, the Relying Party MAY register the credential ID and credential public key but treat the credential as one with self attestation (see §6.3.3 Attestation Types). If doing so, the Relying Party is asserting there is no cryptographic proof that the public key credential has been generated by a particular authenticator model. See [FIDOSecRef] and [UAFProtocol] for a more detailed discussion.
Verification of attestation objects requires that the Relying Party has a trusted method of determining acceptable trust anchors in step 11 above. Also, if certificates are being used, the Relying Party must have access to certificate status information for the intermediate CA certificates. The Relying Party must also be able to build the attestation certificate chain if the client did not provide this chain in the attestation information.
To avoid ambiguity during authentication, the Relying Party SHOULD check that each credential is registered to no more than one user. If registration is requested for a credential that is already registered to a different user, the Relying Party SHOULD fail this ceremony, or it MAY decide to accept the registration, e.g. while deleting the older registration.
When verifying a given PublicKeyCredential
structure (credential) as part of an authentication ceremony, the Relying Party MUST proceed as follows:
Using credential’s id
attribute (or the corresponding rawId
, if base64url encoding is inappropriate for your use case), look up the corresponding credential public key.
Let cData, aData and sig denote the value of credential’s response
's clientDataJSON
, authenticatorData
, and signature
respectively.
Perform JSON deserialization on cData to extract the client data C used for the signature.
Verify that the challenge
member of C matches the challenge that was sent to the authenticator in the PublicKeyCredentialRequestOptions
passed to the get()
call.
Verify that the origin
member of C matches the Relying Party's origin.
Verify that the tokenBindingId
member of C (if present) matches the Token Binding ID for the TLS connection over which the signature was obtained.
Verify that the clientExtensions
member of C is a subset of the extensions requested by the Relying Party and that the authenticatorExtensions
in C is also a subset of the extensions requested by the Relying Party.
Verify that the rpIdHash
in aData is the SHA-256 hash of the RP ID expected by the Relying Party.
Let hash be the result of computing a hash over the cData using the algorithm represented by the hashAlgorithm
member of C.
Using the credential public key looked up in step 1, verify that sig is a valid signature over the binary concatenation of aData and hash.
If the signature counter value adata.signCount
is nonzero or the value stored in conjunction with credential’s id
attribute is nonzero, then run the following substep:
If all the above steps are successful, continue with the authentication ceremony as appropriate. Otherwise, fail the authentication ceremony.
WebAuthn supports pluggable attestation statement formats. This section defines an initial set of such formats.
Attestation statement formats are identified by a string, called a attestation statement format identifier, chosen by the author of the attestation statement format.
Attestation statement format identifiers SHOULD be registered per [WebAuthn-Registries] "Registries for Web Authentication (WebAuthn)". All registered attestation statement format identifiers are unique amongst themselves as a matter of course.
Unregistered attestation statement format identifiers SHOULD use lowercase reverse domain-name naming, using a domain name registered by the developer, in order to assure uniqueness of the identifier. All attestation statement format identifiers MUST be a maximum of 32 octets in length and MUST consist only of printable USASCII characters, excluding backslash and doublequote, i.e., VCHAR as defined in [RFC5234] but without %x22 and %x5c.
Note: This means attestation statement format identifiers based on domain names MUST incorporate only LDH Labels [RFC5890].
Implementations MUST match WebAuthn attestation statement format identifiers in a case-sensitive fashion.
Attestation statement formats that may exist in multiple versions SHOULD include a version in their identifier. In effect, different versions are thus treated as different formats, e.g., packed2
as a new version of the packed
attestation statement format.
The following sections present a set of currently-defined and registered attestation statement formats and their identifiers. The up-to-date list of registered WebAuthn Extensions is maintained in the IANA "WebAuthn Attestation Statement Format Identifier" registry established by [WebAuthn-Registries].
This is a WebAuthn optimized attestation statement format. It uses a very compact but still extensible encoding method. It is implementable by authenticators with limited resources (e.g., secure elements).
Attestation statement format identifierpacked
Attestation types supportedAll
SyntaxThe syntax of a Packed Attestation statement is defined by the following CDDL:
$$attStmtType //= ( fmt: "packed", attStmt: packedStmtFormat ) packedStmtFormat = { alg: COSEAlgorithmIdentifier, sig: bytes, x5c: [ attestnCert: bytes, * (caCert: bytes) ] } // { alg: COSEAlgorithmIdentifier, (-260 for ED256 / -261 for ED512) sig: bytes, ecdaaKeyId: bytes }
The semantics of the fields are as follows:
algA COSEAlgorithmIdentifier
containing the identifier of the algorithm used to generate the attestation signature.
A byte string containing the attestation signature.
x5cThe elements of this array contain the attestation certificate and its certificate chain, each encoded in X.509 format. The attestation certificate must be the first element in the array.
ecdaaKeyIdThe identifier of the ECDAA-Issuer public key. This is the BigNumberToB encoding of the component "c" of the ECDAA-Issuer public key as defined section 3.3, step 3.5 in [FIDOEcdaaAlgorithm].
Signing procedureThe signing procedure for this attestation statement format is similar to the procedure for generating assertion signatures.
Let authenticatorData denote the authenticator data for the attestation, and let clientDataHash denote the hash of the serialized client data.
If Basic or Privacy CA attestation is in use, the authenticator produces the sig by concatenating authenticatorData and clientDataHash, and signing the result using an attestation private key selected through an authenticator-specific mechanism. It sets x5c to the certificate chain of the attestation public key and alg to the algorithm of the attestation private key.
If ECDAA is in use, the authenticator produces sig by concatenating authenticatorData and clientDataHash, and signing the result using ECDAA-Sign (see section 3.5 of [FIDOEcdaaAlgorithm]) after selecting an ECDAA-Issuer public key related to the ECDAA signature private key through an authenticator-specific mechanism (see [FIDOEcdaaAlgorithm]). It sets alg to the algorithm of the selected ECDAA-Issuer public key and ecdaaKeyId to the identifier of the ECDAA-Issuer public key (see above).
If self attestation is in use, the authenticator produces sig by concatenating authenticatorData and clientDataHash, and signing the result using the credential private key. It sets alg to the algorithm of the credential private key, and omits the other fields.
Given the verification procedure inputs attStmt, authenticatorData and clientDataHash, the verification procedure is as follows:
Verify that attStmt is valid CBOR conforming to the syntax defined above, and perform CBOR decoding on it to extract the contained fields.
If x5c is present, this indicates that the attestation type is not ECDAA. In this case:
Verify that sig is a valid signature over the concatenation of authenticatorData and clientDataHash using the attestation public key in x5c with the algorithm specified in alg.
Verify that x5c meets the requirements in §8.2.1 Packed attestation statement certificate requirements.
If x5c contains an extension with OID 1 3 6 1 4 1 45724 1 1 4
(id-fido-gen-ce-aaguid) verify that the value of this extension matches the aaguid
in authenticatorData.
If successful, return attestation type Basic and attestation trust path x5c.
If ecdaaKeyId is present, then the attestation type is ECDAA. In this case:
If neither x5c nor ecdaaKeyId is present, self attestation is in use.
Validate that alg matches the algorithm of the credentialPublicKey
in authenticatorData.
Verify that sig is a valid signature over the concatenation of authenticatorData and clientDataHash using the credential public key with alg.
If successful, return attestation type Self and empty attestation trust path.
The attestation certificate MUST have the following fields/extensions:
Version must be set to 3.
Subject field MUST be set to:
Subject-CCountry where the Authenticator vendor is incorporated
Subject-OLegal name of the Authenticator vendor
Subject-OUAuthenticator Attestation
Subject-CNNo stipulation.
If the related attestation root certificate is used for multiple authenticator models, the Extension OID 1 3 6 1 4 1 45724 1 1 4
(id-fido-gen-ce-aaguid) MUST be present, containing the AAGUID as value.
The Basic Constraints extension MUST have the CA component set to false
An Authority Information Access (AIA) extension with entry id-ad-ocsp
and a CRL Distribution Point extension [RFC5280] are both optional as the status of many attestation certificates is available through authenticator metadata services. See, for example, the FIDO Metadata Service [FIDOMetadataService].
This attestation statement format is generally used by authenticators that use a Trusted Platform Module as their cryptographic engine.
Attestation statement format identifiertpm
Attestation types supportedPrivacy CA, ECDAA
SyntaxThe syntax of a TPM Attestation statement is as follows:
$$attStmtType // = ( fmt: "tpm", attStmt: tpmStmtFormat ) tpmStmtFormat = { ver: "2.0", ( alg: COSEAlgorithmIdentifier, x5c: [ aikCert: bytes, * (caCert: bytes) ] ) // ( alg: COSEAlgorithmIdentifier, (-260 for ED256 / -261 for ED512) ecdaaKeyId: bytes ), sig: bytes, certInfo: bytes, pubArea: bytes }
The semantics of the above fields are as follows:
verThe version of the TPM specification to which the signature conforms.
algA COSEAlgorithmIdentifier
containing the identifier of the algorithm used to generate the attestation signature.
The AIK certificate used for the attestation and its certificate chain, in X.509 encoding.
ecdaaKeyIdThe identifier of the ECDAA-Issuer public key. This is the BigNumberToB encoding of the component "c" as defined section 3.3, step 3.5 in [FIDOEcdaaAlgorithm].
sigThe attestation signature, in the form of a TPMT_SIGNATURE structure as specified in [TPMv2-Part2] section 11.3.4.
certInfoThe TPMS_ATTEST structure over which the above signature was computed, as specified in [TPMv2-Part2] section 10.12.8.
pubAreaThe TPMT_PUBLIC structure (see [TPMv2-Part2] section 12.2.4) used by the TPM to represent the credential public key.
Signing procedureLet authenticatorData denote the authenticator data for the attestation, and let clientDataHash denote the hash of the serialized client data.
Concatenate authenticatorData and clientDataHash to form attToBeSigned.
Generate a signature using the procedure specified in [TPMv2-Part3] Section 18.2, using the attestation private key and setting the qualifyingData
parameter to attToBeSigned.
Set the pubArea field to the public area of the credential public key, the certInfo field to the output parameter of the same name, and the sig field to the signature obtained from the above procedure.
Verification procedureGiven the verification procedure inputs attStmt, authenticatorData and clientDataHash, the verification procedure is as follows:
Verify that attStmt is valid CBOR conforming to the syntax defined above, and perform CBOR decoding on it to extract the contained fields.
Verify that the public key specified by the parameters
and unique
fields of pubArea is identical to the credentialPublicKey
in the attestedCredentialData
in authenticatorData.
Concatenate authenticatorData and clientDataHash to form attToBeSigned.
Validate that certInfo is valid:
Verify that magic
is set to TPM_GENERATED_VALUE
.
Verify that type
is set to TPM_ST_ATTEST_CERTIFY
.
Verify that extraData
is set to attToBeSigned.
Verify that attested
contains a TPMS_CERTIFY_INFO
structure, whose name
field contains a valid Name for pubArea, as computed using the algorithm in the nameAlg
field of pubArea using the procedure specified in [TPMv2-Part1] section 16.
If x5c is present, this indicates that the attestation type is not ECDAA. In this case:
Verify the sig is a valid signature over certInfo using the attestation public key in x5c with the algorithm specified in alg.
Verify that x5c meets the requirements in §8.3.1 TPM attestation statement certificate requirements.
If x5c contains an extension with OID 1 3 6 1 4 1 45724 1 1 4
(id-fido-gen-ce-aaguid) verify that the value of this extension matches the aaguid
in authenticatorData.
If successful, return attestation type Privacy CA and attestation trust path x5c.
If ecdaaKeyId is present, then the attestation type is ECDAA.
TPM attestation certificate MUST have the following fields/extensions:
Version must be set to 3.
Subject field MUST be set to empty.
The Subject Alternative Name extension must be set as defined in [TPMv2-EK-Profile] section 3.2.9.
The Extended Key Usage extension MUST contain the "joint-iso-itu-t(2) internationalorganizations(23) 133 tcg-kp(8) tcg-kp-AIKCertificate(3)" OID.
The Basic Constraints extension MUST have the CA component set to false.
An Authority Information Access (AIA) extension with entry id-ad-ocsp
and a CRL Distribution Point extension [RFC5280] are both optional as the status of many attestation certificates is available through metadata services. See, for example, the FIDO Metadata Service [FIDOMetadataService].
When the authenticator in question is a platform-provided Authenticator on the Android "N" or later platform, the attestation statement is based on the Android key attestation. In these cases, the attestation statement is produced by a component running in a secure operating environment, but the authenticator data for the attestation is produced outside this environment. The Relying Party is expected to check that the authenticator data claimed to have been used for the attestation is consistent with the fields of the attestation certificate’s extension data.
Attestation statement format identifierandroid-key
Attestation types supportedBasic
SyntaxAn Android key attestation statement consists simply of the Android attestation statement, which is a series of DER encoded X.509 certificates. See the Android developer documentation. Its syntax is defined as follows:
$$attStmtType //= ( fmt: "android-key", attStmt: androidStmtFormat ) androidStmtFormat = { alg: COSEAlgorithmIdentifier, sig: bytes, x5c: [ credCert: bytes, * (caCert: bytes) ] }Signing procedure
Let authenticatorData denote the authenticator data for the attestation, and let clientDataHash denote the hash of the serialized client data.
Request an Android Key Attestation by calling "keyStore.getCertificateChain(myKeyUUID)") providing clientDataHash as the challenge value (e.g., by using setAttestationChallenge). Set x5c to the returned value.
The authenticator produces sig by concatenating authenticatorData and clientDataHash, and signing the result using the credential private key. It sets alg to the algorithm of the signature format.
Verification procedureGiven the verification procedure inputs attStmt, authenticatorData and clientDataHash, the verification procedure is as follows:
Verify that attStmt is valid CBOR conforming to the syntax defined above, and perform CBOR decoding on it to extract the contained fields.
Verify that the public key in the first certificate in the series of certificates represented by the signature matches the credentialPublicKey
in the attestedCredentialData
in authenticatorData.
Verify that in the attestation certificate extension data:
The value of the attestationChallenge
field is identical to the concatenation of authenticatorData and clientDataHash.
The AuthorizationList.allApplications
field is not present, since PublicKeyCredentials must be bound to the RP ID.
The value in the AuthorizationList.origin
field is equal to KM_TAG_GENERATED
.
The value in the AuthorizationList.purpose
field is equal to KM_PURPOSE_SIGN
.
If successful, return attestation type Basic with the attestation trust path set to the entire attestation statement.
When the authenticator in question is a platform-provided Authenticator on certain Android platforms, the attestation statement is based on the SafetyNet API. In this case the authenticator data is completely controlled by the caller of the SafetyNet API (typically an application running on the Android platform) and the attestation statement only provides some statements about the health of the platform and the identity of the calling application.
Attestation statement format identifierandroid-safetynet
Attestation types supportedBasic
SyntaxThe syntax of an Android Attestation statement is defined as follows:
$$attStmtType //= ( fmt: "android-safetynet", attStmt: safetynetStmtFormat ) safetynetStmtFormat = { ver: text, response: bytes }
The semantics of the above fields are as follows:
verThe version number of Google Play Services responsible for providing the SafetyNet API.
responseThe UTF-8 encoded result of the getJwsResult() call of the SafetyNet API. This value is a JWS [RFC7515] object (see SafetyNet online documentation) in Compact Serialization.
Signing procedureLet authenticatorData denote the authenticator data for the attestation, and let clientDataHash denote the hash of the serialized client data.
Concatenate authenticatorData and clientDataHash to form attToBeSigned.
Request a SafetyNet attestation, providing attToBeSigned as the nonce value. Set response to the result, and ver to the version of Google Play Services running in the authenticator.
Verification procedureGiven the verification procedure inputs attStmt, authenticatorData and clientDataHash, the verification procedure is as follows:
Verify that attStmt is valid CBOR conforming to the syntax defined above, and perform CBOR decoding on it to extract the contained fields.
Verify that response is a valid SafetyNet response of version ver.
Verify that the nonce in the response is identical to the concatenation of authenticatorData and clientDataHash.
Verify that the attestation certificate is issued to the hostname "attest.android.com" (see SafetyNet online documentation).
Verify that the ctsProfileMatch
attribute in the payload of response is true.
If successful, return attestation type Basic with the attestation trust path set to the above attestation certificate.
This attestation statement format is used with FIDO U2F authenticators using the formats defined in [FIDO-U2F-Message-Formats].
Attestation statement format identifierfido-u2f
Attestation types supportedBasic, self attestation
SyntaxThe syntax of a FIDO U2F attestation statement is defined as follows:
$$attStmtType //= ( fmt: "fido-u2f", attStmt: u2fStmtFormat ) u2fStmtFormat = { x5c: [ attestnCert: bytes, * (caCert: bytes) ], sig: bytes }
The semantics of the above fields are as follows:
x5cThe elements of this array contain the attestation certificate and its certificate chain, each encoded in X.509 format. The attestation certificate must be the first element in the array.
sigThe attestation signature. The signature was calculated over the (raw) U2F registration response message [FIDO-U2F-Message-Formats] received by the platform from the authenticator.
Signing procedureIf the credential public key of the given credential is not of algorithm -7 ("ES256"), stop and return an error. Otherwise, let authenticatorData denote the authenticator data for the attestation, and let clientDataHash denote the hash of the serialized client data.
If clientDataHash is 256 bits long, set tbsHash to this value. Otherwise set tbsHash to the SHA-256 hash of clientDataHash.
Generate a Registration Response Message as specified in [FIDO-U2F-Message-Formats] section 4.3, with the application parameter set to the SHA-256 hash of the RP ID associated with the given credential, the challenge parameter set to tbsHash, and the key handle parameter set to the credential ID of the given credential. Set the raw signature part of this Registration Response Message (i.e., without the user public key, key handle, and attestation certificates) as sig and set the attestation certificates of the attestation public key as x5c.
Verification procedureGiven the verification procedure inputs attStmt, authenticatorData and clientDataHash, the verification procedure is as follows:
Verify that attStmt is valid CBOR conforming to the syntax defined above, and perform CBOR decoding on it to extract the contained fields.
Let attCert be value of the first element of x5c. Let certificate public key be the public key conveyed by attCert. If certificate public key is not an Elliptic Curve (EC) public key over the P-256 curve, terminate this algorithm and return an appropriate error.
Extract the claimed rpIdHash from authenticatorData, and the claimed credentialId and credentialPublicKey from authenticatorData.attestedCredentialData
.
If clientDataHash is 256 bits long, set tbsHash to this value. Otherwise set tbsHash to the SHA-256 hash of clientDataHash.
Convert the COSE_KEY formatted credentialPublicKey (see Section 7 of [RFC8152]) to CTAP1/U2F public Key format [FIDO-CTAP].
Let publicKeyU2F represent the result of the conversion operation and set its first byte to 0x04. Note: This signifies uncompressed ECC key format.
Extract the value corresponding to the "-2" key (representing x coordinate) from credentialPublicKey, confirm its size to be of 32 bytes and concatenate it with publicKeyU2F. If size differs or "-2" key is not found, terminate this algorithm and return an appropriate error.
Extract the value corresponding to the "-3" key (representing y coordinate) from credentialPublicKey, confirm its size to be of 32 bytes and concatenate it with publicKeyU2F. If size differs or "-3" key is not found, terminate this algorithm and return an appropriate error.
Let verificationData be the concatenation of (0x00 || rpIdHash || tbsHash || credentialId || publicKeyU2F) (see Section 4.3 of [FIDO-U2F-Message-Formats]).
Verify the sig using verificationData and certificate public key per [SEC1].
If successful, return attestation type Basic with the attestation trust path set to x5c.
The mechanism for generating public key credentials, as well as requesting and generating Authentication assertions, as defined in §5 Web Authentication API, can be extended to suit particular use cases. Each case is addressed by defining a registration extension and/or an authentication extension.
Every extension is a client extension, meaning that the extension involves communication with and processing by the client. Client extensions define the following steps and data:
When creating a public key credential or requesting an authentication assertion, a Relying Party can request the use of a set of extensions. These extensions will be invoked during the requested operation if they are supported by the client and/or the authenticator. The Relying Party sends the client extension input for each extension in the get()
call (for authentication extensions) or create()
call (for registration extensions) to the client platform. The client platform performs client extension processing for each extension that it supports, and augments the client data as specified by each extension, by including the extension identifier and client extension output values.
An extension can also be an authenticator extension, meaning that the extension invoves communication with and processing by the authenticator. Authenticator extensions define the following steps and data:
For authenticator extensions, as part of the client extension processing, the client also creates the CBOR authenticator extension input value for each extension (often based on the corresponding client extension input value), and passes them to the authenticator in the create()
call (for registration extensions) or the get()
call (for authentication extensions). These authenticator extension input values are represented in CBOR and passed as name-value pairs, with the extension identifier as the name, and the corresponding authenticator extension input as the value. The authenticator, in turn, performs additional processing for the extensions that it supports, and returns the CBOR authenticator extension output for each as specified by the extension. Part of the client extension processing for authenticator extensions is to use the authenticator extension output as an input to creating the client extension output.
All WebAuthn extensions are optional for both clients and authenticators. Thus, any extensions requested by a Relying Party may be ignored by the client browser or OS and not passed to the authenticator at all, or they may be ignored by the authenticator. Ignoring an extension is never considered a failure in WebAuthn API processing, so when Relying Parties include extensions with any API calls, they must be prepared to handle cases where some or all of those extensions are ignored.
Clients wishing to support the widest possible range of extensions may choose to pass through any extensions that they do not recognize to authenticators, generating the authenticator extension input by simply encoding the client extension input in CBOR. All WebAuthn extensions MUST be defined in such a way that this implementation choice does not endanger the user’s security or privacy. For instance, if an extension requires client processing, it could be defined in a manner that ensures such a naïve pass-through will produce a semantically invalid authenticator extension input value, resulting in the extension being ignored by the authenticator. Since all extensions are optional, this will not cause a functional failure in the API operation. Likewise, clients can choose to produce a client extension output value for an extension that it does not understand by encoding the authenticator extension output value into JSON, provided that the CBOR output uses only types present in JSON.
The IANA "WebAuthn Extension Identifier" registry established by [WebAuthn-Registries] should be consulted for an up-to-date list of registered WebAuthn Extensions.
Extensions are identified by a string, called an extension identifier, chosen by the extension author.
Extension identifiers SHOULD be registered per [WebAuthn-Registries] "Registries for Web Authentication (WebAuthn)". All registered extension identifiers are unique amongst themselves as a matter of course.
Unregistered extension identifiers should aim to be globally unique, e.g., by including the defining entity such as myCompany_extension
.
All extension identifiers MUST be a maximum of 32 octets in length and MUST consist only of printable USASCII characters, excluding backslash and doublequote, i.e., VCHAR as defined in [RFC5234] but without %x22 and %x5c. Implementations MUST match WebAuthn extension identifiers in a case-sensitive fashion.
Extensions that may exist in multiple versions should take care to include a version in their identifier. In effect, different versions are thus treated as different extensions, e.g., myCompany_extension_01
§10 Defined Extensions defines an initial set of extensions and their identifiers. See the IANA "WebAuthn Extension Identifier" registry established by [WebAuthn-Registries] for an up-to-date list of registered WebAuthn Extension Identifiers.
A definition of an extension must specify an extension identifier, a client extension input argument to be sent via the get()
or create()
call, the client extension processing rules, and a client extension output value. If the extension communicates with the authenticator (meaning it is an authenticator extension), it must also specify the CBOR authenticator extension input argument sent via the authenticatorGetAssertion or authenticatorMakeCredential call, the authenticator extension processing rules, and the CBOR authenticator extension output value.
Any client extension that is processed by the client MUST return a client extension output value so that the Relying Party knows that the extension was honored by the client. Similarly, any extension that requires authenticator processing MUST return an authenticator extension output to let the Relying Party know that the extension was honored by the authenticator. If an extension does not otherwise require any result values, it SHOULD be defined as returning a JSON Boolean client extension output result, set to true
to signify that the extension was understood and processed. Likewise, any authenticator extension that does not otherwise require any result values MUST return a value and SHOULD return a CBOR Boolean authenticator extension output result, set to true
to signify that the extension was understood and processed.
An extension defines one or two request arguments. The client extension input, which is a value that can be encoded in JSON, is passed from the Relying Party to the client in the get()
or create()
call, while the CBOR authenticator extension input is passed from the client to the authenticator for authenticator extensions during the processing of these calls.
A Relying Party simultaneously requests the use of an extension and sets its client extension input by including an entry in the extensions
option to the create()
or get()
call. The entry key is the extension identifier and the value is the client extension input.
var assertionPromise = navigator.credentials.get({ publicKey: { challenge: "...", extensions: { "webauthnExample_foobar": 42 } } });
Extension definitions MUST specify the valid values for their client extension input. Clients SHOULD ignore extensions with an invalid client extension input. If an extension does not require any parameters from the Relying Party, it SHOULD be defined as taking a Boolean client argument, set to true
to signify that the extension is requested by the Relying Party.
Extensions that only affect client processing need not specify authenticator extension input. Extensions that have authenticator processing MUST specify the method of computing the authenticator extension input from the client extension input. For extensions that do not require input parameters and are defined as taking a Boolean client extension input value set to true
, this method SHOULD consist of passing an authenticator extension input value of true
(CBOR major type 7, value 21).
Note: Extensions should aim to define authenticator arguments that are as small as possible. Some authenticators communicate over low-bandwidth links such as Bluetooth Low-Energy or NFC.
Extensions may define additional processing requirements on the client platform during the creation of credentials or the generation of an assertion. The client extension input for the extension is used an input to this client processing. Supported client extensions are recorded as a dictionary in the client data with the key clientExtensions
. For each such extension, the client adds an entry to this dictionary with the extension identifier as the key, and the extension’s client extension input as the value.
Likewise, the client extension outputs are represented as a dictionary in the result of getClientExtensionResults()
with extension identifiers as keys, and the client extension output value of each extension as the value. Like the client extension input, the client extension output is a value that can be encoded in JSON.
Extensions that require authenticator processing MUST define the process by which the client extension input can be used to determine the CBOR authenticator extension input and the process by which the CBOR authenticator extension output can be used to determine the client extension output.
The CBOR authenticator extension input value of each processed authenticator extension is included in the extensions data part of the authenticator request. This part is a CBOR map, with CBOR extension identifier values as keys, and the CBOR authenticator extension input value of each extension as the value.
Likewise, the extension output is represented in the authenticator data as a CBOR map with CBOR extension identifiers as keys, and the CBOR authenticator extension output value of each extension as the value.
The authenticator extension processing rules are used create the authenticator extension output from the authenticator extension input, and possibly also other inputs, for each extension.
This section is not normative.
To illustrate the requirements above, consider a hypothetical registration extension and authentication extension "Geo". This extension, if supported, enables a geolocation location to be returned from the authenticator or client to the Relying Party.
The extension identifier is chosen as webauthnExample_geo
. The client extension input is the constant value true
, since the extension does not require the Relying Party to pass any particular information to the client, other than that it requests the use of the extension. The Relying Party sets this value in its request for an assertion:
var assertionPromise = navigator.credentials.get({ publicKey: { challenge: "SGFuIFNvbG8gc2hvdCBmaXJzdC4", allowCredentials: [], /* Empty filter */ extensions: { 'webauthnExample_geo': true } } });
The extension also requires the client to set the authenticator parameter to the fixed value true
.
The extension requires the authenticator to specify its geolocation in the authenticator extension output, if known. The extension e.g. specifies that the location shall be encoded as a two-element array of floating point numbers, encoded with CBOR. An authenticator does this by including it in the authenticator data. As an example, authenticator data may be as follows (notation taken from [RFC7049]):
81 (hex) -- Flags, ED and UP both set. 20 05 58 1F -- Signature counter A1 -- CBOR map of one element 73 -- Key 1: CBOR text string of 19 bytes 77 65 62 61 75 74 68 6E 45 78 61 6D 70 6C 65 5F 67 65 6F -- "webauthnExample_geo" [=UTF-8 encoded=] string 82 -- Value 1: CBOR array of two elements FA 42 82 1E B3 -- Element 1: Latitude as CBOR encoded float FA C1 5F E3 7F -- Element 2: Longitude as CBOR encoded float
The extension defines the client extension output to be the geolocation information, if known, as a GeoJSON [GeoJSON] point. The client constructs the following client data:
{ ..., 'extensions': { 'webauthnExample_geo': { 'type': 'Point', 'coordinates': [65.059962, -13.993041] } } }
This section defines the initial set of extensions to be registered in the IANA "WebAuthn Extension Identifier" registry established by [WebAuthn-Registries]. These are recommended for implementation by user agents targeting broad interoperability.
This authentication extension allows Relying Parties that have previously registered a credential using the legacy FIDO JavaScript APIs to request an assertion. Specifically, this extension allows Relying Parties to specify an appId [FIDO-APPID] to overwrite the otherwise computed rpId. This extension is only valid if used during the get()
call; other usage will result in client error.
appid
A single JSON string specifying a FIDO appId.
Client extension processingIf rpId
is present, reject promise with a DOMException whose name is "NotAllowedError
", and terminate this algorithm. Replace the calculation of rpId in Step 3 of §5.1.4 Use an existing credential to make an assertion with the following procedure: The client uses the value of appid to perform the AppId validation procedure (as defined by [FIDO-APPID]). If valid, the value of rpId for all client processing should be replaced by the value of appid.
Returns the JSON value true
to indicate to the RP that the extension was acted upon
None.
Authenticator extension processingNone.
Authenticator extension outputNone.
This registration extension and authentication extension allows for a simple form of transaction authorization. A Relying Party can specify a prompt string, intended for display on a trusted device on the authenticator.
Extension identifiertxAuthSimple
A single JSON string prompt.
Client extension processingNone, except creating the authenticator extension input from the client extension input.
Client extension outputReturns the authenticator extension output string UTF-8 decoded into a JSON string
Authenticator extension inputThe client extension input encoded as a CBOR text string (major type 3).
Authenticator extension processingThe authenticator MUST display the prompt to the user before performing either user verification or test of user presence. The authenticator may insert line breaks if needed.
Authenticator extension outputA single CBOR string, representing the prompt as displayed (including any eventual line breaks).
This registration extension and authentication extension allows images to be used as transaction authorization prompts as well. This allows authenticators without a font rendering engine to be used and also supports a richer visual appearance.
Extension identifiertxAuthGeneric
A CBOR map defined as follows:
txAuthGenericArg = { contentType: text, ; MIME-Type of the content, e.g. "image/png" content: bytes }Client extension processing
None, except creating the authenticator extension input from the client extension input.
Client extension outputReturns the base64url encoding of the authenticator extension output value as a JSON string
Authenticator extension inputThe client extension input encoded as a CBOR map.
Authenticator extension processingThe authenticator MUST display the content
to the user before performing either user verification or test of user presence. The authenticator may add other information below the content
. No changes are allowed to the content
itself, i.e., inside content
boundary box.
The hash value of the content
which was displayed. The authenticator MUST use the same hash algorithm as it uses for the signature itself.
This registration extension allows a Relying Party to guide the selection of the authenticator that will be leveraged when creating the credential. It is intended primarily for Relying Parties that wish to tightly control the experience around credential creation.
Extension identifierauthnSel
A sequence of AAGUIDs:
typedef sequence<AAGUID> AuthenticatorSelectionList
;
Each AAGUID corresponds to an authenticator model that is acceptable to the Relying Party for this credential creation. The list is ordered by decreasing preference.
An AAGUID is defined as an array containing the globally unique identifier of the authenticator model being sought.
typedef BufferSource AAGUID
;
Client extension processingThis extension can only be used during create()
. If the client supports the Authenticator Selection Extension, it MUST use the first available authenticator whose AAGUID is present in the AuthenticatorSelectionList
. If none of the available authenticators match a provided AAGUID, the client MUST select an authenticator from among the available authenticators to generate the credential.
Returns the JSON value true
to indicate to the RP that the extension was acted upon
None.
Authenticator extension processingNone.
Authenticator extension outputNone.
This registration extension enables the Relying Party to determine which extensions the authenticator supports.
Extension identifierexts
The Boolean value true
to indicate that this extension is requested by the Relying Party.
None, except creating the authenticator extension input from the client extension input.
Client extension outputReturns the list of supported extensions as a JSON array of extension identifier strings
Authenticator extension inputThe Boolean value true
, encoded in CBOR (major type 7, value 21).
The authenticator sets the authenticator extension output to be a list of extensions that the authenticator supports, as defined below. This extension can be added to attestation objects.
Authenticator extension outputThe SupportedExtensions extension is a list (CBOR array) of extension identifier (UTF-8 encoded strings).
This registration extension and authentication extension enables use of a user verification index.
Extension identifieruvi
The Boolean value true
to indicate that this extension is requested by the Relying Party.
None, except creating the authenticator extension input from the client extension input.
Client extension outputReturns a JSON string containing the base64url encoding of the authenticator extension output
Authenticator extension inputThe Boolean value true
, encoded in CBOR (major type 7, value 21).
The authenticator sets the authenticator extension output to be a user verification index indicating the method used by the user to authorize the operation, as defined below. This extension can be added to attestation objects and assertions.
Authenticator extension outputThe user verification index (UVI) is a value uniquely identifying a user verification data record. The UVI is encoded as CBOR byte string (type 0x58). Each UVI value MUST be specific to the related key (in order to provide unlinkability). It also must contain sufficient entropy that makes guessing impractical. UVI values MUST NOT be reused by the Authenticator (for other biometric data or users).
The UVI data can be used by servers to understand whether an authentication was authorized by the exact same biometric data as the initial key generation. This allows the detection and prevention of "friendly fraud".
As an example, the UVI could be computed as SHA256(KeyID || SHA256(rawUVI)), where ||
represents concatenation, and the rawUVI reflects (a) the biometric reference data, (b) the related OS level user ID and (c) an identifier which changes whenever a factory reset is performed for the device, e.g. rawUVI = biometricReferenceData || OSLevelUserID || FactoryResetCounter.
Servers supporting UVI extensions MUST support a length of up to 32 bytes for the UVI value.
Example for authenticator data containing one UVI extension
... -- [=RP ID=] hash (32 bytes) 81 -- UP and ED set 00 00 00 01 -- (initial) signature counter ... -- all public key alg etc. A1 -- extension: CBOR map of one element 63 -- Key 1: CBOR text string of 3 bytes 75 76 69 -- "uvi" [=UTF-8 encoded=] string 58 20 -- Value 1: CBOR byte string with 0x20 bytes 00 43 B8 E3 BE 27 95 8C -- the UVI value itself 28 D5 74 BF 46 8A 85 CF 46 9A 14 F0 E5 16 69 31 DA 4B CF FF C1 BB 11 32 82
The location registration extension and authentication extension provides the client device’s current location to the WebAuthn Relying Party.
Extension identifierloc
The Boolean value true
to indicate that this extension is requested by the Relying Party.
None, except creating the authenticator extension input from the client extension input.
Client extension outputReturns a JSON object that encodes the location information in the authenticator extension output as a Coordinates value, as defined by The W3C Geolocation API Specification.
Authenticator extension inputThe Boolean value true
, encoded in CBOR (major type 7, value 21).
If the authenticator does not support the extension, then the authenticator MUST ignore the extension request. If the authenticator accepts the extension, then the authenticator SHOULD only add this extension data to a packed attestation or assertion.
Authenticator extension outputIf the authenticator accepts the extension request, then authenticator extension output SHOULD provide location data in the form of a CBOR-encoded map, with the first value being the extension identifier and the second being an array of returned values. The array elements SHOULD be derived from (key,value) pairings for each location attribute that the authenticator supports. The following is an example of authenticator data where the returned array is comprised of a {longitude, latitude, altitude} triplet, following the coordinate representation defined in The W3C Geolocation API Specification.
... -- [=RP ID=] hash (32 bytes) 81 -- UP and ED set 00 00 00 01 -- (initial) signature counter ... -- all public key alg etc. A1 -- extension: CBOR map of one element 63 -- Value 1: CBOR text string of 3 bytes 6C 6F 63 -- "loc" [=UTF-8 encoded=] string 86 -- Value 2: array of 6 elements 68 -- Element 1: CBOR text string of 8 bytes 6C 61 74 69 74 75 64 65 -- “latitude” [=UTF-8 encoded=] string FB ... -- Element 2: Latitude as CBOR encoded double-precision float 69 -- Element 3: CBOR text string of 9 bytes 6C 6F 6E 67 69 74 75 64 65 -- “longitude” [=UTF-8 encoded=] string FB ... -- Element 4: Longitude as CBOR encoded double-precision float 68 -- Element 5: CBOR text string of 8 bytes 61 6C 74 69 74 75 64 65 -- “altitude” [=UTF-8 encoded=] string FB ... -- Element 6: Altitude as CBOR encoded double-precision float
This registration extension and authentication extension enables use of a user verification method.
Extension identifieruvm
The Boolean value true to indicate that this extension is requested by the WebAuthn Relying Party.
Client extension processingNone, except creating the authenticator extension input from the client extension input.
Client extension outputReturns a JSON array of 3-element arrays of numbers that encodes the factors in the authenticator extension output
Authenticator extension inputThe Boolean value true
, encoded in CBOR (major type 7, value 21).
The authenticator sets the authenticator extension output to be a user verification index indicating the method used by the user to authorize the operation, as defined below. This extension can be added to attestation objects and assertions.
Authenticator extension outputAuthenticators can report up to 3 different user verification methods (factors) used in a single authentication instance, using the CBOR syntax defined below:
uvmFormat = [ 1*3 uvmEntry ] uvmEntry = [ userVerificationMethod: uint .size 4, keyProtectionType: uint .size 2, matcherProtectionType: uint .size 2 ]
The semantics of the fields in each uvmEntry
are as follows:
The authentication method/factor used by the authenticator to verify the user. Available values are defined in [FIDOReg], "User Verification Methods" section.
keyProtectionTypeThe method used by the authenticator to protect the FIDO registration private key material. Available values are defined in [FIDOReg], "Key Protection Types" section.
matcherProtectionTypeThe method used by the authenticator to protect the matcher that performs user verification. Available values are defined in [FIDOReg], "Matcher Protection Types" section.
If >3 factors can be used in an authentication instance the authenticator vendor must select the 3 factors it believes will be most relevant to the Server to include in the UVM.
Example for authenticator data containing one UVM extension for a multi-factor authentication instance where 2 factors were used:
... -- [=RP ID=] hash (32 bytes) 81 -- UP and ED set 00 00 00 01 -- (initial) signature counter ... -- all public key alg etc. A1 -- extension: CBOR map of one element 63 -- Key 1: CBOR text string of 3 bytes 75 76 6d -- "uvm" [=UTF-8 encoded=] string 82 -- Value 1: CBOR array of length 2 indicating two factor usage 83 -- Item 1: CBOR array of length 3 02 -- Subitem 1: CBOR integer for User Verification Method Fingerprint 04 -- Subitem 2: CBOR short for Key Protection Type TEE 02 -- Subitem 3: CBOR short for Matcher Protection Type TEE 83 -- Item 2: CBOR array of length 3 04 -- Subitem 1: CBOR integer for User Verification Method Passcode 01 -- Subitem 2: CBOR short for Key Protection Type Software 01 -- Subitem 3: CBOR short for Matcher Protection Type Software
This section registers the attestation statement formats defined in Section §8 Defined Attestation Statement Formats in the IANA "WebAuthn Attestation Statement Format Identifier" registry established by [WebAuthn-Registries].
WebAuthn Attestation Statement Format Identifier: packed
Description: The "packed" attestation statement format is a WebAuthn-optimized format for attestation. It uses a very compact but still extensible encoding method. This format is implementable by authenticators with limited resources (e.g., secure elements).
Specification Document: Section §8.2 Packed Attestation Statement Format of this specification
WebAuthn Attestation Statement Format Identifier: tpm
Description: The TPM attestation statement format returns an attestation statement in the same format as the packed attestation statement format, although the the rawData and signature fields are computed differently.
Specification Document: Section §8.3 TPM Attestation Statement Format of this specification
WebAuthn Attestation Statement Format Identifier: android-key
Description: Platform-provided authenticators based on versions "N", and later, may provide this proprietary "hardware attestation" statement.
Specification Document: Section §8.4 Android Key Attestation Statement Format of this specification
WebAuthn Attestation Statement Format Identifier: android-safetynet
Description: Android-based, platform-provided authenticators may produce an attestation statement based on the Android SafetyNet API.
Specification Document: Section §8.5 Android SafetyNet Attestation Statement Format of this specification
WebAuthn Attestation Statement Format Identifier: fido-u2f
Description: Used with FIDO U2F authenticators
Specification Document: Section §8.6 FIDO U2F Attestation Statement Format of this specification
This section registers the extension identifier values defined in Section §9 WebAuthn Extensions in the IANA "WebAuthn Extension Identifier" registry established by [WebAuthn-Registries].
This section registers identifiers for RSASSA-PKCS1-v1_5 [RFC8017] algorithms using SHA-2 hash functions in the IANA COSE Algorithms registry [IANA-COSE-ALGS-REG].
Name: RS256
Value: -257
Description: RSASSA-PKCS1-v1_5 w/ SHA-256
Reference: Section 8.2 of [RFC8017]
Recommended: No
Name: RS384
Value: -258
Description: RSASSA-PKCS1-v1_5 w/ SHA-384
Reference: Section 8.2 of [RFC8017]
Recommended: No
Name: RS512
Value: -259
Description: RSASSA-PKCS1-v1_5 w/ SHA-512
Reference: Section 8.2 of [RFC8017]
Recommended: No
Name: ED256
Value: -260
Description: TPM_ECC_BN_P256 curve w/ SHA-256
Reference: Section 4.2 of [FIDOEcdaaAlgorithm]
Recommended: Yes
Name: ED512
Value: -261
Description: ECC_BN_ISOP512 curve w/ SHA-512
Reference: Section 4.2 of [FIDOEcdaaAlgorithm]
Recommended: Yes
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 an external first-factor 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 platform. For instance, this flow also works without modification for the case of an authenticator that is embedded in the client platform. 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.
This is the first-time flow, in which a new credential is created and registered with the server. In this flow, the 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 platform connects to the authenticator, performing any pairing actions if necessary.
The authenticator shows appropriate UI for the user to select the authenticator on which the new credential will be created, and obtains a biometric or other authorization gesture from the user.
The authenticator returns a response to the client platform, 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 (!PublicKeyCredential) { /* Platform not capable. Handle error. */ } var publicKey = { challenge: Uint8Array.from(window.atob("PGifxAoBwCkWkm4b1CiIl5otCphiIh6MijdjbWFjomA="), c=>c.charCodeAt(0)), // Relying Party: rp: { name: "Acme" }, // User: user: { id: Uint8Array.from(window.atob("MIIBkzCCATigAwIBAjCCAZMwggE4oAMCAQIwggGTMII="), c=>c.charCodeAt(0)), name: "john.p.smith@example.com", displayName: "John P. Smith", icon: "https://pics.acme.com/00/p/aBjjjpqPb.png" }, // 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" } ], timeout: 60000, // 1 minute excludeCredentials: [], // No exclude list of PKCredDescriptors extensions: {"webauthn.location": true} // Include location information // in attestation }; // 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. });
This is flow for when the Relying Party is specifically interested in creating a public key credential with a 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 asks the user whether they are willing to register with the Relying Party using an available platform authenticator.
If the user is not willing, terminate this flow.
The user is shown appropriate UI and guided in creating a credential using one of the available platform authenticators. Upon successful credential creation, the RP script conveys the new credential to the server.
if (!PublicKeyCredential) { /* Platform not capable of the API. Handle error. */ } PublicKeyCredential.isPlatformAuthenticatorAvailable() .then(function (userIntent) { // If the user has affirmed willingness to register with RP using an available platform authenticator if (userIntent) { var publicKeyOptions = { /* Public key credential creation options. */}; // Create and register credentials. return navigator.credentials.create({ "publicKey": publicKeyOptions }); } else { // Record that the user does not intend to use a platform authenticator // and default the user to a password-based flow in the future. } }).then(function (newCredentialInfo) { // Send new credential info to server for verification and registration. }).catch( function(err) { // Something went wrong. Handle appropriately. });
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 platform for an Authentication Assertion, providing as much information as possible to narrow the choice of acceptable credentials for the user. This may 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 platform connects to the authenticator, performing any pairing actions if necessary.
The authenticator presents the user with a notification that their attention is required. 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 platform, 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 it is database, and verifies the assertion’s authentication 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 (!PublicKeyCredential) { /* Platform not capable. Handle error. */ } var options = { challenge: new TextEncoder().encode("climb a mountain"), timeout: 60000, // 1 minute allowCredentials: [{ type: "public-key" }] }; 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 extension for transaction authorization.
if (!PublicKeyCredential) { /* Platform not capable. Handle error. */ } var encoder = new TextEncoder(); var acceptableCredential1 = { type: "public-key", id: encoder.encode("!!!!!!!hi there!!!!!!!\n") }; var acceptableCredential2 = { type: "public-key", id: encoder.encode("roses are red, violets are blue\n") }; var options = { challenge: encoder.encode("climb a mountain"), timeout: 60000, // 1 minute allowCredentials: [acceptableCredential1, acceptableCredential2], extensions: { 'webauthn.txauth.simple': "Wave your hands in the air like you just don’t care" } }; 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. });
The below example shows how a developer may use the AbortSignal parameter to abort a credential registration operation. A similiar 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 auth occurs. if (widget == "disappear") { authAbortSignal.abort(); }
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 device.
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 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 device.
User employs a device-specific method (e.g., device settings UI) to delete a credential from their device.
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.
ncG1vNJzZmirY2Ourq3ZqKWar6NjsLC5jqmpZqiimsOqsdZoeKeflaG8jK3IaK6empGqwam6jpqZqKqkY7W1ucs%3D