<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>213595</bug_id>
          
          <creation_ts>2020-06-25 05:30:47 -0700</creation_ts>
          <short_desc>[WebAuthn] Use MediaOnly user gesture</short_desc>
          <delta_ts>2021-02-04 11:13:37 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKit Misc.</component>
          <version>Safari Technology Preview</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=214444</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>181943</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="ynojima">ynojima</reporter>
          <assigned_to name="Jiewen Tan">jiewen_tan</assigned_to>
          <cc>aric</cc>
    
    <cc>bart.dewater</cc>
    
    <cc>bfulgham</cc>
    
    <cc>billylo1</cc>
    
    <cc>bojan</cc>
    
    <cc>david</cc>
    
    <cc>ionescuac</cc>
    
    <cc>jiewen_tan</cc>
    
    <cc>levonkarapetyan</cc>
    
    <cc>matthew</cc>
    
    <cc>me</cc>
    
    <cc>Michael.peng</cc>
    
    <cc>ofirschwartz</cc>
    
    <cc>paul.mcnamara</cc>
    
    <cc>peterlohse</cc>
    
    <cc>teodor.atroshenko</cc>
    
    <cc>thefatbloke</cc>
    
    <cc>vganesh</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1666017</commentid>
    <comment_count>0</comment_count>
    <who name="ynojima">ynojima</who>
    <bug_when>2020-06-25 05:30:47 -0700</bug_when>
    <thetext>Congratulations for Touch ID/Face ID support! I really appreciate your efforts.

I found Safari restricts Touch ID/Face ID usage only within user activated events (Security keys are not restricted).
It seems reasonable regulation at first glance, but it also restricts calling WebAuthn within a callback of promise based asynchronous API.
Here is a pseudo code that Touch ID/Face ID is not available for registration:

```
someElement.onclick = function(){
  var optionsRequest = {
    // set some parameters
  };
  fetch(&apos;http://example.com/webauthn/attestation/options&apos;, {
      method: &quot;POST&quot;,
      body: JSON.stringify(optionsRequest)
    })
  .then(function(response) {
    var options = generateOptionsFromServerResponse(response);
    return navigator.credentials.create(options); // WebAuthn is not directly called by user activated event 
  });
}
```

Calling REST API before navigator.credentials.create.get invocation to fetch options parameters like challenge and credentialId(s) are common pattern in many sites (ex. google.com, webauthn.io), and defined practices in FIDO document [1].
What is the objective of this restriction? I assumed it is a guard for unintended Touch ID/Face ID sensor activation, but there is a dialog asking for user consent before activating the sensors. It seems it&apos;s a sufficient guard.

As far as I know, restricting local authenticators to user activated events are not defined in WebAuthn specification. 

I suppose the restriction should be removed, or extend the allowed scope to promise callback chain to improve user experience.

[1] https://fidoalliance.org/specs/fido-v2.0-rd-20180702/fido-server-v2.0-rd-20180702.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1666272</commentid>
    <comment_count>1</comment_count>
    <who name="ynojima">ynojima</who>
    <bug_when>2020-06-25 16:31:53 -0700</bug_when>
    <thetext>I heard mandating user gesture is not scandalized in W3C WebAuthn spec.
https://github.com/w3c/webauthn/issues/1293</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1666274</commentid>
    <comment_count>2</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-06-25 16:35:04 -0700</bug_when>
    <thetext>User activated event is required to use Face ID and Touch ID. This is part of the design of the platform authenticator itself. It has nothing to do with WebAuthn API part.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1666284</commentid>
    <comment_count>3</comment_count>
    <who name="ynojima">ynojima</who>
    <bug_when>2020-06-25 16:54:16 -0700</bug_when>
    <thetext>I see, but callback of promise chain originally activated by user event should be allowed at least. ( Not sure how hard it is)
