AuthenticationDialogRequest QML Type

プロキシや HTTP サーバが必要とする認証情報を提供するリクエスト。詳細...

Import Statement: import QtWebEngine
Since: QtWebEngine 1.4

プロパティ

方法

詳細説明

AuthenticationDialogRequest はWebEngineView::authenticationDialogRequested シグナルの引数として渡される。これは、基本的な HTTP 認証またはプロキシ認証が必要な場合に生成されます。認証の種類は、type プロパティで確認できます。

リクエストのaccepted プロパティは、リクエストをユーザ・コードで処理するか、デフォルトのダイアログを表示するかを示します。accepted プロパティをtrue に設定した場合は、その後に必ずdialogAccept() またはdialogReject() を呼び出します。

以下のコードでは、カスタムダイアログを使用してリクエストを処理しています:

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

認証ダイアログ要求がシグナル・ハンドラに受け入れられたかどうかを示します。

WebEngineView::authenticationDialogRequested のシグナル・ハンドラが実行された後にこのプロパティがfalse である場合、デフォルトの認証ダイアログが表示されます。これを防ぐには、request.acceptedtrue に設定します。

デフォルトはfalse です。


proxyHost : string [read-only]

認証プロキシのホスト名。type が AuthenticationTypeHTTP の場合は空。


realm : string [read-only]

WWW-Authenticate ヘッダーの HTTP authentication realm 属性値。type が AuthenticationTypeProxy の場合は空。


type : enumeration [read-only]

認証要求のタイプ。

定数説明
WebEngineAuthenticationDialogRequest.AuthenticationTypeHTTPHTTP 認証。
WebEngineAuthenticationDialogRequest.AuthenticationTypeProxyプロキシ認証。

url : url [read-only]

認証が要求された HTTP リクエストの URL。プロキシ認証の場合、これはホスト経由でプロキシされた リクエストの URL となります。

proxyHostも参照


メソッドのドキュメント

void dialogAccept(string username, string password)

この関数は、ユーザがダイアログを受理したことをエンジンに通知し、認証に必要なusernamepassword を提供します。


void dialogReject()

この関数は、ユーザがダイアログを拒否し、認証が続行されないことをエンジンに通知します。


© 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 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.