<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WKWebView should expose API for download of a file."
   href="https://bugs.webkit.org/show_bug.cgi?id=158801#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WKWebView should expose API for download of a file."
   href="https://bugs.webkit.org/show_bug.cgi?id=158801">bug 158801</a>
              from <span class="vcard"><a class="email" href="mailto:beidson&#64;apple.com" title="Brady Eidson &lt;beidson&#64;apple.com&gt;"> <span class="fn">Brady Eidson</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=158801#c3">comment #3</a>)
<span class="quote">&gt; You can reproduce this by logging into a cloud service (ex: GoogleDrive) in
&gt; a WKWebView with the websiteDataStore configuration set to
&gt; +nonPersistentDataStore.
&gt; 
&gt; Or attempt to download a file which is directly linked to from a webpage
&gt; instead of displaying it inside of the WKWebView. This type of webpage may
&gt; be protected by HTTP Basic Authentication for example. (I can provide such a
&gt; sample site if desired.)
&gt; 
&gt; In order to download the file into the application, intercept the request in
&gt; webView:decidePolicyForNavigationAction:decisionHandler:. I am attempting
&gt; the file download using an NSURLSessionDownloadTask. Attempting to use this
&gt; request to download the file outside of WKWebView fails.</span >

So, to clarify:

- The user is browsing around in a WKWebView app.
- The user clicks on a link that the app would like to download instead of display in the WKWebView.
- The app denies the load in the policy handler, and then attempts to load the URL using an NSURLSessionDownloadTask inside the app process.
- That fails when the URL is protected by some sort of auth (cookie, http auth, ntlm, etc)

If my recounting of the above scenario is correct, then the reason it fails is because the browsing session (including cookies, credentials, etc) is held by the networking process, but since the app is trying the load inside the app process, the download doesn't go through.

Is my understanding correct?</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>