1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include
"nsISupports.idl"
8 typedef long COSEAlgorithmIdentifier
;
10 [uuid(2fc8febe
-a277
-11ed
-bda2
-8f6495a5e75c
)]
11 interface nsIWebAuthnRegisterArgs
: nsISupports
{
12 // TODO(Bug 1820035) The origin is only used for prompt callbacks. Refactor and remove.
13 readonly attribute AString origin
;
15 readonly attribute Array
<octet
> challenge
;
17 readonly attribute ACString clientDataJSON
;
19 readonly attribute Array
<octet
> clientDataHash
;
21 // A PublicKeyCredentialRpEntity
22 readonly attribute AString rpId
;
23 [must_use
] readonly attribute AString rpName
;
25 // A PublicKeyCredentialUserEntity
26 [must_use
] readonly attribute Array
<octet
> userId
;
27 [must_use
] readonly attribute AString userName
;
28 [must_use
] readonly attribute AString userDisplayName
;
30 // The spec defines this as a sequence<PublicKeyCredentialParameters>.
31 // We require type = "public-key" and only serialize the alg fields.
32 [must_use
] readonly attribute Array
<COSEAlgorithmIdentifier
> coseAlgs
;
34 // The spec defines this as a sequence<PublicKeyCredentialDescriptor>,
35 // we use separate arrays for the credential IDs and transports.
36 readonly attribute Array
<Array
<octet
> > excludeList
;
37 readonly attribute Array
<octet
> excludeListTransports
;
39 // CTAP2 passes extensions in a CBOR map of extension identifier ->
40 // WebAuthn AuthenticationExtensionsClientInputs. That's not feasible here.
41 // So we define a getter for each supported extension input and use the
42 // return code to signal presence.
43 [must_use
] readonly attribute bool credProps
;
44 [must_use
] readonly attribute bool hmacCreateSecret
;
45 [must_use
] readonly attribute bool minPinLength
;
48 readonly attribute AString residentKey
;
49 readonly attribute AString userVerification
;
50 [must_use
] readonly attribute AString authenticatorAttachment
;
52 // This is the WebAuthn PublicKeyCredentialCreationOptions timeout.
53 // Arguably we don't need to pass it through since WebAuthnController can
54 // cancel transactions.
55 readonly attribute uint32_t timeoutMS
;
57 // This is the WebAuthn PublicKeyCredentialCreationOptions attestation.
58 // We might overwrite the provided value with "none" if the user declines the
60 [must_use
] readonly attribute AString attestationConveyancePreference
;
63 [uuid(2e621cf4
-a277
-11ed
-ae00
-bf41a54ef553
)]
64 interface nsIWebAuthnSignArgs
: nsISupports
{
65 // TODO(Bug 1820035) The origin is only used for prompt callbacks. Refactor and remove.
66 readonly attribute AString origin
;
68 // The spec only asks for the ID field of a PublicKeyCredentialRpEntity here
69 readonly attribute AString rpId
;
71 readonly attribute Array
<octet
> challenge
;
73 readonly attribute ACString clientDataJSON
;
75 readonly attribute Array
<octet
> clientDataHash
;
77 // The spec defines this as a sequence<PublicKeyCredentialDescriptor>,
78 // we use separate arrays for the credential IDs and transports.
79 readonly attribute Array
<Array
<octet
> > allowList
;
80 readonly attribute Array
<octet
> allowListTransports
;
82 // CTAP2 passes extensions in a CBOR map of extension identifier ->
83 // WebAuthn AuthenticationExtensionsClientInputs. That's not feasible here.
84 // So we define a getter for each supported extension input and use the
85 // return code to signal presence.
86 [must_use
] readonly attribute bool hmacCreateSecret
;
87 [must_use
] readonly attribute AString appId
;
90 [must_use
] readonly attribute AString userVerification
;
92 // This is the WebAuthn PublicKeyCredentialCreationOptions timeout.
93 // Arguably we don't need to pass it through since WebAuthnController can
94 // cancel transactions.
95 readonly attribute
unsigned long timeoutMS
;