Skip to content

Add immediate mediation #272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,8 @@ spec:css-syntax-3;
"silent",
"optional",
"conditional",
"required"
"required",
"immediate"
};
</pre>
<div dfn-for="CredentialMediationRequirement" dfn-type="enum-value">
Expand Down Expand Up @@ -843,6 +844,26 @@ spec:css-syntax-3;
or [user-switching](#example-mediation-switch) scenarios. Further, the requirement is tied
to a specific operation, and does not affect the [=origin/prevent silent access flag=] for the
origin. To set that flag, developers should call {{preventSilentAccess()}}.

: <dfn>immediate</dfn>
:: The user agent will not hand over credentials without [=user mediation=].
If the user agent determines a lack of applicable credentials, the user agent will throw a "{{NotAllowedError}}" {{DOMException}} without [=user mediation=].

The [=origin/prevent silent access flag=] is ignored.

Websites can only use {{CredentialMediationRequirement/immediate}} if requesting the {{PublicKeyCredential}}
credential type, and if {{PublicKeyCredential/getClientCapabilities()}} indicates that the user
agent supports {{CredentialMediationRequirement/immediate}} mediation.

Websites can optionally request the {{PasswordCredential}} credential type in addition to the {{PublicKeyCredential}} credential type.

{{CredentialMediationRequirement/immediate}} is ignored for {{CredentialsContainer/create()}}.

Note: This specification does not provide a static method similar to
{{Credential/isConditionalMediationAvailable()}} to detect feature availability for {{CredentialMediationRequirement/immediate}}.
In future, if this mediation mode is expanded to include other credential types, a more general
approach to feature detection will be needed that can indicate which credential types are
supported under any given {{CredentialMediationRequirement}}.
</div>

#### Examples #### {#mediation-examples}
Expand Down Expand Up @@ -996,6 +1017,12 @@ spec:css-syntax-3;
[=user mediation=], return [=a promise rejected with=]
a "{{TypeError}}" {{DOMException}}.

1. If |options|.{{CredentialRequestOptions/mediation}} is
{{CredentialMediationRequirement/immediate}} and |interface| does
not support {{CredentialMediationRequirement/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}}.
Expand Down Expand Up @@ -1042,6 +1069,9 @@ spec:css-syntax-3;
1. |options|.{{CredentialRequestOptions/mediation}} is not
"{{CredentialMediationRequirement/conditional}}".

1. |options|.{{CredentialRequestOptions/mediation}} is not
"{{CredentialMediationRequirement/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.
Expand Down
Loading