diff --git a/index.bs b/index.bs
index 67f3fcb9d..ee6b3457a 100644
--- a/index.bs
+++ b/index.bs
@@ -240,6 +240,10 @@ spec: RFC8610; urlPrefix: https://tools.ietf.org/html/rfc8610
type: dfn
text: group sockets; url: section-3.9
+spec: String-Meta; urlPrefix: https://www.w3.org/TR/2024/NOTE-string-meta-20241017
+ type: dfn
+ text: string direction; url: dfn-string-direction
+ text: resource-wide default; url: dfn-resource-wide-default
@@ -1768,6 +1772,9 @@ When this method is invoked, the user agent MUST execute the following algorithm
1. If the length of |pkOptions|.{{PublicKeyCredentialCreationOptions/user}}.{{PublicKeyCredentialUserEntity/id}} is not between 1 and 64 bytes (inclusive) then throw a {{TypeError}}.
+1. If |pkOptions|.{{PublicKeyCredentialCreationOptions/user}}.{{PublicKeyCredentialUserEntity/language}} is present
+ and is not a [=well-formed language tag=], throw a "{{SyntaxError}}" {{DOMException}}.
+
1. Let |callerOrigin| be {{PublicKeyCredential/[CREATE-METHOD]/origin}}. If |callerOrigin| is an [=opaque origin=], throw a "{{NotAllowedError}}" {{DOMException}}.
1. Let |effectiveDomain| be the |callerOrigin|'s [=effective domain=].
@@ -2225,6 +2232,10 @@ The following {{DOMException}} exceptions can be raised:
the [=client=] does not support [[#sctn-related-origins|related origin requests]]
or the [$related origins validation procedure$] failed.
+ : {{SyntaxError}}
+ :: {{PublicKeyCredentialCreationOptions/user}}.{{PublicKeyCredentialUserEntity/language}}
+ was present and was not a [=well-formed language tag=].
+
: {{NotAllowedError}}
:: A catch-all error covering a wide range of possible reasons,
including common ones like the user canceling out of the ceremony.
@@ -2477,7 +2488,8 @@ When this method is invoked, the user agent MUST execute the following algorithm
1. Prompt the user to optionally select a [=DiscoverableCredentialMetadata=] from |silentlyDiscoveredCredentials|.
The prompt SHOULD display values from the [=DiscoverableCredentialMetadata/otherUI=] of each [=DiscoverableCredentialMetadata=],
- such as {{PublicKeyCredentialEntity/name}} and {{PublicKeyCredentialUserEntity/displayName}}.
+ such as {{PublicKeyCredentialEntity/name}} and {{PublicKeyCredentialUserEntity/displayName}},
+ taking into account {{PublicKeyCredentialUserEntity/language}} and {{PublicKeyCredentialUserEntity/direction}} if available.
Let |credentialMetadata| be the [=DiscoverableCredentialMetadata=] chosen by the user, if any.
@@ -2927,6 +2939,8 @@ value and terminate the operation.
required Base64URLString id;
required DOMString name;
required DOMString displayName;
+ DOMString language;
+ DOMString direction;
};
dictionary PublicKeyCredentialDescriptorJSON {
@@ -3007,6 +3021,8 @@ value and terminate the operation.
required Base64URLString userId;
required DOMString name;
required DOMString displayName;
+ DOMString language;
+ DOMString direction;
};
@@ -3213,7 +3229,9 @@ accidentally omits valid [=credential IDs=] from
#### {{PublicKeyCredential/signalCurrentUserDetails(options)}} #### {#sctn-signalCurrentUserDetails}
The {{PublicKeyCredential/signalCurrentUserDetails(options)|signalCurrentUserDetails}} method signals the user's
-current {{PublicKeyCredentialEntity/name}} and {{PublicKeyCredentialUserEntity/displayName}}.
+current {{PublicKeyCredentialEntity/name}} and {{PublicKeyCredentialUserEntity/displayName}},
+and accompanying {{PublicKeyCredentialUserEntity/language}}
+and {{PublicKeyCredentialUserEntity/direction}} metadata if applicable.
Upon invocation of {{PublicKeyCredential/signalCurrentUserDetails(options)}}, the
[=client=] executes these steps:
@@ -3221,6 +3239,9 @@ Upon invocation of {{PublicKeyCredential/signalCurrentUserDetails(options)}}, th
1. If the result of [=base64url encoding | base64url decoding=]
|options|.{{CurrentUserDetailsOptions/userId}} is an error,
then return [=a promise rejected with=] a {{TypeError}}.
+1. If |options|.{{CurrentUserDetailsOptions/language}} is present
+ and is not a [=well-formed language tag=],
+ then return [=a promise rejected with=] a "{{SyntaxError}}" {{DOMException}}.
1. Let |p| be the result of executing the [$Asynchronous RP ID validation
algorithm$] with
|options|.{{CurrentUserDetailsOptions/rpId}}.
@@ -3241,8 +3262,10 @@ The currentUserDetails
[=credentials map=][|options|.{{CurrentUserDetailsOptions/rpId}}, |userId|].
1. If |credential| does not exist, abort these steps.
1. Update the |credential|'s [=public key credential source/otherUI=] to match
- |options|.{{CurrentUserDetailsOptions/name}} and
- |options|.{{CurrentUserDetailsOptions/displayName}}.
+ |options|.{{CurrentUserDetailsOptions/name}},
+ |options|.{{CurrentUserDetailsOptions/displayName}},
+ |options|.{{CurrentUserDetailsOptions/language}}
+ and |options|.{{CurrentUserDetailsOptions/direction}}.
|rpEntity|.{{PublicKeyCredentialRpEntity/id}}, |rpEntity|.{{PublicKeyCredentialEntity/name}},
|userEntity|.{{PublicKeyCredentialEntity/name}} and
|userEntity|.{{PublicKeyCredentialUserEntity/displayName}}, if possible.
+ This display SHOULD take into account |userEntity|.{{PublicKeyCredentialUserEntity/language}}
+ and |userEntity|.{{PublicKeyCredentialUserEntity/direction}} if possible.
If |requireUserVerification| is [TRUE], the [=authorization gesture=] MUST include [=user verification=].
@@ -5516,20 +5554,17 @@ but MUST NOT be shorter than the longest prefix substring that satisfies the siz
### Language and Direction Encoding ### {#sctn-strings-langdir}
-In order to be correctly displayed in context, the language and base direction of a string [may be required](https://www.w3.org/TR/string-meta/#why-is-this-important). Strings in this API may have to be written to fixed-function [=authenticators=] and then later read back and displayed on a different platform. Thus language and direction metadata is encoded in the string itself to ensure that it is transported atomically.
-
-To encode language and direction metadata in a string that is documented as permitting it, suffix its code points with two sequences of code points:
-
-The first encodes a [=language tag=] with the code point U+E0001 followed by the ASCII values of the [=language tag=] each shifted up by U+E0000. For example, the [=language tag=] “en-US” becomes the code points U+E0001, U+E0065, U+E006E, U+E002D, U+E0055, U+E0053.
+In order to be correctly displayed in context, the language and base direction of a string [may be required](https://www.w3.org/TR/string-meta/#why-is-this-important). Strings in this API may have to be written to fixed-function [=authenticators=] and then later read back and displayed on a different platform.
-The second consists of a single code point which is either U+200E (“LEFT-TO-RIGHT MARK”), U+200F (“RIGHT-TO-LEFT MARK”), or U+E007F (“CANCEL TAG”). The first two can be used to indicate directionality but SHOULD only be used when neccessary to produce the correct result. (E.g. an RTL string that starts with LTR-strong characters.) The value U+E007F is a direction-agnostic indication of the end of the [=language tag=].
+For compatibility with existing fixed-function [=authenticators=] without support for dedicated language and direction metadata fields,
+Web Authentication Level 2 included provisions for embedding such metadata in the string itself to ensure that it is transported atomically.
+This encoding is NOT RECOMMENDED; [=clients=] and [=authenticators=] MAY ignore such encoding in new values.
+[=Clients=] and [=authenticators=] MAY detect and process language and direction metadata encoded in existing strings
+as described in [[webauthn-2-20210408#sctn-strings-langdir|Web Authentication Level 2 §6.4.2. Language and Direction Encoding]].
-So the string “حبیب الرحمان” could have two different DOMString values, depending on whether the language was encoded or not. (Since the direction is unambiguous a directionality marker is not needed in this example.)
+Instead, the Level 3 [=Web Authentication API=] provides [=resource-wide default=] fields for encoding language and direction metadata.
+[=[WACS]=] SHOULD use these when provided by the [=[RP]=] and supported by the [=authenticator=].
- * Unadorned string: U+062D, U+0628, U+06CC, U+0628, U+0020, U+0627, U+0644, U+0631, U+062D, U+0645, U+0627, U+0646
- * With language “ar-SA” encoded: U+062D, U+0628, U+06CC, U+0628, U+0020, U+0627, U+0644, U+0631, U+062D, U+0645, U+0627, U+0646, U+E0001, U+E0061, U+E0072, U+E002D, U+E0053, U+E0041, U+E007F
-
-Consumers of strings that may have language and direction encoded should be aware that truncation could truncate a [=language tag=] into a different, but still valid, language. The final directionality marker or CANCEL TAG code point provide an unambigous indication of truncation.
## Attestation ## {#sctn-attestation}
@@ -8093,6 +8128,22 @@ The Credential Parameters is a JSON [=Object=] passed to the [=remote
{{CredentialCreationOptions/publicKey}}.{{PublicKeyCredentialCreationOptions/rp}}.{{PublicKeyCredentialEntity/name}}
+ - {{CredentialCreationOptions/publicKey}}.{{PublicKeyCredentialCreationOptions/user}}.{{PublicKeyCredentialEntity/name}}
+ - {{CredentialCreationOptions/publicKey}}.{{PublicKeyCredentialCreationOptions/user}}.{{PublicKeyCredentialUserEntity/displayName}}
New features:
@@ -10014,6 +10072,8 @@ New features:
- Registration parameter
{{CredentialCreationOptions/publicKey}}.{{PublicKeyCredentialCreationOptions/attestationFormats}}:
[[#dictionary-makecredentialoptions]]
+- New optional {{PublicKeyCredentialUserEntity}} attributes:
+ {{PublicKeyCredentialUserEntity/language}} and {{PublicKeyCredentialUserEntity/direction}}
### Editorial Changes ### {#changes-l3-editorial}