The English version of this specification is the only normative version. Non-normative translations may also be available.
Copyright © 2013-2015 FIDO Alliance All Rights Reserved.
This document specifies an API that enables web pages to access FIDO 2.0 compliant strong cryptographic credentials through browser script. Conceptually, credentials are stored on a FIDO 2.0 authenticator, and each credential is bound to a single Relying Party. Authenticators are responsible for ensuring that no operation is performed without the user's consent. The user agent mediates access to credentials in order to preserve user privacy.
This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current FIDO Alliance publications and the latest revision of this technical report can be found in the FIDO Alliance specifications index at https://www.fidoalliance.org/specifications/.
This document was published by the FIDO Alliance as a Proposed Standard. If you wish to make comments regarding this document, please Contact Us. All comments are welcome.
Implementation of certain elements of this Specification may require licenses under third party intellectual property rights, including without limitation, patent rights. The FIDO Alliance, Inc. and its Members and any other contributors to the Specification are not, and shall not be held, responsible in any manner for identifying or failing to identify any or all such third party intellectual property rights.
THIS FIDO ALLIANCE SPECIFICATION IS PROVIDED “AS IS” AND WITHOUT ANY WARRANTY OF ANY KIND, INCLUDING, WITHOUT LIMITATION, ANY EXPRESS OR IMPLIED WARRANTY OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
This document has been reviewed by FIDO Aliance Members and is endorsed as a Proposed Standard. It is a stable document and may be used as reference material or cited from another document. FIDO Alliance's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment.
This section is non-normative.
This document specifies an API for web pages to access FIDO 2.0 credentials through JavaScript, for the purpose of strongly authenticating a user. FIDO 2.0 credentials are always bound to a single FIDO Relying Party, and the API respects this requirement. Credentials created by a Relying Party can only be accessed by web origins belonging to that Relying Party. Additionally, privacy across Relying Parties must be maintained; scripts must not be able to detect any properties, or even the existence, of credentials belonging to other Relying Parties.
FIDO 2.0 credentials are located on authenticators, which can use them to perform operations subject to user consent. Broadly, authenticators are of two types:
Note that an external authenticator may itself contain an embedded authenticator. For example, consider a smart phone that contains a FIDO 2.0 credential. The credential may be accessed by a web browser running on the phone itself. In this case the module containing the credential is functioning as an embedded authenticator. However, the credential may also be accessed over BLE by a user agent on a nearby laptop. In this latter case, the phone is functioning as an external authenticator. These modes may even be used in a single end-to-end user scenario. One such scenario is described in the remainder of this section.
A variety of additional use cases and configurations are also possible, including (but not limited to):
As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.
The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this specification are to be interpreted as described in [RFC2119].
This specification defines criteria for a conforming user agent. A user agent MUST behave as described in this specification in order to be considered conformant. 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 FIDO Credential API user agent MUST also be a conforming implementation of the IDL fragments of this specification, as described in the “Web IDL” specification. [WebIDL-ED]
This specification relies on several other underlying specifications.
The API specified in this document implies a specific abstract functional model for a FIDO authenticator. This section describes the FIDO authenticator model. Client platforms may implement and expose this abstract model in any way desired. However, the behavior of the client's FIDO Credential API implementation, when operating on the embedded and external authenticators supported by that platform, MUST be indistinguishable from the behavior specified in the FIDO Credential API section.
In this abstract model, each FIDO authenticator stores some number of FIDO credentials. Each FIDO credential has an identifier which is unique (or extremely unlikely to be duplicated) among all FIDO credentials. Each credential is also associated with a FIDO Relying Party, whose identity is represented by a Relying Party Identifier (RP ID).
A client must connect to a FIDO authenticator in order to invoke any of the operations of that authenticator. This connection defines an authenticator session. A FIDO 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:
getAssertion
method, specified below.When this operation is invoked, the authenticator obtains user consent for creating 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. Once user consent is obtained, the authenticator generates the appropriate cryptographic keys and creates a new credential. It then associates the credential with the specified RP ID such that it will be able to retrieve the RP ID later, given the credential ID.
On successful completion of this operation, the authenticator returns the type and unique identifier of this new credential to the user agent.
If the user refuses consent, the authenticator returns an appropriate error status 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:
makeCredential
method, specified below.When this method is invoked, the authenticator allows the user to select a credential from among the credentials associated with that Relying Party and matching the specified criteria, then obtains user consent for using that credential. 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. Once a credential is selected and user consent is obtained, the authenticator computes a cryptographic signature using the credential's private key and constructs an assertion as specified in [FIDOSignatureFormat]. It then returns this assertion to the user agent.
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.
This section normatively specifies the API for creating and using FIDO 2.0 credentials. Support for deleting credentials is deliberately omitted; this is expected to be done through platform-specific user interfaces rather than from a script. The basic idea is that the credentials belong to the user and are managed by the browser and underlying platform. Scripts can (with the user's consent) request the browser to create a new credential for future use by the script's origin. Scripts can also request the user’s permission to perform authentication operations with an existing credential held by the platform. However, all such operations 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.
User agents SHOULD only expose this API to callers in secure contexts, as defined in [powerful-features].
In the future, this API may be integrated into a more general Web API framework for credential management, which is being worked on in the W3C. Such integration will, most likely, create intermediate interface and dictionary types, from which the types in this document will then inherit. However the experience of the FIDO developer and end user will not be substantially changed by this. In the meantime, this specification is maintained in a more minimal form for ease of review.
The API is defined by the following Web IDL fragment.
partial interface Window { readonly attribute FIDOCredentials fido; }; interface FIDOCredentials { Promise < FIDOCredentialInfo > makeCredential ( Account account, sequence < FIDOCredentialParameters > cryptoParameters, DOMString attestationChallenge, optional unsigned long timeoutSeconds, optional sequence < Credential > blacklist, optional FIDOExtensions extensions ); Promise < FIDOAssertion > getAssertion ( DOMString assertionChallenge, optional unsigned long timeoutSeconds, optional sequence < Credential > whitelist, optional FIDOExtensions extensions ); }; interface FIDOCredentialInfo { readonly attribute Credential credential; readonly attribute AlgorithmIdentifier algorithm; readonly attribute any publicKey; readonly attribute AttestationStatement attestation; }; dictionary Account { required DOMString rpDisplayName; required DOMString displayName; DOMString name; DOMString id; DOMString imageUri; }; dictionary FIDOCredentialParameters { required CredentialType type; required AlgorithmIdentifier algorithm; }; enum CredentialType { "FIDO" }; interface Credential { readonly attribute CredentialType type; readonly attribute DOMString id; };
This interface consists of the following methods.
With this method, a script can request the user agent to create a new credential of a given type and persist it to the underlying platform, which may involve data storage managed by the browser or the OS. The user agent will prompt the user to approve this operation. On success, the promise will be resolved with a FIDOCredentialInfo object describing the newly created credential.
This method takes the following parameters:
When this method is invoked, the user agent MUST execute the following algorithm:
timeoutSeconds
was specified, check if its value lies within a reasonable range as defined by the platform and if not, correct it to the closest value lying within that range. Set adjustedTimeout to this adjusted value. If timeoutSeconds
was not specified then set adjustedTimeout to a platform-specific default.origin
of the caller. Derive the RP ID from callerOrigin and set rpId to the RP ID (see [FIDOPlatformApiReqs]).cryptoParameters
using the following steps:cryptoParameters
.CredentialType
supported by this implementation, then stop processing current and move on to the next element in cryptoParameters
.cryptoParameters
.blacklist
is undefined, set it to the empty list.extensions
was specified, process any extensions supported by this client platform, to produce the extension data that needs to be sent to the authenticator. Call this data clientExtensions.authenticatorMakeCredential
operation on that authenticator with callerOrigin, rpId, account
, current.type, normalizedAlgorithm, blacklist
, attestationChallenge
and clientExtensions as parameters. Add a corresponding entry to issuedRequests.authenticatorCancel
operation on that authenticator and remove its entry from the list.authenticatorCancel
operation on that authenticator and remove its entry from the list.FIDOCredentialInfo
object named value and populate its fields with the values returned from the authenticator. Resolve promise with value and terminate this algorithm.DOMException
whose name is "NotFoundError
", and terminate this algorithm.During the above process, the user agent SHOULD show some UI to the user to guide them in the process of selecting and authorizing an authenticator.
This method is used to discover and use an existing FIDO 2.0 credential, with the user's consent. The script optionally specifies some criteria to indicate what credentials are acceptable to it. The user agent and/or platform locates credentials matching the specified criteria, and guides the user to pick one that the script should be allowed to use. The user may choose not to provide a credential even if one is present, for example to maintain privacy.
This method takes the following parameters:
When this method is invoked, the user agent MUST execute the following algorithm:
timeoutSeconds
was specified, check if its value lies within a reasonable range as defined by the platform and if not, correct it to the closest value lying within that range. Set adjustedTimeout to this adjusted value. If timeoutSeconds
was not specified then set adjustedTimeout to a platform-specific default.origin
of the caller. Derive the RP ID from callerOrigin and set rpId to the RP ID (see [FIDOPlatformApiReqs]).extensions
was specified, process any extensions supported by this client platform, to produce the extension data that needs to be sent to the authenticator. Call this data clientExtensions.whitelist
is undefined or empty, let credentialList be a list containing a single wildcard entry.whitelist
is defined and non-empty, optionally execute a platform-specific procedure to determine which of these credentials can possibly be present on this authenticator. Set credentialList to this filtered list. If credentialList is empty, ignore this authenticator and do not perform any of the following per-authenticator steps.authenticatorGetAssertion
operation on this authenticator with callerOrigin, rpId, assertionChallenge
, credentialList, and clientExtensions as parameters.authenticatorCancel
operation on that authenticator and remove its entry from the list.authenticatorCancel
operation on that authenticator, and remove its entry from the list.FIDOAssertion
object named value and populate its fields with the values returned from the authenticator. Resolve promise with value
and terminate this algorithm.DOMException
whose name is "NotFoundError
", and terminate this algorithm.During the above process, the user agent SHOULD show some UI to the user to guide them in the process of selecting and authorizing an authenticator with which to complete the operation.
This interface represents a newly-created FIDO credential. It contains information about the credential that can be used to locate it later for use, and also contains metadata that can be used by the FIDO Relying Party to assess the strength of the credential during registration.
The credential attribute contains a unique identifier for the credential represented by this object.
The algorithm attribute contains the cryptographic algorithm associated with the credential, in the format defined in [WebCrypto].
The publicKey attribute contains the public key associated with the credential, represented as a JsonWebKey structure as defined in [WebCrypto].
The attestation attribute contains a key attestation statement returned by the authenticator. This provides information about the credential and the authenticator it is held in, such as the level of security assurance provided by the authenticator.
This dictionary is used by the caller to specify information about the user account and Relying Party with which a credential is to be associated. It is intended to help the authenticator in providing a friendly credential selection interface for the user.
The rpDisplayName member contains the friendly name of the Relying Party, such as "Google", "Microsoft" or "PayPal".
The displayName member contains the friendly name associated with the user account by the Relying Party, such as "John P. Smith".
The name member contains a detailed name for the account, such as "john.p.smith@example.com".
The id member contains an identifier for the account, stored for the use of the Relying Party. This is not meant to be displayed to the user.
The imageUri member contains a URI that resolves to the user's account image. This may be a URL that can be used to retrieve the user's current avatar, or a data URI that contains the image data.
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 algorithm member specifies the cryptographic algorithm with which the newly generated credential will be used.
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 FIDO assertion and attestation statement according to the type of the authenticator.
Currently one credential type is defined, namely "FIDO", the FIDO 2.0 credential type.
This interface contains the attributes that are returned to the caller when a new credential is created, and can be used later by the caller to select a credential for use.
The type attribute indicates the specification and version that this credential conforms to.
The id attribute contains an identifier for the credential, chosen by the platform with help from the authenticator. This identifier is used to look up credentials for use, and is therefore expected to be globally unique with high probability across all credentials of the same type. This API does not constrain the format or length of this identifier, except that it must be sufficient for the platform to uniquely select a key. For example, an authenticator without on-board storage may create identifiers that consist of the key material wrapped with a key that is burned into the authenticator.
A string or dictionary identifying a cryptographic algorithm and optionally a set of parameters for that algorithm. This type is defined in [WebCrypto].
FIDO 2.0 credentials produce a cryptographic signature that provides proof of possession of a private key as well as evidence of user consent to a specific transaction. The structure of these signatures is defined in [FIDOSignatureFormat].
This is a dictionary containing zero or more extensions as defined in [FIDOSignatureFormat]. An extension is an additional parameter that can be passed to the getAssertion method and triggers some additional processing by the client platform and/or the authenticator.
If the caller wants to pass extensions to the platform, it SHOULD do so by adding one
entry per extension to this FIDOExtensions
dictionary with
the extension identifier as the key, and the extension's value as the value
(see [FIDOSignatureFormat] for details).
FIDO 2.0 authenticators also provide some form of key attestation. The basic requirement is that the authenticator can produce, for each credential public key, attestation information that can be verified by a Relying Party. Typically this information contains a signature by an attesting key over the attested public key and a challenge, as well as a certificate or similar information providing provenance information for the attesting key, enabling a trust decision to be made. The structure of these attestation statements is defined in [FIDOKeyAttestation].
This section is non-normative.
In this section, we walk through some events in the lifecycle of a FIDO 2.0 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 external 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, when a new credential is created and registered with the server.
The sample code for generating and registering a new key follows:
var fidoAPI = window.fido; if (!fidoAPI) { /* Platform not capable. Handle error. */ } var userAccountInformation = { rpDisplayName: "PayPal", displayName: "John P. Smith", name: "johnpsmith@gmail.com", id: "1098237235409872"; imageUri: "https://pics.paypal.com/00/p/aBjjjpqPb.png" }; // This RP will accept either an ES256 or RS256 credential, but // prefers an ES256 credential. var cryptoParams = [ { type: "FIDO", algorithm: "ES256", }, { type: "FIDO", algorithm: "RS256", } ]; var challenge = "Y2xpbWIgYSBtb3VudGFpbg"; var timeoutSeconds = 300; // 5 minutes var blacklist = []; // No blacklist var extensions = {"fido.location": true}; // Include location information in attestation // Note: The following call will cause the authenticator to display UI. fidoAPI.makeCredential(userAccountInformation, cryptoParams, challenge, timeoutSeconds, blacklist, extensions) .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 the flow when a user with an already registered credential visits a website and wants to authenticate using the credential.
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:
var fidoAPI = window.fido; if (!fidoAPI) { /* Platform not capable. Handle error. */ } var challenge = "Y2xpbWIgYSBtb3VudGFpbg"; var timeoutSeconds = 300; // 5 minutes var whitelist = [{ type: "FIDO" }]; fidoAPI.getAssertion(challenge, timeoutSeconds, whitelist) .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.
var fidoAPI = window.fido; if (!fidoAPI) { /* Platform not capable. Handle error. */ } var challenge = "Y2xpbWIgYSBtb3VudGFpbg"; var timeoutSeconds = 300; // 5 minutes var acceptableCredential1 = { type: "FIDO", id: "ISEhISEhIWhpIHRoZXJlISEhISEhIQo=", }; var acceptableCredential2 = { type: "FIDO", id: "cm9zZXMgYXJlIHJlZCwgdmlvbGV0cyBhcmUgYmx1ZQo=", }; var whitelist = [acceptableCredential1, acceptableCredential2]; var extensions = { 'fido.txauth.simple': "Wave your hands in the air like you just don't care" }; fidoAPI.getAssertion(challenge, timeoutSeconds, whitelist, extensions) .then(function (assertion) { // Send assertion to server for verification }).catch(function (err) { // No acceptable credential or user refused consent. Handle appropriately. });
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.
This section is non-normative.
We would like to thank the following for their contributions to, and thorough review of, this specification: Jing Jin, Michael B. Jones, Rolf Lindemann.