As stated before, it restricts fetching option data like challenge and credentialId(s) before neavigator.credentials.create/.get call, which is a common pattern in relying party implementations.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1666536</commentid>
    <comment_count>4</comment_count>
    <who name="bsimic">bojan</who>
    <bug_when>2020-06-26 12:14:44 -0700</bug_when>
    <thetext>@Jiewan Tan, if this doesn&apos;t get fixed, it will essentially make WebAuthn unusable by any relying parties. The user activated event will still be the providing of Touch ID or Face ID. 

There are zero WebAuthn implementations that currently work using the current implementation because there is a server request required to retrieve the challenge for the options request.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1666601</commentid>
    <comment_count>5</comment_count>
    <who name="Paul McNamara">paul.mcnamara</who>
    <bug_when>2020-06-26 14:10:48 -0700</bug_when>
    <thetext>Likewise it&apos;s great to see some real progress with WebAuthn on iOS. 

I agree with the other posters though - this will break our implementation and likely many others.

Would it not make more sense to simply have a native consent UI when &quot;platform&quot; is requested? Confirmation of this would meet the user activated requirement would it not?

If the goal is to prevent nuisance popup UIs then it&apos;s currently inconsistent as you still get one if create/get are not called from within a user-activated event handler.

No other browser implementations (including OSX Safari using the touchbar) work this way to my knowledge.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1667212</commentid>
    <comment_count>6</comment_count>
    <who name="Bart de Water">bart.dewater</who>
    <bug_when>2020-06-29 11:57:00 -0700</bug_when>
    <thetext>This really confused me as well. I tried Shopify, GitHub and https://github.com/cedarcode/webauthn-rails-demo-app and none of them prompted me to use TouchID as I expected after upgrading to iPadOS 14.

Only https://webauthn.me/debugger works as expected because it&apos;s a demo using client-side generated challenges.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1667626</commentid>
    <comment_count>7</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-06-30 11:02:31 -0700</bug_when>
    <thetext>&lt;rdar://problem/64946612&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1668103</commentid>
    <comment_count>8</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-07-01 17:01:13 -0700</bug_when>
    <thetext>Hi Developers,

Removing the user gesture requirement unfortunately is not an option. The benefit of it is probably not obvious at the current stage. However as you could have imagined, the UI could evolve into a more streamlined version in the future that will certainly be beneficial by this hard requirement.

At the same time, we are considering improvement over the user gesture mechanism, like things in User Activation API that could let the user gesture bit being carried through the promise chain. However, such thing doesn&apos;t exist in WebKit yet. Implementing such improvement will take quite some time, and the improvement will probably not be shipped soon. Therefore, I suggest you could prefetch the nonce before the user action as a solution for now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1669008</commentid>
    <comment_count>9</comment_count>
    <who name="Fat Bloke">thefatbloke</who>
    <bug_when>2020-07-06 02:44:22 -0700</bug_when>
    <thetext>Just adding my disappointment to this thread. 

This approach breaks our implementation too.

This will be perceived as Apple going their own way and perverting open standards as they did with the recent OpenId Connect/Sign in with Apple debacle.

https://openid.net/2019/06/27/open-letter-from-the-openid-foundation-to-apple-regarding-sign-in-with-apple/

Please Apple, review this restriction.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1669556</commentid>
    <comment_count>10</comment_count>
    <who name="Alex">ionescuac</who>
    <bug_when>2020-07-07 15:17:42 -0700</bug_when>
    <thetext>I also would like to express my disappointment in this decision. By requiring websites to update their ordering of REST calls leaves a poor user experience when they wonder why they can login into one website with WebAuthn, but not in another, when in reality it should work with both websites.

Why is it not possible to show a consistent dialog, such as Apple Pay which requires user consent to trigger authentication by a new fingerprint touch or double tap to activate Face ID scan and preserve existing behavior?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672398</commentid>
    <comment_count>11</comment_count>
      <attachid>404536</attachid>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-07-16 21:59:56 -0700</bug_when>
    <thetext>Created attachment 404536
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672549</commentid>
    <comment_count>12</comment_count>
      <attachid>404536</attachid>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2020-07-17 10:58:45 -0700</bug_when>
    <thetext>Comment on attachment 404536
