Skip to content

Commit

Permalink
Add "webauthn" autocomplete token
Browse files Browse the repository at this point in the history
This allows displaying Web Authentication credentials through conditional mediation.

Fixes #7999.
  • Loading branch information
nsatragno authored Jun 16, 2022
1 parent 5aa1a59 commit eebb490
Showing 1 changed file with 77 additions and 2 deletions.
79 changes: 77 additions & 2 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -4310,6 +4310,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<ul class="brief">
<li><dfn data-x-href="https://wicg.github.io/uuid/#dfn-generate-a-random-uuid">generating a random UUID</dfn></li>
</ul>
</dd>

<dt>WebSockets</dt>

Expand All @@ -4320,6 +4321,29 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li><dfn data-x-href="https://websockets.spec.whatwg.org/#websocket"><code>WebSocket</code></dfn></li>
<li><dfn data-x-href="https://websockets.spec.whatwg.org/#make-disappear" for="WebSocket">make disappear</dfn></li>
</ul>
</dd>

<dt>Web Authentication: An API for accessing Public Key Credentials</dt>

<dd>
<p>The following terms are defined in <cite>Web Authentication: An API for accessing Public Key Credentials</cite>: <ref spec=WEBAUTHN></p>

<ul class="brief">
<li><dfn data-x-href="https://w3c.github.io/webauthn/#public-key-credential">public key credential</dfn></li>
</ul>
</dd>

<dt>Credential Management</dt>

<dd>
<p>The following terms are defined in <cite>Credential Management</cite>: <ref spec=CREDMAN></p>

<ul class="brief">
<li><dfn data-x-href="https://w3c.github.io/webappsec-credential-management/#dom-credentialmediationrequirement-conditional">conditional mediation</dfn></li>
<li><dfn data-x="credman-credential" data-x-href="https://w3c.github.io/webappsec-credential-management/#credential">credential</dfn></li>
<li><dfn data-x-href="https://w3c.github.io/webappsec-credential-management/#dom-credentialscontainer-get"><code>navigator.credentials.get()</code></dfn></li>
</ul>
</dd>
</dl>

<hr>
Expand Down Expand Up @@ -55745,6 +55769,13 @@ form.method === input; // => true</code></pre>

</ul>
</li>

<li><p>Optionally, a token that is an <span>ASCII case-insensitive</span> match for the string
"<dfn data-x="attr-fe-autocomplete-webauthn"><code>webauthn</code></dfn>", meaning the user agent
should show <span data-x="public key credential">public key credentials</span> available via
<code data-x="conditional mediation">conditional</code> mediation when the user interacts with the
form control. <code data-x="attr-fe-autocomplete-webauthn">webauthn</code> is only valid for
<code>input</code> and <code>textarea</code> elements.</p></li>
</ol>

<p>As noted earlier, the meaning of the attribute and its keywords depends on the mantle that the
Expand Down Expand Up @@ -56403,8 +56434,8 @@ MIT Room 32-G524
<h6 id="autofill-processing-model"><span id="processing-model-3"></span>Processing model</h6>

<p>Each <code>input</code> element to which the <code data-x="attr-fe-autocomplete">autocomplete</code> attribute <span data-x="concept-input-apply">applies</span>, each <code>select</code> element, and each <code>textarea</code> element, has an
<dfn>autofill hint set</dfn>, an <dfn>autofill scope</dfn>, an <dfn>autofill field name</dfn>, and
an <dfn>IDL-exposed autofill value</dfn>.</p>
<dfn>autofill hint set</dfn>, an <dfn>autofill scope</dfn>, an <dfn>autofill field name</dfn>, a
<dfn>non-autofill credential type</dfn>, and an <dfn>IDL-exposed autofill value</dfn>.</p>

<p>The <span>autofill field name</span> specifies the specific kind of data expected in the field,
e.g. "<code data-x="attr-fe-autocomplete-street-address">street-address</code>" or "<code
Expand All @@ -56415,6 +56446,21 @@ MIT Room 32-G524
data-x="attr-fe-autocomplete-fax">fax</code>" or "<code
data-x="attr-fe-autocomplete-billing">billing</code>".</p>

<p>The <span>non-autofill credential type</span> identifies a type of
<span data-x="credman-credential">credential</span> that may be offered by the user agent when the
user interacts with the field alongside other <span>autofill field</span> values. If this value is
"<code data-x="">webauthn</code>" instead of null, selecting a credential of that type will resolve
a pending <code data-x="conditional mediation">conditional</code> mediation
<code>navigator.credentials.get()</code> request, instead of autofilling the field.</p>

<div class="example">
<p>For example, a sign-in page could instruct the user agent to either autofill a saved password,
or show a <span>public key credential</span> that will resolve a pending
<code>navigator.credentials.get()</code> request. A user can select either to sign-in.</p>

<pre><code class="html">&lt;input name=password type=password autocomplete="password webauthn"></code></pre>

This comment has been minimized.

Copy link
@mtrootyy

mtrootyy Jun 17, 2022

