Skip to content

Commit 984e300

Browse files
committed
[WIP] Add requestUserInfo
This patch adds `requestUserInfo` to `PublicKeyCredentialUserEntity`. This allows a relying party to request user identifiers and attributes alongside a WebAuthn credential on `create()` to aid with account creation. Fixes 2336.
1 parent 3006eff commit 984e300

File tree

1 file changed

+118
-7
lines changed

1 file changed

+118
-7
lines changed

index.bs

Lines changed: 118 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ spec: html; urlPrefix: https://html.spec.whatwg.org/multipage/
165165
text: origin; url: concept-origin
166166
text: document.domain; url:dom-document-domain
167167
urlPrefix: form-control-infrastructure.html
168+
text: autofill; url: autofill
168169
text: autofill detail token; url: autofill-detail-tokens
169170
text: non-autofill credential type; url: non-autofill-credential-type
170171

@@ -173,6 +174,9 @@ spec: url; urlPrefix: https://url.spec.whatwg.org
173174
text: scheme; url: concept-url-scheme
174175
text: port; url: concept-url-port
175176

177+
spec: string-meta; urlPrefix: https://www.w3.org/TR/string-meta/
178+
type: dictionary
179+
text: Localizable; url: Localizable
176180

177181
spec: TokenBinding; urlPrefix: https://tools.ietf.org/html/rfc8471#
178182
type: dfn
@@ -1478,6 +1482,7 @@ that are returned to the caller when a new credential is created, or a new asser
14781482
[SameObject] readonly attribute ArrayBuffer rawId;
14791483
[SameObject] readonly attribute AuthenticatorResponse response;
14801484
readonly attribute DOMString? authenticatorAttachment;
1485+
readonly attribute PublicKeyCredentialUserInfo userInfo;
14811486
AuthenticationExtensionsClientOutputs getClientExtensionResults();
14821487
static Promise<boolean> isConditionalMediationAvailable();
14831488
PublicKeyCredentialJSON toJSON();
@@ -1517,8 +1522,9 @@ that are returned to the caller when a new credential is created, or a new asser
15171522
but later receive updates to support [=cross-platform attachment=] as well.
15181523
</div>
15191524

1520-
1521-
1525+
: {{PublicKeyCredential/userInfo}}
1526+
:: This OPTIONAL {{PublicKeyCredentialUserInfo}} dictionary returns the [=user information=] requested by the [=[RP]=],
1527+
if any.
15221528

15231529
: {{PublicKeyCredential/getClientExtensionResults()}}
15241530
:: This operation returns the value of {{PublicKeyCredential/[[clientExtensionsResults]]}}, which is a [=map=] containing
@@ -3629,8 +3635,9 @@ credential.
36293635

36303636
<xmp class="idl">
36313637
dictionary PublicKeyCredentialUserEntity : PublicKeyCredentialEntity {
3632-
required BufferSource id;
3633-
required DOMString displayName;
3638+
required BufferSource id;
3639+
required DOMString displayName;
3640+
PublicKeyCredentialRequestUserInfo requestUserInfo;
36343641
};
36353642
</xmp>
36363643