Patch

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672551</commentid>
    <comment_count>13</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2020-07-17 11:00:08 -0700</bug_when>
    <thetext>For those following along on this radar, we have revised the handling of user gesture to follow the model of our media gesture requirements. This should resolve many of the concerns raised in this thread.

It is helpful to have specific examples of cases where you find the user gesture to be a problem so we can review and see if we can find a path forward that complies with the requirements of our Local Authentication features on our devices.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672553</commentid>
    <comment_count>14</comment_count>
    <who name="Alex">ionescuac</who>
    <bug_when>2020-07-17 11:13:41 -0700</bug_when>
    <thetext>https://webauthn.io/ is a good website to test with where this bug is triggered.
You can also create a free Okta tenant at https://developer.okta.com and test there as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672578</commentid>
    <comment_count>15</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-07-17 12:15:44 -0700</bug_when>
    <thetext>This patch should have resolved issues with XHR, but not Fetch API. Bug 214444 is tracking the progress of Fetch API.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672580</commentid>
    <comment_count>16</comment_count>
      <attachid>404536</attachid>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-07-17 12:16:34 -0700</bug_when>
    <thetext>Comment on attachment 404536
Patch

Thanks Brent for r+ this patch.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672582</commentid>
    <comment_count>17</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2020-07-17 12:30:28 -0700</bug_when>
    <thetext>Committed r264528: &lt;https://trac.webkit.org/changeset/264528&gt;

