1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://w3c.github.io/webappsec-credential-management/
9 * https://w3c.github.io/webauthn/
11 * https://fedidcg.github.io/FedCM/
14 [Exposed=Window, SecureContext]
15 interface Credential {
16 readonly attribute USVString id;
17 readonly attribute DOMString type;
20 [Exposed=Window, SecureContext]
21 interface CredentialsContainer {
23 Promise<Credential?> get(optional CredentialRequestOptions options = {});
25 Promise<Credential?> create(optional CredentialCreationOptions options = {});
27 Promise<Credential> store(Credential credential);
29 Promise<undefined> preventSilentAccess();
32 dictionary CredentialRequestOptions {
33 CredentialMediationRequirement mediation = "optional";
35 // This is taken from the partial definition in
36 // https://w3c.github.io/webauthn/#sctn-credentialrequestoptions-extension
37 [Pref="security.webauth.webauthn"]
38 PublicKeyCredentialRequestOptions publicKey;
39 // This is taken from the partial definition in
40 // https://fedidcg.github.io/FedCM/#browser-api-credential-request-options
41 [Pref="dom.security.credentialmanagement.identity.enabled"]
42 IdentityCredentialRequestOptions identity;
45 enum CredentialMediationRequirement {
52 dictionary CredentialCreationOptions {
53 // This is taken from the partial definition in
54 // https://w3c.github.io/webauthn/#sctn-credentialcreationoptions-extension
55 [Pref="security.webauth.webauthn"]
56 PublicKeyCredentialCreationOptions publicKey;