Bug 167583

Summary: [GTK] HTTP authentication is not implemented for downloads
Product: WebKit Reporter: Carlos Garcia Campos <cgarcia>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, calvaris, commit-queue, danw, gustavo, mcatanzaro, mrobinson
Priority: P2 Keywords: Gtk
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=167584
https://bugzilla.gnome.org/show_bug.cgi?id=778061
Attachments:
Description Flags
Patch mcatanzaro: review+

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>