Skip to content

Commit 62b069e

Browse files
authored
Merge pull request w3c#1951 from pascoej/conditionalcreate
Initial text for conditional create
2 parents 88905f2 + dde3ab3 commit 62b069e

File tree

1 file changed

+37
-11
lines changed

1 file changed

+37
-11
lines changed

index.bs

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Former Editor: Rolf Lindemann, w3cid 84447, Nok Nok Labs, [email protected]
3636
!Contributors: <a href="mailto:[email protected]">Christiaan Brand</a> (Google)
3737
!Contributors: <a href="mailto:[email protected]">Adam Langley</a> (Google)
3838
!Contributors: <a href="mailto:[email protected]">Giridhar Mandyam</a> (Qualcomm)
39+
!Contributors: <a href="mailto:[email protected]">Pascoe</a> (Apple)
3940
!Contributors: <a href="mailto:[email protected]">Nina Satragno</a> (Google)
4041
!Contributors: <a href="mailto:[email protected]">Ki-Eun Shin</a> (SK Telecom)
4142
!Contributors: <a href="mailto:[email protected]">Nick Steele</a> (1Password)
@@ -1579,15 +1580,16 @@ that are returned to the caller when a new credential is created, or a new asser
15791580

15801581
: {{PublicKeyCredential/isConditionalMediationAvailable()}}
15811582
:: {{PublicKeyCredential}} overrides this method to indicate availability for {{CredentialMediationRequirement/conditional}}
1582-
mediation. [=[WRPS]=] SHOULD verify availability before attempting to set
1583-
<code>|options|.{{CredentialRequestOptions/mediation}}</code> to {{CredentialMediationRequirement/conditional}}.
1583+
mediation during {{CredentialsContainer/get()|navigator.credentials.get()}}. [=[WRPS]=] SHOULD verify availability before
1584+
attempting to set <code>|options|.{{CredentialRequestOptions/mediation}}</code> to {{CredentialMediationRequirement/conditional}}.
15841585

15851586
Upon invocation, a promise is returned that resolves with a value of [TRUE] if {{CredentialMediationRequirement/conditional}}
15861587
[=user mediation=] is available, or [FALSE] otherwise.
15871588

15881589
This method has no arguments and returns a promise to a Boolean value.
15891590

1590-
Note: If this method is not present, {{CredentialMediationRequirement/conditional}} [=user mediation=] is not available.
1591+
Note: If this method is not present, {{CredentialMediationRequirement/conditional}} [=user mediation=] is not available for
1592+
{{CredentialsContainer/get()|navigator.credentials.get()}}.
15911593

