Bug 167583 - [GTK] HTTP authentication is not implemented for downloads
Summary: [GTK] HTTP authentication is not implemented for downloads
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk
Depends on:
Blocks:
 
Reported: 2017-01-30 05:20 PST by Carlos Garcia Campos
Modified: 2017-02-03 00:07 PST (History)
8 users (show)

See Also:


Attachments
Patch (2.78 KB, patch)
2017-01-30 05:23 PST, Carlos Garcia Campos
mcatanzaro: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2017-01-30 05:20:49 PST
When a normal load is converted to a download, the HTTP authentication happens before the load is converted, and the download startes already authenticated. However, downloads started by DownloadManager::startDownload use the DownloadClient API to do the authentication. We don't implement didReceiveAuthenticationChallenge() in our download client, what makes the load to be cancelled and then fail silently. We should probably add API to handle downloads authentication, but we can also forward the authentication to the web view for downloads havign a web view associated. That would cover most of the cases, like downloading from the context menu.
Comment 1 Carlos Garcia Campos 2017-01-30 05:23:01 PST
Created attachment 300099 [details]
Patch
Comment 2 WebKit Commit Bot 2017-01-30 05:24:11 PST
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Carlos Garcia Campos 2017-01-30 05:25:59 PST
Note that this patch doesn't work because of a bug in libsoup, see https://bugzilla.gnome.org/show_bug.cgi?id=777936. Downloads do not allow using stored credentials by default. This matches safari behavior, but I don't think it's desired, it's quite weird that credentials are asked again when downloading something from the context menu, and even more that the HTTP auth dialog is not filled with the stored credentials.
Comment 4 Michael Catanzaro 2017-01-30 06:27:43 PST
Comment on attachment 300099 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=300099&action=review

> Source/WebKit2/ChangeLog:9
> +        the download startes already authenticated. However, downloads started by DownloadManager::startDownload use the

startes -> starts

> Source/WebKit2/ChangeLog:12
> +        handle downloads authentication, but we can also forward the authentication to the web view for downloads havign

havign -> having
Comment 5 Carlos Garcia Campos 2017-01-30 22:29:11 PST
Committed r211407: <http://trac.webkit.org/changeset/211407>