diff --git a/index.bs b/index.bs index 1b37ca4..4127518 100644 --- a/index.bs +++ b/index.bs @@ -707,6 +707,7 @@ spec:css-syntax-3;
dictionary CredentialRequestOptions {
CredentialMediationRequirement mediation = "optional";
+ CredentialUiModeRequirement uiMode = "active";
AbortSignal signal;
};
@@ -715,6 +716,11 @@ spec:css-syntax-3;
:: This property specifies the mediation requirements for a given credential request. The
meaning of each enum value is described below in {{CredentialMediationRequirement}}.
Processing details are defined in [[#algorithm-request]].
+ : uiMode
+ :: This property specifies the user interface mode for a given credential request, when
+ the user agent is going to non-silently mediate the request. The meaning of each enum value
+ is described below in {{CredentialUiModeRequirement}}. Processing details are defined in
+ [[#algorithm-request]].
: signal
:: This property lets the developer abort an ongoing {{CredentialsContainer/get()}} operation.
An aborted operation may complete normally (generally if the abort was received after the
@@ -851,6 +857,49 @@ spec:css-syntax-3;
origin. To set that flag, developers should call {{preventSilentAccess()}}.
+ ### UI Mode Requirements ### {#ui-mode-requirements}
+
+ When making a request via {{get(options)}}, developers can set a case-by-case requirement for the
+ desired type of [=user mediation=] by choosing the appropriate {{CredentialUiModeRequirement}} enum value.
+
+ Note: This allows callers to distinguish between different available forms of [=user mediation=], when it occurs. Whether
+ or not it occurs depends on the value of {{CredentialMediationRequirement}} for the request. Not all values of
+ {{CredentialUiModeRequirement}} make sense in combination with all values of {{CredentialMediationRequirement}}, and the
+ interaction depends on the `[[DiscoverFromExternalSource]](origin, options, sameOriginWithAncestors)` methods for credential
+ types that support it.
+
+
+ enum CredentialUiModeRequirement {
+ "active",
+ "immediate"
+ };
+
+
@@ -973,7 +1022,7 @@ spec:css-syntax-3;
The Request a `Credential` algorithm accepts a {{CredentialRequestOptions}}
(|options|), and returns a {{Promise}} that resolves with a {{Credential}} if one can be
- unambigiously obtained, or with `null` if not.
+ unambiguously obtained, or with `null` if not.
1. Let |settings| be the [=current settings object=].
@@ -1002,6 +1051,12 @@ spec:css-syntax-3;
[=user mediation=], return [=a promise rejected with=]
a "{{TypeError}}" {{DOMException}}.
+ 1. If |options|.{{CredentialRequestOptions/uiMode}} is
+ {{CredentialUiModeRequirement/immediate}} and |interface| does
+ not support {{CredentialUiModeRequirement/immediate}}
+ [=user mediation=], return [=a promise rejected with=]
+ a "{{TypeError}}" {{DOMException}}.
+
1. If |settings|' [=active credential types=] [=set/contains=] |interface|'s
{{Credential/[[type]]}}, return [=a promise rejected with=] a "{{NotAllowedError}}"
{{DOMException}}.
@@ -1048,6 +1103,9 @@ spec:css-syntax-3;
1. |options|.{{CredentialRequestOptions/mediation}} is not
"{{CredentialMediationRequirement/conditional}}".
+ 1. |options|.{{CredentialRequestOptions/uiMode}} is not
+ "{{CredentialUiModeRequirement/immediate}}".
+
ISSUE: This might be the wrong model. It would be nice to support a site that wished
to accept either username/passwords or webauthn-style credentials without forcing
a chooser for those users who use the former, and who wish to remain signed in.