All reviewed patches have been landed. Closing bug and clearing flags on attachment 404536.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672725</commentid>
    <comment_count>18</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-07-17 16:41:30 -0700</bug_when>
    <thetext>(In reply to Alex from comment #14)
&gt; https://webauthn.io/ is a good website to test with where this bug is
&gt; triggered.
&gt; You can also create a free Okta tenant at https://developer.okta.com and
&gt; test there as well.

Confirmed this fix works for the first website. For the second one, it&apos;s not obvious for me where I could register the platform authenticator.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672749</commentid>
    <comment_count>19</comment_count>
    <who name="Alex">ionescuac</who>
    <bug_when>2020-07-17 17:27:20 -0700</bug_when>
    <thetext>Honestly if it works with that website you should be good to go, but here is how you would enable it on Okta.

Login to your developer okta tenant with username &amp; password. If you see Developer Console in the top left of the page, click it and select Classic UI to switch. Then under Security --&gt; MultiFactor you can enable WebAuthn as available for your tenant. Afterwards, leave the Okta admin portal and go back to the user profile page. You&apos;ll be able to enroll the factor there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1672808</commentid>
    <comment_count>20</comment_count>
    <who name="">vganesh</who>
    <bug_when>2020-07-18 11:01:56 -0700</bug_when>
    <thetext>Which iOS release would this be available in? Will it be in beta3?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1694722</commentid>
    <comment_count>21</comment_count>
    <who name="Billy Lo">billylo1</who>
    <bug_when>2020-10-05 09:17:40 -0700</bug_when>
    <thetext>(In reply to Jiewen Tan from comment #18)
&gt; (In reply to Alex from comment #14)
&gt; &gt; https://webauthn.io/ is a good website to test with where this bug is
&gt; &gt; triggered.
&gt; &gt; You can also create a free Okta tenant at https://developer.okta.com and
&gt; &gt; test there as well.
&gt; 
&gt; Confirmed this fix works for the first website. For the second one, it&apos;s not
&gt; obvious for me where I could register the platform authenticator.

Hi, Jiewen: which iOS/Safari version did you use for verification?  Would like to replicate it for our site too. thx.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1694756</commentid>
    <comment_count>22</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-10-05 10:56:38 -0700</bug_when>
    <thetext>(In reply to Billy Lo from comment #21)
&gt; (In reply to Jiewen Tan from comment #18)
&gt; &gt; (In reply to Alex from comment #14)
&gt; &gt; &gt; https://webauthn.io/ is a good website to test with where this bug is
&gt; &gt; &gt; triggered.
&gt; &gt; &gt; You can also create a free Okta tenant at https://developer.okta.com and
&gt; &gt; &gt; test there as well.
&gt; &gt; 
&gt; &gt; Confirmed this fix works for the first website. For the second one, it&apos;s not
&gt; &gt; obvious for me where I could register the platform authenticator.
&gt; 
&gt; Hi, Jiewen: which iOS/Safari version did you use for verification?  Would
&gt; like to replicate it for our site too. thx.

iOS 14 and macOS Big Sur beta.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1701297</commentid>
    <comment_count>23</comment_count>
    <who name="Aric">aric</who>
    <bug_when>2020-10-25 09:03:35 -0700</bug_when>
    <thetext>Version 14.0 (14610.1.28.1.10)
10.14.6 (18G6032)
MacBook Pro (15-inch, 2019)

As far as I can tell this issue remains. 
Safari always prompts for security key, never Touch ID.

Sites tested:
webauthn.me
webauthn.io</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1701595</commentid>
    <comment_count>24</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-10-26 13:35:45 -0700</bug_when>
    <thetext>(In reply to Aric from comment #23)
&gt; Version 14.0 (14610.1.28.1.10)
&gt; 10.14.6 (18G6032)
&gt; MacBook Pro (15-inch, 2019)
&gt; 
&gt; As far as I can tell this issue remains. 
&gt; Safari always prompts for security key, never Touch ID.
&gt; 
&gt; Sites tested:
&gt; webauthn.me
&gt; webauthn.io

Do you check isUVPAA? Touch ID won&apos;t work on any macOS before Big Sur.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1704210</commentid>
    <comment_count>25</comment_count>
    <who name="Michael">Michael.peng</who>
    <bug_when>2020-11-03 14:13:47 -0800</bug_when>
    <thetext>Hi Jiewen Tan, we&apos;ve noticed a couple of things:

1) TouchID prompt is not seen when WebAuthn API is invoked as a result of event trigger.
e.g. Button is clicked + API call is made to backend to get challenge and on success we trigger an event. 
Then, event listener calls credentials.create.
Can we fix this? 
2) Today, to avoid many clicks we programatically trigger credentials.get as soon as user lands on the WebAuthn screen in login flow. Chrome allows it on MacOS and doesn&apos;t filter TouchID. Is Safari going to fix this to have the same behavior, or do we need to have an explicit click from the user triggering the WebAuthn prompt? Just trying to understand what the direction is, and the degree of user interaction required.

Thank you very much for your time and help!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1704225</commentid>
    <comment_count>26</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-11-03 14:49:23 -0800</bug_when>
    <thetext>(In reply to Michael from comment #25)
&gt; Hi Jiewen Tan, we&apos;ve noticed a couple of things:
&gt; 
&gt; 1) TouchID prompt is not seen when WebAuthn API is invoked as a result of
&gt; event trigger.
&gt; e.g. Button is clicked + API call is made to backend to get challenge and on
&gt; success we trigger an event. 
&gt; Then, event listener calls credentials.create.
&gt; Can we fix this? 

Can you be more specific? Can you file another bug and upload your test case?

&gt; 2) Today, to avoid many clicks we programatically trigger credentials.get as
&gt; soon as user lands on the WebAuthn screen in login flow. Chrome allows it on
&gt; MacOS and doesn&apos;t filter TouchID. Is Safari going to fix this to have the
&gt; same behavior, or do we need to have an explicit click from the user
&gt; triggering the WebAuthn prompt? Just trying to understand what the direction
&gt; is, and the degree of user interaction required.

For us, it&apos;s going to require user interactions.

&gt; 
&gt; Thank you very much for your time and help!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1704622</commentid>
    <comment_count>27</comment_count>
    <who name="Michael">Michael.peng</who>
    <bug_when>2020-11-04 15:03:14 -0800</bug_when>
    <thetext>Hi Jiewan, thanks for your quick reply. Understood on the user interaction requirement. We can create a separate issue later with a js fiddle or similar example implementation to illustrate the callback issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1705685</commentid>
    <comment_count>28</comment_count>
    <who name="Levon Karapetyan">levonkarapetyan</who>
    <bug_when>2020-11-09 03:35:07 -0800</bug_when>
    <thetext>Hi,

I have noticed that when the geolocation API is used between user click and WebAuthn call, then Safari on iOS 14 restricts Touch ID/Face ID usage. I&apos;d like to know whether this is also a bug or the expected behavior.

Here is a code example:
document.getElementById(&quot;mybutton&quot;).onclick = function() {
    navigator.geolocation.getCurrentPosition(register, register);
}

function register() {
    var options = {...};
    navigator.credentials.create({
        publicKey: options
    })
    .then(console.log)
    .catch(console.error);
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1705799</commentid>
    <comment_count>29</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-11-09 11:54:14 -0800</bug_when>
    <thetext>(In reply to Levon Karapetyan from comment #28)
&gt; Hi,
&gt; 
&gt; I have noticed that when the geolocation API is used between user click and
&gt; WebAuthn call, then Safari on iOS 14 restricts Touch ID/Face ID usage. I&apos;d
&gt; like to know whether this is also a bug or the expected behavior.
&gt; 
&gt; Here is a code example:
&gt; document.getElementById(&quot;mybutton&quot;).onclick = function() {
&gt;     navigator.geolocation.getCurrentPosition(register, register);
&gt; }
&gt; 
&gt; function register() {
&gt;     var options = {...};
&gt;     navigator.credentials.create({
&gt;         publicKey: options
&gt;     })
&gt;     .then(console.log)
&gt;     .catch(console.error);
&gt; }

That&apos;s expected behavior. However, I will encourage you to file a bug and cc me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1707327</commentid>
    <comment_count>30</comment_count>
    <who name="Aric">aric</who>
    <bug_when>2020-11-13 11:32:09 -0800</bug_when>
    <thetext>(In reply to Jiewen Tan from comment #24)
&gt; (In reply to Aric from comment #23)
&gt; &gt; Version 14.0 (14610.1.28.1.10)
&gt; &gt; 10.14.6 (18G6032)
&gt; &gt; MacBook Pro (15-inch, 2019)
&gt; &gt; 
&gt; &gt; As far as I can tell this issue remains. 
&gt; &gt; Safari always prompts for security key, never Touch ID.
&gt; &gt; 
&gt; &gt; Sites tested:
&gt; &gt; webauthn.me
&gt; &gt; webauthn.io
&gt; 
&gt; Do you check isUVPAA? Touch ID won&apos;t work on any macOS before Big Sur.

Touch ID works fine on these same sites with Mojave+ and Chrome. The published updates indicated this would work in Safari 14, and Safari 14 is now available on Mojave. Can you point me to the documentation that says you must have Big Sur to make this work?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1707361</commentid>
    <comment_count>31</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-11-13 12:49:42 -0800</bug_when>
    <thetext>(In reply to Aric from comment #30)
&gt; (In reply to Jiewen Tan from comment #24)
&gt; &gt; (In reply to Aric from comment #23)
&gt; &gt; &gt; Version 14.0 (14610.1.28.1.10)
&gt; &gt; &gt; 10.14.6 (18G6032)
&gt; &gt; &gt; MacBook Pro (15-inch, 2019)
&gt; &gt; &gt; 
&gt; &gt; &gt; As far as I can tell this issue remains. 
&gt; &gt; &gt; Safari always prompts for security key, never Touch ID.
&gt; &gt; &gt; 
&gt; &gt; &gt; Sites tested:
&gt; &gt; &gt; webauthn.me
&gt; &gt; &gt; webauthn.io
&gt; &gt; 
&gt; &gt; Do you check isUVPAA? Touch ID won&apos;t work on any macOS before Big Sur.
&gt; 
&gt; Touch ID works fine on these same sites with Mojave+ and Chrome. The
&gt; published updates indicated this would work in Safari 14, and Safari 14 is
&gt; now available on Mojave. Can you point me to the documentation that says you
&gt; must have Big Sur to make this work?

https://webkit.org/blog/11312/meet-face-id-and-touch-id-for-the-web/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1714358</commentid>
    <comment_count>32</comment_count>
    <who name="Teodor">teodor.atroshenko</who>
    <bug_when>2020-12-13 16:49:14 -0800</bug_when>
    <thetext>I think there is another common use-case that was missed.

When using WebAuthn as a second factor during authentication, combined with Safari&apos;s credential autofill, we get into a situation where the user is automatically trapped by Safari into a failed authentication with application code having very little control.

User opens the login page in Safari, they see the auto-login/autofill card appear on the bottom of the screen. They click on their email address there, which causes the &lt;form&gt; to be automatically submitted. The code that handles form submit then sends a fetch() request that resolves with options for credentials.get call. At this point, it is indistinguishable between form having been submitted via Enter key press, or auto-submitted by auto-fill. So calling credentials.get at this point results in a confusing prompt about inserting the security key, while the user is expecting FaceID to activate.

Yes, hacks can be applied to detect keypresses in form fields, among others. But I think that the correct solution is to treat the user-activated autofill of credentials as a user gesture.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1714773</commentid>
    <comment_count>33</comment_count>
    <who name="Teodor">teodor.atroshenko</who>
    <bug_when>2020-12-15 09:26:47 -0800</bug_when>
    <thetext>Furthermore, ASWebAuthenticationSession should be exempt from the user gesture requirement. Any native app that relies on web-based authentication (either first- or third-party) that in turn may use WebAuthn, should be trusted in the same manner that calling LAContext with enrolled Face ID results in an immediate scan.

I do think that this issue is not resolved, as expected authentication flows are still not working. But if you think that I should file a separate bug report, let me know.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1714833</commentid>
    <comment_count>34</comment_count>
    <who name="Jiewen Tan">jiewen_tan</who>
    <bug_when>2020-12-15 11:21:59 -0800</bug_when>
    <thetext>(In reply to Teodor from comment #32)
&gt; I think there is another common use-case that was missed.
&gt; 
&gt; When using WebAuthn as a second factor during authentication, combined with
&gt; Safari&apos;s credential autofill, we get into a situation where the user is
&gt; automatically trapped by Safari into a failed authentication with
&gt; application code having very little control.
&gt; 
&gt; User opens the login page in Safari, they see the auto-login/autofill card
&gt; appear on the bottom of the screen. They click on their email address there,
&gt; which causes the &lt;form&gt; to be automatically submitted. The code that handles
&gt; form submit then sends a fetch() request that resolves with options for
&gt; credentials.get call. At this point, it is indistinguishable between form
&gt; having been submitted via Enter key press, or auto-submitted by auto-fill.
&gt; So calling credentials.get at this point results in a confusing prompt about
&gt; inserting the security key, while the user is expecting FaceID to activate.
&gt; 
&gt; Yes, hacks can be applied to detect keypresses in form fields, among others.
&gt; But I think that the correct solution is to treat the user-activated
&gt; autofill of credentials as a user gesture.

Thanks for your feedback. Can you file a separate bug on this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1725702</commentid>
    <comment_count>35</comment_count>
    <who name="David Earl">david</who>
    <bug_when>2021-02-04 11:13:37 -0800</bug_when>
    <thetext>I have been trying this on my test example (at https://webauthn.savesnine.info ) on iPad OS 14.4 and on iOS 14.4, in response to a user bug report re the code that implements that example, that webauthn with iPhone fingerprint had stopped working.

It works for me - in the example. But it fails in the same way as the bug they submitted in a real world app.

The difference is they are in Japan and I am in the UK, only a few km from my server. Their server round trip (and also the server response in a real app) is significantly longer than me using the example.

I tried adding a setTimeout so the workflow becomes click - fetch credentials/challenge - receive them in callabck - wait for setTimeout callback - ask for authentication in setTimeout callback

This still works for me in the example case for timeouts below 700ms. At 800ms it fails. It looks to me like there is a timer after the last user interaction during which the authentication request is allowed (probably 1s - my 800ms artificial delay + server roundtrip, seems plausible). My Japanese correspondent has a much longer round trip time (and you may or may not also if you try the example).

I am not clear from the discussion here what release version of iOS this is fixed in, and whether that time delay IS the fix or is what it was before the fix this bug refers to and the real fix hasn&apos;t got into a public release yet. If 14.4 should work, then it doesn&apos;t, at least not when there is a sufficient delay between pressing the button and asking for authentication.

When it works for me (short roundtrip) I get one iOS box pop up which asks which method I&apos;d like to use, I reply fingerprint, and then I get the fingerprint prompt. When it fails, I just get an invitation to plug in my security key. The only difference is the length of time it takes to ask the server for the challenge/credentials.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>404536</attachid>
            <date>2020-07-16 21:59:56 -0700</date>
            <delta_ts>2020-07-17 12:30:28 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-213595-20200716215956.patch</filename>
            <type>text/plain</type>
            <size>2791</size>
            <attacher name="Jiewen Tan">jiewen_tan</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjY0NDk4CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViS2l0L0No
YW5nZUxvZyBiL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCmluZGV4IDI2ZmVhZTU3MjVlN2UxMGZj
MGFjZTA3OWQ0N2ZkYTc2OTNiZTIwMTkuLjc2NTJkNjVmMzVjNWM2NTg5YWQyNDVkYjU3NzQyMzQ5
MTBlNmI3YmUgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9XZWJLaXQvQ2hhbmdlTG9nCisrKyBiL1NvdXJj
ZS9XZWJLaXQvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTkgQEAKKzIwMjAtMDctMTYgIEppZXdlbiBU
YW4gIDxqaWV3ZW5fdGFuQGFwcGxlLmNvbT4KKworICAgICAgICBbV2ViQXV0aG5dIFVzZSBNZWRp
YU9ubHkgdXNlciBnZXN0dXJlCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3df
YnVnLmNnaT9pZD0yMTM1OTUKKyAgICAgICAgPHJkYXI6Ly9wcm9ibGVtLzY0OTQ2NjEyPgorCisg
ICAgICAgIFJldmlld2VkIGJ5IE5PQk9EWSAoT09QUyEpLgorCisgICAgICAgIE1lZGlhT25seSB1
c2VyIGdlc3R1cmUgaXMgbW9yZSBmbGV4aWJsZSB0aGFuIHJlZ3VsYXIgdXNlciBnZXN0dXJlLiBG
b3IgZXhhbXBsZSwgaXQgY2FuIGJlIHByb3BhZ2F0ZWQgdGhyb3VnaCBYSFIuCisgICAgICAgIEEg
Y29tbW9uIHVzZSBjYXNlIGZvciBXZWJBdXRobiBpcyB0byBjYWxsIHRoZSBBUEkgd2l0aGluIFhI
UiBldmVudHMsIHdoaWNoIGNvdWxkIGJlIHRyaWdnZXJlZCBieSB1c2VyIGFjdGl2YXRlZCBldmVu
dHM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