AuthenticationDialogRequest QML Type
A request for providing authentication credentials required by proxies or HTTP servers. More...
Import Statement: | import QtWebEngine 1.4 |
Since: | QtWebEngine 1.4 |
Properties
Methods
- void dialogAccept(string username, string password)
- void dialogReject()
Detailed Description
An AuthenticationDialogRequest is passed as an argument of the WebEngineView::authenticationDialogRequested signal. It is generated when basic HTTP or proxy authentication is required. The type of authentication can be checked with the type property.
The accepted property of the request indicates whether the request is handled by the user code or the default dialog should be displayed. If you set the accepted property to true
, make sure to call either dialogAccept() or dialogReject() afterwards.
The following code uses a custom dialog to handle the request:
WebEngineView { // ... onAuthenticationDialogRequested: function(request) { request.accepted = true; myDialog.request = request // keep the reference to the request myDialog.accept.connect(request.dialogAccept); myDialog.reject.connect(request.dialogReject); myDialog.visible = true; } // ... }
Property Documentation
Indicates whether the authentication dialog request has been accepted by the signal handler.
If the property is false
after any signal handlers for WebEngineView::authenticationDialogRequested have been executed, a default authentication dialog will be shown. To prevent this, set request.accepted
to true
.
The default is false
.
The hostname of the authentication proxy. Empty if type is AuthenticationTypeHTTP.
The HTTP authentication realm attribute value of the WWW-Authenticate
header. Empty if type is AuthenticationTypeProxy.
The type of the authentication request.
Constant | Description |
---|---|
WebEngineAuthenticationDialogRequest.AuthenticationTypeHTTP | HTTP authentication. |
WebEngineAuthenticationDialogRequest.AuthenticationTypeProxy | Proxy authentication. |
[read-only] url : url |
The URL of the HTTP request for which authentication was requested. In case of proxy authentication, this is a request URL which is proxied via host.
See also proxyHost.
Method Documentation
This function notifies the engine that the user accepted the dialog, providing the username and the password required for authentication.
This function notifies the engine that the user rejected the dialog and the authentication shall not proceed.
© 2017 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.