autocomplete="password webauthn" is incorrect.
"password" as autocomplete token is not exist.
I think that autocomplete="current-password webauthn" is correct.

This comment has been minimized.

Copy link
@domenic

domenic Jun 17, 2022

Member

Thanks!

As we've discussed before, can you open issues when you find issues with merged spec text? Comments on closed PRs are not tracked.

This comment has been minimized.

Copy link
@mtrootyy
</div>

<p>The <span>autofill scope</span> identifies the group of fields whose information concerns the
same subject, and consists of the <span>autofill hint set</span> with, if
applicable, the "<code data-x="">section-*</code>" prefix, e.g. "<code data-x="">billing</code>",
Expand Down Expand Up @@ -56677,6 +56723,11 @@ MIT Room 32-G524
<td>"<code data-x="attr-fe-autocomplete-impp">impp</code>"
<td>4
<td>Contact
<tbody>
<tr>
<td>"<code data-x="attr-fe-autocomplete-webauthn">webauthn</code>"
<td>5
<td>Credential
</table>
</li>

Expand All @@ -56698,8 +56749,22 @@ MIT Room 32-G524

<li><p>Let <var>hint tokens</var> be an empty set.</p></li>

<li><p>Let <var>credential type</var> be null.</p></li>

<li><p>Let <var>IDL value</var> have the same value as <var>field</var>.</p></li>

<li>
<p>If <var>category</var> is Credential and the <var>index</var>th token in <var>tokens</var> is
an <span>ASCII case-insensitive</span> match for "<code
data-x="attr-fe-autocomplete-webauthn">webauthn</code>", then run the substeps that follow:</p>
<ol>
<li><p>Set <var>credential type</var> to "<code data-x="">webauthn</code>".</p></li>
<li><p>If the <var>index</var>th token in <var>tokens</var> is the first entry,
then skip to the step labeled <i>done</i>.</p></li>
<li><p>Decrement <var>index</var> by one.</p></li>
</ol>
</li>

<li><p>If the <var>index</var>th token in <var>tokens</var> is the first entry,
then skip to the step labeled <i>done</i>.</p></li>

Expand Down Expand Up @@ -56788,6 +56853,9 @@ MIT Room 32-G524
<li><p><i>Done</i>: Let the element's <span>autofill hint set</span> be <var>hint
tokens</var>.</p>

<li><p>Let the element's <span>non-autofill credential type</span> be <var>credential
type</var>.</p></li>

<li><p>Let the element's <span>autofill scope</span> be <var>scope tokens</var>.</p>

<li><p>Let the element's <span>autofill field name</span> be <var>field</var>.</p>
Expand Down Expand Up @@ -128074,6 +128142,9 @@ INSERT INTERFACES HERE
<dt id="refsCOOKIES">[COOKIES]</dt>
<dd><cite><a href="https://httpwg.org/specs/rfc6265.html">HTTP State Management Mechanism</a></cite>, A. Barth. IETF.</dd>

<dt id="refsCREDMAN">[CREDMAN]</dt>
<dd><cite><a href="https://w3c.github.io/webappsec-credential-management/">Credential Management</a></cite>, N. Satragno, J. Hodges, M. West. W3C.</dd>

<dt id="refsCSP">[CSP]</dt>
<dd><cite><a href="https://w3c.github.io/webappsec-csp/">Content Security Policy</a></cite>, M. West, D. Veditz. W3C.</dd>

Expand Down Expand Up @@ -128569,6 +128640,9 @@ INSERT INTERFACES HERE
<dt id="refsWEBAUDIO">[WEBAUDIO]</dt>
<dd>(Non-normative) <cite><a href="https://webaudio.github.io/web-audio-api/">Web Audio API</a></cite>, P. Adenot, H. Choi. W3C.</dd>

<dt id="refsWEBAUTHN">[WEBAUTHN]</dt>
<dd><cite><a href="https://w3c.github.io/webauthn">Web Authentication: An API for accessing Public Key Credentials</a></cite>, M. Jones, A. Kumar, E. Lundberg, D. Balfanz, V. Bharadwaj, A. Birgisson, A. Czeskis, J. Hodges, J.C. Jones, H. Le Van Gong, A. Liao, R. Lindemann, J. Bradley, C. Brand, T. Cappalli, A. Langley, G. Mandyam, M. Miller, N. Satragno, N. Steele, J. Tan, S. Weeden, M. West, J. Yasskin. W3C.</dd>

<dt id="refsWEBCODECS">[WEBCODECS]</dt>
<dd><cite><a href="https://w3c.github.io/webcodecs/">WebCodecs API</a></cite>, C. Cunningham, P. Adenot, B. Aboba. W3C.</dd>

Expand Down Expand Up @@ -129404,6 +129478,7 @@ INSERT INTERFACES HERE
Nicolas Pena Moreno,
Nikki Bee,
Niklas Gögge,
Nina Satragno,
Noah Mendelsohn,
Noah Slater,
Noam Rosenthal,
Expand Down

0 comments on commit eebb490

Please sign in to comment.