2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2017-01-09 23:22:49 +03:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* The origin of this IDL file is
|
2018-01-09 09:27:35 +03:00
|
|
|
* https://w3c.github.io/webauthn/
|
2017-01-09 23:22:49 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
/***** Interfaces to Data *****/
|
|
|
|
|
2017-01-23 19:20:56 +03:00
|
|
|
[SecureContext, Pref="security.webauth.webauthn"]
|
2017-05-17 03:07:01 +03:00
|
|
|
interface PublicKeyCredential : Credential {
|
2018-09-13 23:04:55 +03:00
|
|
|
[SameObject] readonly attribute ArrayBuffer rawId;
|
|
|
|
[SameObject] readonly attribute AuthenticatorResponse response;
|
|
|
|
AuthenticationExtensionsClientOutputs getClientExtensionResults();
|
2017-10-07 02:10:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
[SecureContext]
|
|
|
|
partial interface PublicKeyCredential {
|
2018-09-13 23:04:55 +03:00
|
|
|
static Promise<boolean> isUserVerifyingPlatformAuthenticatorAvailable();
|
2019-02-14 23:11:34 +03:00
|
|
|
// isExternalCTAP2SecurityKeySupported is non-standard; see Bug 1526023
|
|
|
|
static Promise<boolean> isExternalCTAP2SecurityKeySupported();
|
2017-05-17 03:07:01 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
[SecureContext, Pref="security.webauth.webauthn"]
|
|
|
|
interface AuthenticatorResponse {
|
2018-09-13 23:04:55 +03:00
|
|
|
[SameObject] readonly attribute ArrayBuffer clientDataJSON;
|
2017-05-17 03:07:01 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
[SecureContext, Pref="security.webauth.webauthn"]
|
|
|
|
interface AuthenticatorAttestationResponse : AuthenticatorResponse {
|
2018-09-13 23:04:55 +03:00
|
|
|
[SameObject] readonly attribute ArrayBuffer attestationObject;
|
2017-01-09 23:22:49 +03:00
|
|
|
};
|
|
|
|
|
2017-10-10 02:48:01 +03:00
|
|
|
[SecureContext, Pref="security.webauth.webauthn"]
|
|
|
|
interface AuthenticatorAssertionResponse : AuthenticatorResponse {
|
2018-09-13 23:04:55 +03:00
|
|
|
[SameObject] readonly attribute ArrayBuffer authenticatorData;
|
|
|
|
[SameObject] readonly attribute ArrayBuffer signature;
|
|
|
|
[SameObject] readonly attribute ArrayBuffer? userHandle;
|
2017-10-10 02:48:01 +03:00
|
|
|
};
|
|
|
|
|
2017-05-23 03:09:49 +03:00
|
|
|
dictionary PublicKeyCredentialParameters {
|
2018-09-13 23:04:55 +03:00
|
|
|
required PublicKeyCredentialType type;
|
|
|
|
required COSEAlgorithmIdentifier alg;
|
2017-01-09 23:22:49 +03:00
|
|
|
};
|
|
|
|
|
2018-02-07 22:01:51 +03:00
|
|
|
dictionary PublicKeyCredentialCreationOptions {
|
2018-09-13 23:04:55 +03:00
|
|
|
required PublicKeyCredentialRpEntity rp;
|
|
|
|
required PublicKeyCredentialUserEntity user;
|
2017-05-23 03:09:49 +03:00
|
|
|
|
2018-09-13 23:04:55 +03:00
|
|
|
required BufferSource challenge;
|
|
|
|
required sequence<PublicKeyCredentialParameters> pubKeyCredParams;
|
2017-05-23 03:09:49 +03:00
|
|
|
|
2018-09-13 23:04:55 +03:00
|
|
|
unsigned long timeout;
|
|
|
|
sequence<PublicKeyCredentialDescriptor> excludeCredentials = [];
|
2018-09-26 01:09:30 +03:00
|
|
|
// FIXME: bug 1493860: should this "= null" be here?
|
|
|
|
AuthenticatorSelectionCriteria authenticatorSelection = null;
|
2018-09-13 23:04:55 +03:00
|
|
|
AttestationConveyancePreference attestation = "none";
|
2018-09-26 01:09:30 +03:00
|
|
|
// FIXME: bug 1493860: should this "= null" be here?
|
|
|
|
AuthenticationExtensionsClientInputs extensions = null;
|
2017-01-09 23:22:49 +03:00
|
|
|
};
|
|
|
|
|
2017-05-23 03:09:49 +03:00
|
|
|
dictionary PublicKeyCredentialEntity {
|
2018-09-13 23:04:55 +03:00
|
|
|
required DOMString name;
|
|
|
|
USVString icon;
|
2017-10-07 02:10:57 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary PublicKeyCredentialRpEntity : PublicKeyCredentialEntity {
|
2018-09-13 23:04:55 +03:00
|
|
|
DOMString id;
|
2017-01-09 23:22:49 +03:00
|
|
|
};
|
|
|
|
|
2017-10-10 02:48:01 +03:00
|
|
|
dictionary PublicKeyCredentialUserEntity : PublicKeyCredentialEntity {
|
2018-09-13 23:04:55 +03:00
|
|
|
required BufferSource id;
|
|
|
|
required DOMString displayName;
|
2017-10-10 02:48:01 +03:00
|
|
|
};
|
|
|
|
|
2017-05-23 03:09:49 +03:00
|
|
|
dictionary AuthenticatorSelectionCriteria {
|
2018-09-13 23:04:55 +03:00
|
|
|
AuthenticatorAttachment authenticatorAttachment;
|
|
|
|
boolean requireResidentKey = false;
|
|
|
|
UserVerificationRequirement userVerification = "preferred";
|
2017-05-23 03:09:49 +03:00
|
|
|
};
|
|
|
|
|
2017-10-07 02:10:57 +03:00
|
|
|
enum AuthenticatorAttachment {
|
2018-09-13 23:04:55 +03:00
|
|
|
"platform", // Platform attachment
|
|
|
|
"cross-platform" // Cross-platform attachment
|
2017-05-23 03:09:49 +03:00
|
|
|
};
|
|
|
|
|
2018-01-23 22:21:15 +03:00
|
|
|
enum AttestationConveyancePreference {
|
2018-09-13 23:04:55 +03:00
|
|
|
"none",
|
|
|
|
"indirect",
|
|
|
|
"direct"
|
2018-01-23 22:21:15 +03:00
|
|
|
};
|
|
|
|
|
2017-11-29 15:58:33 +03:00
|
|
|
enum UserVerificationRequirement {
|
2018-09-13 23:04:55 +03:00
|
|
|
"required",
|
|
|
|
"preferred",
|
|
|
|
"discouraged"
|
2017-11-29 15:58:33 +03:00
|
|
|
};
|
|
|
|
|
2017-05-24 00:55:10 +03:00
|
|
|
dictionary PublicKeyCredentialRequestOptions {
|
2018-09-13 23:04:55 +03:00
|
|
|
required BufferSource challenge;
|
|
|
|
unsigned long timeout;
|
|
|
|
USVString rpId;
|
|
|
|
sequence<PublicKeyCredentialDescriptor> allowCredentials = [];
|
|
|
|
UserVerificationRequirement userVerification = "preferred";
|
2018-09-26 01:09:30 +03:00
|
|
|
// FIXME: bug 1493860: should this "= null" be here?
|
|
|
|
AuthenticationExtensionsClientInputs extensions = null;
|
2017-05-24 00:55:10 +03:00
|
|
|
};
|
|
|
|
|
2018-02-22 12:53:49 +03:00
|
|
|
// TODO - Use partial dictionaries when bug 1436329 is fixed.
|
2018-02-07 18:37:54 +03:00
|
|
|
dictionary AuthenticationExtensionsClientInputs {
|
2018-09-13 23:04:55 +03:00
|
|
|
// FIDO AppID Extension (appid)
|
|
|
|
// <https://w3c.github.io/webauthn/#sctn-appid-extension>
|
|
|
|
USVString appid;
|
2018-02-07 18:37:54 +03:00
|
|
|
};
|
|
|
|
|
2018-02-22 12:53:49 +03:00
|
|
|
// TODO - Use partial dictionaries when bug 1436329 is fixed.
|
2018-02-07 18:37:54 +03:00
|
|
|
dictionary AuthenticationExtensionsClientOutputs {
|
2018-09-13 23:04:55 +03:00
|
|
|
// FIDO AppID Extension (appid)
|
|
|
|
// <https://w3c.github.io/webauthn/#sctn-appid-extension>
|
|
|
|
boolean appid;
|
2018-02-07 18:37:54 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef record<DOMString, DOMString> AuthenticationExtensionsAuthenticatorInputs;
|
2017-10-07 02:10:57 +03:00
|
|
|
|
2017-05-23 03:09:49 +03:00
|
|
|
dictionary CollectedClientData {
|
2018-09-13 23:04:55 +03:00
|
|
|
required DOMString type;
|
|
|
|
required DOMString challenge;
|
|
|
|
required DOMString origin;
|
|
|
|
required DOMString hashAlgorithm;
|
|
|
|
DOMString tokenBindingId;
|
2018-09-26 01:09:30 +03:00
|
|
|
// FIXME: bug 1493860: should this "= null" be here?
|
|
|
|
AuthenticationExtensionsClientInputs clientExtensions = null;
|
2018-09-13 23:04:55 +03:00
|
|
|
AuthenticationExtensionsAuthenticatorInputs authenticatorExtensions;
|
2017-05-23 03:09:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
enum PublicKeyCredentialType {
|
2018-09-13 23:04:55 +03:00
|
|
|
"public-key"
|
2017-05-23 03:09:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary PublicKeyCredentialDescriptor {
|
2018-09-13 23:04:55 +03:00
|
|
|
required PublicKeyCredentialType type;
|
|
|
|
required BufferSource id;
|
|
|
|
sequence<AuthenticatorTransport> transports;
|
2017-05-23 03:09:49 +03:00
|
|
|
};
|
|
|
|
|
2017-10-10 02:28:13 +03:00
|
|
|
enum AuthenticatorTransport {
|
2018-09-13 23:04:55 +03:00
|
|
|
"usb",
|
|
|
|
"nfc",
|
2019-01-21 04:10:44 +03:00
|
|
|
"ble",
|
|
|
|
"internal"
|
2017-01-09 23:22:49 +03:00
|
|
|
};
|
2017-10-07 02:10:57 +03:00
|
|
|
|
|
|
|
typedef long COSEAlgorithmIdentifier;
|
|
|
|
|
|
|
|
typedef sequence<AAGUID> AuthenticatorSelectionList;
|
|
|
|
|
2017-11-14 13:44:46 +03:00
|
|
|
typedef BufferSource AAGUID;
|
|
|
|
|
2018-02-22 12:53:49 +03:00
|
|
|
/*
|
|
|
|
// FIDO AppID Extension (appid)
|
|
|
|
// <https://w3c.github.io/webauthn/#sctn-appid-extension>
|
|
|
|
partial dictionary AuthenticationExtensionsClientInputs {
|
2018-09-13 23:04:55 +03:00
|
|
|
USVString appid;
|
2018-02-22 12:53:49 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
// FIDO AppID Extension (appid)
|
|
|
|
// <https://w3c.github.io/webauthn/#sctn-appid-extension>
|
|
|
|
partial dictionary AuthenticationExtensionsClientOutputs {
|
|
|
|
boolean appid;
|
|
|
|
};
|
|
|
|
*/
|