CredentialManagement.webidl (1916B)
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/. 5 * 6 * The origin of this IDL file is 7 * https://w3c.github.io/webappsec-credential-management/ 8 * and 9 * https://w3c.github.io/webauthn/ 10 * and 11 * https://fedidcg.github.io/FedCM/ 12 */ 13 14 [Exposed=Window, SecureContext] 15 interface Credential { 16 readonly attribute USVString id; 17 readonly attribute DOMString type; 18 }; 19 20 [Exposed=Window, SecureContext] 21 interface CredentialsContainer { 22 [NewObject] 23 Promise<Credential?> get(optional CredentialRequestOptions options = {}); 24 [NewObject] 25 Promise<Credential?> create(optional CredentialCreationOptions options = {}); 26 [NewObject] 27 Promise<Credential> store(Credential credential); 28 [NewObject] 29 Promise<undefined> preventSilentAccess(); 30 }; 31 32 dictionary CredentialRequestOptions { 33 CredentialMediationRequirement mediation = "optional"; 34 AbortSignal signal; 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; 43 }; 44 45 enum CredentialMediationRequirement { 46 "silent", 47 "optional", 48 "conditional", 49 "required" 50 }; 51 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; 57 AbortSignal signal; 58 };