A request for providing authentication credentials required by proxies or HTTP servers.More...
Import Statement: | import QtWebEngine 1.10 |
Since: | QtWebEngine 1.4 |
An AuthenticationDialogRequest is passed as an argument of theWebEngineView::authenticationDialogRequested signal. It is generated when basic HTTP or proxy authentication is required. The type of authentication can be checked with thetype property.
Theaccepted property of the request indicates whether the request is handled by the user code or the default dialog should be displayed. If you set theaccepted property totrue
, make sure to call eitherdialogAccept() ordialogReject() 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; }// ...}
accepted :bool |
Indicates whether the authentication dialog request has been accepted by the signal handler.
If the property isfalse
after any signal handlers forWebEngineView::authenticationDialogRequested have been executed, a default authentication dialog will be shown. To prevent this, setrequest.accepted
totrue
.
The default isfalse
.
[read-only]proxyHost :string |
The hostname of the authentication proxy. Empty iftype is AuthenticationTypeHTTP.
[read-only]realm :string |
The HTTP authentication realm attribute value of theWWW-Authenticate
header. Empty iftype is AuthenticationTypeProxy.
[read-only]type :enumeration |
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 alsoproxyHost.
This function notifies the engine that the user accepted the dialog, providing theusername and thepassword required for authentication.
This function notifies the engine that the user rejected the dialog and the authentication shall not proceed.
© 2025 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 theGNU 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.
Qt Group includes The Qt Company Oy and its global subsidiaries and affiliates.