1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 * IPC Transaction protocol for the WebAuthn DOM API. This IPC protocol allows
7 * the content process to call to the parent to access hardware for
8 * authentication registration and challenges. All transactions start in the
9 * child process, and the parent replies with a "Confirm*" message, or a
10 * "Cancel" message if there was an error (no hardware available, no registered
11 * keys, etc) or interruption (another transaction was started in another
12 * content process). Similarly, the content process can also request a cancel,
13 * either triggered explicitly by the user/script or due to UI events like
14 * selecting a different tab.
17 include protocol PBackground;
19 using mozilla::dom::MaybeDiscardedBrowsingContext from "mozilla/dom/BrowsingContext.h";
24 struct WebAuthnAuthenticatorSelection {
26 nsString userVerificationRequirement;
27 nsString? authenticatorAttachment;
30 struct WebAuthnScopedCredential {
35 struct WebAuthnExtensionAppId {
36 nsString appIdentifier;
39 struct WebAuthnExtensionCredProps {
43 struct WebAuthnExtensionHmacSecret {
44 bool hmacCreateSecret;
47 struct WebAuthnExtensionMinPinLength {
51 union WebAuthnExtension {
52 WebAuthnExtensionAppId;
53 WebAuthnExtensionCredProps;
54 WebAuthnExtensionHmacSecret;
55 WebAuthnExtensionMinPinLength;
58 struct WebAuthnExtensionResultAppId {
62 struct WebAuthnExtensionResultCredProps {
66 struct WebAuthnExtensionResultHmacSecret {
67 bool hmacCreateSecret;
70 union WebAuthnExtensionResult {
71 WebAuthnExtensionResultAppId;
72 WebAuthnExtensionResultCredProps;
73 WebAuthnExtensionResultHmacSecret;
76 struct WebAuthnMakeCredentialRpInfo {
80 struct WebAuthnMakeCredentialUserInfo {
90 struct WebAuthnMakeCredentialInfo {
94 nsCString ClientDataJSON;
96 WebAuthnScopedCredential[] ExcludeList;
97 WebAuthnMakeCredentialRpInfo Rp;
98 WebAuthnMakeCredentialUserInfo User;
100 WebAuthnExtension[] Extensions;
101 WebAuthnAuthenticatorSelection AuthenticatorSelection;
102 nsString attestationConveyancePreference;
103 uint64_t BrowsingContextId;
106 struct WebAuthnMakeCredentialResult {
107 nsCString ClientDataJSON;
108 uint8_t[] AttestationObject;
110 nsString[] Transports;
111 WebAuthnExtensionResult[] Extensions;
112 nsString? AuthenticatorAttachment;
115 struct WebAuthnGetAssertionInfo {
119 nsCString ClientDataJSON;
121 WebAuthnScopedCredential[] AllowList;
122 WebAuthnExtension[] Extensions;
123 nsString userVerificationRequirement;
124 bool ConditionallyMediated;
125 uint64_t BrowsingContextId;
128 struct WebAuthnGetAssertionResult {
129 nsCString ClientDataJSON;
132 uint8_t[] AuthenticatorData;
133 WebAuthnExtensionResult[] Extensions;
134 uint8_t[] UserHandle;
135 nsString? AuthenticatorAttachment;
139 async protocol PWebAuthnTransaction {
143 async RequestRegister(uint64_t aTransactionId, WebAuthnMakeCredentialInfo aTransactionInfo);
144 async RequestSign(uint64_t aTransactionId, WebAuthnGetAssertionInfo aTransactionInfo);
145 async RequestIsUVPAA() returns (bool available);
146 [Tainted] async RequestCancel(uint64_t aTransactionId);
151 async ConfirmRegister(uint64_t aTransactionId, WebAuthnMakeCredentialResult aResult);
152 async ConfirmSign(uint64_t aTransactionId, WebAuthnGetAssertionResult aResult);
153 async Abort(uint64_t aTransactionId, nsresult Error);