@@ -3675,8 +3682,11 @@ credential.
36753682
When storing a {{PublicKeyCredentialUserEntity/displayName}} member's value,
36763683
the value MAY be truncated as described in [[#sctn-strings-truncation]]
36773684
using a size limit greater than or equal to 64 bytes.
3678-
</div>
36793685

3686+
: <dfn>requestUserInfo</dfn>
3687+
:: An OPTIONAL {{PublicKeyCredentialRequestUserInfo}} dictionary indicating that the [=[RP]=] requests [=user information=]
3688+
to be returned with the {{PublicKeyCredential}} for the purposes of creating a new [=user account=].
3689+
</div>
36803690

36813691
### Authenticator Selection Criteria (dictionary <dfn dictionary>AuthenticatorSelectionCriteria</dfn>) ### {#dictionary-authenticatorSelection}
36823692

@@ -3839,6 +3849,100 @@ Note: The {{AttestationConveyancePreference}} enumeration is deliberately not re
38393849
If permitted, the user agent SHOULD signal to the authenticator (at [invocation time](#CreateCred-InvokeAuthnrMakeCred)) that enterprise attestation is requested, and convey the resulting [=/AAGUID=] and [=attestation statement=], unaltered, to the [=[RP]=].
38403850
</div>
38413851

3852+
### Request User Information ### {#dictionary-requestUserInfo}
3853+
3854+
[=[WRPS]=] may use the {{PublicKeyCredentialRequestUserInfo}} dictionary to request [=user information=]
3855+
to be returned as part of the {{CredentialsContainer/create()}} request.
3856+
3857+
<dfn>User information</dfn> that may be requested consists of:
3858+
3859+
<dl dfn-type="dfn" dfn-for="user information">
3860+
: <dfn>Identifier</dfn>
3861+
:: A single [=human-palatable=] string that can be used to uniquely identify a [=user account=],
3862+
and whose value is used as a credential's {{PublicKeyCredentialEntity/name}}.
3863+
: <dfn>Attributes</dfn>
3864+
:: A set of attributes about a user that are required when creating a [=user account=].
3865+
</dl>
3866+
3867+
<xmp class="idl">
3868+
dictionary PublicKeyCredentialRequestUserInfo {
3869+
required sequence<DOMString> identifiers;
3870+
sequence<DOMString> attributes = [];
3871+
};
3872+
</xmp>
3873+
3874+
<dl dfn-type="attribute" dfn-for="PublicKeyCredentialRequestUserInfo">
3875+
: {{PublicKeyCredentialRequestUserInfo/identifiers}}
3876+
:: A set of [=user information/identifier=] types accepted by the [=[RP]=].
3877+
Valid values are:
3878+
* `"email"`: an email address, such as "[email protected]".
3879+
* `"phone"`: a full telephone number, including country code, such as "+1 617 253 5702".
3880+
: {{PublicKeyCredentialRequestUserInfo/attributes}}
3881+
:: An OPTIONAL set of [=user information/attribute=] names.
3882+
Valid values are:
3883+
* `"name"`: a [=human-palatable=] name, such as "Alex Müller".
3884+
</dl>
3885+
3886+
When requesting [=user information=], the [=[RP]=] can request multiple [=user information/identifier=] types
3887+
to indicate any of them may be accepted. However, only one [=user information/identifier=] is returned.
3888+
The [=client=] selects the [=user information/identifier=] type to return depending on user preference or other factors.
3889+
[=[WRPS]=] SHOULD pass the list of [=user information/identifiers=] in order of preference as a hint to [=clients=].
3890+
3891+
The {{PublicKeyCredentialEntity/name}} and {{PublicKeyCredentialUserEntity/displayName}}
3892+
will be overridden by the chosen [=user information/identifier=].
3893+
[=[WRPS]=] SHOULD pass an empty {{PublicKeyCredentialEntity/name}}
3894+
and {{PublicKeyCredentialUserEntity/displayName}} when using this option.
3895+
3896+
[=user information/Identifiers=] and [=user information/attributes=] which are not recognized are ignored by the [=client=].
3897+
3898+
Note: Unlike regular {{CredentialsContainer/create()}} operations, requesting [=user information=]
3899+
requires [=user activation=].
3900+
3901+
[=User information=] is returned to the [=[RP]=] in a {{PublicKeyCredentialUserInfo}} dictionary:
3902+
3903+
<xmp class="idl">
3904+
dictionary PublicKeyCredentialUserInfo {
3905+
required PublicKeyCredentialUserInfoIdentifier identifier;
3906+
required record<DOMString, PublicKeyCredentialUserInfoAttribute> attributes;
3907+
};
3908+
</xmp>
3909+
3910+
<dl dfn-type="attribute" dfn-for="PublicKeyCredentialUserInfo">
3911+
: {{PublicKeyCredentialUserInfo/identifier}}
3912+
:: The [=user information/identifier=] claimed by the user.
3913+
: {{PublicKeyCredentialUserInfo/attributes}}
3914+
:: A map of [=user information/attributes=] names to values claimed by the user.
3915+
Keys MUST be present in the {{PublicKeyCredentialRequestUserInfo/attributes}} requested by the [=[RP]=].
3916+
</dl>
3917+
3918+
<xmp class="idl">
3919+
dictionary PublicKeyCredentialUserInfoIdentifier {
3920+
required DOMString type;
3921+
required DOMString value;
3922+
};
3923+
</xmp>
3924+
3925+
<dl dfn-type="attribute" dfn-for="PublicKeyCredentialUserInfoIdentifier">
3926+
: {{PublicKeyCredentialUserInfoIdentifier/type}}
3927+
:: The type of [=user information/identifier=].
3928+
This MUST be one of the {{PublicKeyCredentialRequestUserInfo/identifiers}} requested by the [=[RP]=].
3929+
: {{PublicKeyCredentialUserInfoIdentifier/value}}
3930+
:: The [=user information/identifier=] claimed by the user.
3931+
</dl>
3932+
3933+
<xmp class="idl">
3934+
dictionary PublicKeyCredentialUserInfoAttribute : Localizable {
3935+
};
3936+
</xmp>
3937+
3938+
<dl dfn-type="attribute" dfn-for="PublicKeyCredentialUserInfoAttribute">
3939+
: {{PublicKeyCredentialUserInfoIdentifier/value}}
3940+
:: The [=user information/attribute=] claimed by the user for the corresponding {{PublicKeyCredentialUserInfo/attributes}} key.
3941+
</dl>
3942+
3943+
The [=client=] MAY obtain [=user information=] from sources such as [=autofill=].
3944+
However, the [=client=] MUST allow the user to manually set any [=user information/identifiers=]
3945+
and [=user information/attributes=].
38423946

38433947
## Options for Assertion Generation (dictionary <dfn dictionary>PublicKeyCredentialRequestOptions</dfn>) ## {#dictionary-assertion-options}
38443948

@@ -8571,9 +8675,16 @@ possible for [=[RPS]=] to trust any further [=attestation statements=] from the
85718675

85728676
See also the related security consideration for [=[RPS]=] in [[#sctn-revoked-attestation-certificates]].
85738677

8574-
<!-- no sec cons for clients enumerated at this time
85758678
## Security considerations for [=clients=] ## {#sctn-security-considerations-client}
8576-
-->
8679+
8680+
### [=UI redressing=] when requesting [=user information=] {#sctn-seccons-ui-redressing-request-user-info}
8681+
8682+
When a [=[RP]=] requests [=user information=] as part of a {{CredentialsContainer/create()}} request,
8683+
the user agent may offer prefilled default values for the requested [=user information/identifiers=]
8684+
and [=user information/attributes=], similar to [=autofill=].
8685+
It's important that [=clients=] consider the risk of [=UI redressing=]
8686+
and take appropriate measures to prevent malicious [=[WRPS]=] from obtaining [=user information=]
8687+
without the user's consent.
85778688

85788689
## Security considerations for [=[RPS]=] ## {#sctn-security-considerations-rp}
85798690

0 commit comments

Comments
 (0)