15921594
: {{PublicKeyCredential/toJSON()}}
15931595
:: This operation returns {{RegistrationResponseJSON}} or {{AuthenticationResponseJSON}},
@@ -1733,8 +1735,16 @@ To support obtaining assertions via {{CredentialsContainer/get()|navigator.crede
17331735
{{PublicKeyCredential}}'s [=interface object=]'s implementation of the <dfn for="PublicKeyCredential" method>\[[Create]](origin,
17341736
options, sameOriginWithAncestors)</dfn> [=internal method=] [[!CREDENTIAL-MANAGEMENT-1]] allows
17351737
[=[WRP]=] scripts to call {{CredentialsContainer/create()|navigator.credentials.create()}} to request the creation of a new
1736-
[=public key credential source=], [=bound credential|bound=] to an [=authenticator=]. This
1737-
{{CredentialsContainer/create()|navigator.credentials.create()}} operation can be aborted by leveraging the {{AbortController}};
1738+
[=public key credential source=], [=bound credential|bound=] to an [=authenticator=].
1739+
1740+
By setting <code>|options|.{{CredentialCreationOptions/mediation}}</code> to {{CredentialMediationRequirement/conditional}},
1741+
[=[RPS]=] can indicate that they would like to register a credential without prominent modal UI if user has already consented to create a credential. The [=[RP]=] SHOULD first check that {{ClientCapability/conditionalCreate}} is present
1742+
in the result of {{PublicKeyCredential/getClientCapabilities()}} in order to avoid the possibility of causing a user-visible error to be returned if the user agent does
1743+
not support {{CredentialMediationRequirement/conditional}} [=user mediation=] for {{CredentialsContainer/create()|navigator.credentials.create()}}.
1744+
The client MUST set BOTH |requireUserPresence| and |requireUserVerification| to |FALSE| when <code>|options|.{{CredentialCreationOptions/mediation}}</code> is set to {{CredentialMediationRequirement/conditional}}
1745+
unless they may explicitly performed during the ceremony.
1746+
1747+
Any {{CredentialsContainer/create()|navigator.credentials.create()}} operation can be aborted by leveraging the {{AbortController}};
17381748
see [[dom#abortcontroller-api-integration]] for detailed instructions.
17391749

17401750

@@ -1773,6 +1783,11 @@ When this method is invoked, the user agent MUST execute the following algorithm
17731783

17741784
1. If <var ignore>sameOriginWithAncestors</var> is [FALSE]:
17751785

1786+
1. If <code>|options|.{{CredentialCreationOptions/mediation}}</code> is present with the value
1787+
{{CredentialMediationRequirement/conditional}}:
1788+
1789+
1. Throw a "{{NotAllowedError}}" {{DOMException}}
1790+
17761791
1. If the [=relevant global object=], as determined by the calling
17771792
{{CredentialsContainer/create()}} implementation, does not have
17781793
[=transient activation=]:
@@ -1909,6 +1924,16 @@ a numbered step. If outdented, it (today) is rendered as a bullet in the midst o
19091924
[=authenticators=] can be <a href="https://en.wikipedia.org/w/index.php?title=Hot_plug">hot-plugged</a> into (e.g., via USB)
19101925
or discovered (e.g., via NFC or Bluetooth) by the [=client=] by various mechanisms, or permanently built into the [=client=].
19111926

1927+
1. If <code>|options|.{{CredentialCreationOptions/mediation}}</code> is present with the value
1928+
{{CredentialMediationRequirement/conditional}}:
1929+
1930+
1. If the user agent has not recently mediated an authentication, the origin of said authentication is not |callerOrigin|, or the user
1931+
does not consent to this type of credential creation, throw a "{{NotAllowedError}}" {{DOMException}}.
1932+
1933+
It is up to the user agent to decide when it believes an authentication ceremony has
1934+
been completed. That authentication ceremony MAY be performed via other means than the
1935+
[=Web Authentication API=].
1936+
19121937
1. Consider the value of {{PublicKeyCredentialCreationOptions/hints}} and craft the user interface accordingly, as the user-agent sees fit.
19131938

19141939
1. Start |lifetimeTimer|.
@@ -1997,7 +2022,10 @@ a numbered step. If outdented, it (today) is rendered as a bullet in the midst o
19972022
<dl class="switch">
19982023

19992024
: is set to {{UserVerificationRequirement/required}}
2000-
:: Let |userVerification| be [TRUE].
2025+
:: 1. If <code>|options|.{{CredentialCreationOptions/mediation}}</code> is set to {{CredentialMediationRequirement/conditional}}
2026+
and [=user verification=] cannot be collected during the ceremony,
2027+
throw a {{ConstraintError}} {{DOMException}}.
2028+
1. Let |userVerification| be [TRUE].
20012029

20022030
: is set to {{UserVerificationRequirement/preferred}}
20032031
:: If the |authenticator|
@@ -2196,7 +2224,7 @@ a numbered step. If outdented, it (today) is rendered as a bullet in the midst o
21962224
[[#sctn-make-credential-privacy]] for details.
21972225

21982226
During the above process, the user agent SHOULD show some UI to the user to guide them in the process of selecting and
2199-
authorizing an authenticator.
2227+
authorizing an authenticator. When <code>|options|.{{CredentialCreationOptions/mediation}}</code> is set to {{CredentialMediationRequirement/conditional}}, prominent modal UI should <i>not</i> be shown <i>unless</i> credential creation was previously consented to via means determined by the user agent.
22002228
</div>
22012229

22022230

@@ -4616,9 +4644,7 @@ It takes the following input parameters:
46164644
: |requireResidentKey|
46174645
:: The [=effective resident key requirement for credential creation=], a Boolean value determined by the [=client=].
46184646
: |requireUserPresence|
4619-
:: The constant Boolean value [TRUE].
4620-
It is included here as a pseudo-parameter to simplify applying this abstract authenticator model to implementations that may
4621-
wish to make a [=test of user presence=] optional although WebAuthn does not.
4647+
:: The constant Boolean value [TRUE], or |FALSE| when <code>|options|.{{CredentialCreationOptions/mediation}}</code> is set to {{CredentialMediationRequirement/conditional}} and the user agent previously collected consent from the user.
46224648
: |requireUserVerification|
46234649
:: The [=effective user verification requirement for credential creation=], a Boolean value determined by the [=client=].
46244650
: |credTypesAndPubKeyAlgs|
@@ -5373,7 +5399,7 @@ a numbered step. If outdented, it (today) is rendered as a bullet in the midst o
53735399

53745400
1. Verify that the <code>[=rpIdHash=]</code> in |authData| is the SHA-256 hash of the [=RP ID=] expected by the [=[RP]=].
53755401

5376-
1. Verify that the [=UP=] bit of the <code>[=flags=]</code> in |authData| is set.
5402+
1. Verify that the [=UP=] bit of the <code>[=flags=]</code> in |authData| is set, unless <code>|options|.{{CredentialCreationOptions/mediation}}</code> is set to {{CredentialMediationRequirement/conditional}}.
53775403

53785404
1. If the [=[RP]=] requires [=user verification=] for this registration,
53795405
verify that the [=authData/flags/UV=] bit of the <code>[=flags=]</code> in |authData| is set.

0 commit comments

Comments
 (0)