[webkit-gtk] Authentication dialog API

Brian Holt brian.holt at samsung.com
Fri Jul 19 07:21:53 PDT 2013


Hi WebKitGtk+,

I'm creating the API for the Authentication Dialog (see https://trac.webkit.org/wiki/WebKitGTK/WebKit2Roadmap) tracked under https://bugs.webkit.org/show_bug.cgi?id=99352.  The basic idea is that some application authors might want to bring up their own authentication dialog for http authentication, and so this work is to enable them to do so by connecting to a new signal and interacting with a new API.

A prototype is working, now I just need to check that I've got the names and architecture right.

When  WebLoaderClient::didReceiveAuthenticationChallengeInFrame() is called I propose to create a new WebkitAuthenticationDialogRequest object. This class will be the public interface for the authentication request and I propose that it have the following public API:

WEBKIT_API void
webkit_authentication_dialog_request_set_username                        (WebKitAuthenticationDialogRequest *request,
                                                                                                                                         const gchar *username);

WEBKIT_API const gchar *
webkit_authentication_dialog_request_get_username                        (WebKitAuthenticationDialogRequest *request);

WEBKIT_API void
webkit_authentication_dialog_request_set_password                        (WebKitAuthenticationDialogRequest *request,
                                                                                                                                        const gchar* password);

WEBKIT_API const gchar *
webkit_authentication_dialog_request_get_password                        (WebKitAuthenticationDialogRequest *request);

WEBKIT_API void
webkit_authentication_dialog_request_set_remember_password               (WebKitAuthenticationDialogRequest *request,
                                                                                                                                                       gboolean remember);

WEBKIT_API gboolean
webkit_authentication_dialog_request_get_remember_password               (WebKitAuthenticationDialogRequest *request);

WEBKIT_API void
webkit_authentication_dialog_request_set_private_browsing                (WebKitAuthenticationDialogRequest *request,
                                                                                                                                                gboolean privateBrowsingEnabled);

WEBKIT_API gboolean
webkit_authentication_dialog_request_get_private_browsing                (WebKitAuthenticationDialogRequest *request);

WEBKIT_API void
webkit_authentication_dialog_request_authenticate                        (WebKitAuthenticationDialogRequest *request);

WEBKIT_API void
webkit_authentication_dialog_request_cancel                              (WebKitAuthenticationDialogRequest *request);

To support the existing webkitAuthenticationDialog  custom widget without much change I propose to also support a private pair of functions to access the AuthenticationChallengeProxy*

void
webkit_authentication_dialog_request_set_authentication_challenge  (WebKitAuthenticationDialogRequest *request,
                                                                                                                                                   WebKit::AuthenticationChallengeProxy * authenticationChallenge);

WebKit::AuthenticationChallengeProxy*
webkit_authentication_dialog_request_get_authentication_challenge  (WebKitAuthenticationDialogRequest *request);


More information about the webkit-gtk mailing list