QWebEngineWebAuthUxRequest Class

The QWebEngineWebAuthUxRequest class encapsulates the data of a WebAuth UX request. 更多...

头: #include <QWebEngineWebAuthUxRequest>
CMake: find_package(Qt6 REQUIRED COMPONENTS WebEngineCore)
target_link_libraries(mytarget PRIVATE Qt6::WebEngineCore)
qmake: QT += webenginecore
Since: Qt 6.7
实例化: WebEngineWebAuthUxRequest
继承: QObject

公共类型

enum class PinEntryError { NoError, InternalUvLocked, WrongPin, TooShort, InvalidCharacters, SameAsCurrentPin }
enum class PinEntryReason { Set, Change, Challenge }
enum class RequestFailureReason { Timeout, KeyNotRegistered, KeyAlreadyRegistered, SoftPinBlock, HardPinBlock, …, WinUserCancelled }
enum class WebAuthUxState { NotStarted, SelectAccount, CollectPin, FinishTokenCollection, RequestFailed, …, Completed }

特性

公共函数

QWebEngineWebAuthPinRequest pinRequest () const
QString relyingPartyId () const
QWebEngineWebAuthUxRequest::RequestFailureReason requestFailureReason () const
QWebEngineWebAuthUxRequest::WebAuthUxState state () const
QStringList userNames () const

公共槽

void cancel ()
void retry ()
void setPin (const QString & pin )
void setSelectedAccount (const QString & selectedAccount )

信号

void stateChanged (QWebEngineWebAuthUxRequest::WebAuthUxState state )

详细描述

This class contains the information and API for WebAuth UX. WebAuth may require user interaction during the authentication process. These requests are handled by displaying a dialog to users. QtWebEngine currently supports user verification, resident credentials, and display request failure UX requests.

QWebEngineWebAuthUxRequest models a WebAuth UX request throughout its life cycle, starting with showing a UX dialog, updating it's content through state changes, and finally closing the dialog.

WebAuth UX requests are normally triggered when the authenticator requires user interaction. It is the QWebEnginePage 's responsibility to notify the application of the new WebAuth UX requests, which it does by emitting the webAuthUxRequested signal together with a newly created QWebEngineWebAuthUxRequest. The application can then examine this request and display a WebAuth UX dialog.

The QWebEngineWebAuthUxRequest object periodically emits the stateChanged signal to notify potential observers of the current WebAuth UX states. The observers update the WebAuth dialog accordingly.

For more information about how to handle web engine authenticator requests, see the 简单浏览器 .

成员类型文档编制

enum class QWebEngineWebAuthUxRequest:: PinEntryError

This enum describes the errors that may prompt the authenticator to ask for a PIN.

常量 描述
QWebEngineWebAuthUxRequest::PinEntryError::NoError 0 没有出现错误。
QWebEngineWebAuthUxRequest::PinEntryError::InternalUvLocked 1 Internal UV is locked, so we are falling back to PIN.
QWebEngineWebAuthUxRequest::PinEntryError::WrongPin 2 The PIN the user entered does not match the authenticator PIN.
QWebEngineWebAuthUxRequest::PinEntryError::TooShort 3 The new PIN the user entered is too short.
QWebEngineWebAuthUxRequest::PinEntryError::InvalidCharacters 4 The new PIN the user entered contains invalid characters.
QWebEngineWebAuthUxRequest::PinEntryError::SameAsCurrentPin 5 The new PIN the user entered is the same as the currently set PIN.

enum class QWebEngineWebAuthUxRequest:: PinEntryReason

This enum describes the reasons that may prompt the authenticator to ask for a PIN.

常量 描述
QWebEngineWebAuthUxRequest::PinEntryReason::Set 0 A new PIN is being set.
QWebEngineWebAuthUxRequest::PinEntryReason::Change 1 The existing PIN must be changed before using this authenticator.
QWebEngineWebAuthUxRequest::PinEntryReason::Challenge 2 The existing PIN is being collected to prove user verification.

enum class QWebEngineWebAuthUxRequest:: RequestFailureReason

This enum describes the reason for WebAuth request failure.

常量 描述
QWebEngineWebAuthUxRequest::RequestFailureReason::Timeout 0 The authentication session has timed out.
QWebEngineWebAuthUxRequest::RequestFailureReason::KeyNotRegistered 1 Key is not registered with the authenticator.
QWebEngineWebAuthUxRequest::RequestFailureReason::KeyAlreadyRegistered 2 Key is already registered with the authenticator. Try to register with another Key or use another authenticator.
QWebEngineWebAuthUxRequest::RequestFailureReason::SoftPinBlock 3 The authenticator is blocked as the user entered the wrong key many times.
QWebEngineWebAuthUxRequest::RequestFailureReason::HardPinBlock 4 The authenticator is blocked as the user entered the wrong key many times and reset the PIN to use the specific authenticator again.
QWebEngineWebAuthUxRequest::RequestFailureReason::AuthenticatorRemovedDuringPinEntry 5 Authenticator removed during PIN entry.
QWebEngineWebAuthUxRequest::RequestFailureReason::AuthenticatorMissingResidentKeys 6 Authenticator doesn't have resident key support.
QWebEngineWebAuthUxRequest::RequestFailureReason::AuthenticatorMissingUserVerification 7 Authenticator doesn't have user verification support.
QWebEngineWebAuthUxRequest::RequestFailureReason::AuthenticatorMissingLargeBlob 8 Authenticator doesn't have large blob support.
QWebEngineWebAuthUxRequest::RequestFailureReason::NoCommonAlgorithms 9 No common algorithm.
QWebEngineWebAuthUxRequest::RequestFailureReason::StorageFull 10 The resident credential could not be created because the authenticator has insufficient storage.
QWebEngineWebAuthUxRequest::RequestFailureReason::UserConsentDenied 11 User consent denied.
QWebEngineWebAuthUxRequest::RequestFailureReason::WinUserCancelled 12 The user clicked Cancel in the native windows UI.

enum class QWebEngineWebAuthUxRequest:: WebAuthUxState

This enum describes the state of the current WebAuth UX request.

常量 描述
QWebEngineWebAuthUxRequest::WebAuthUxState::NotStarted 0 WebAuth UX request not started yet.
QWebEngineWebAuthUxRequest::WebAuthUxState::SelectAccount 1 The authenticator requires resident credential details. The application needs to display an account details dialog, and the user needs to select an account to proceed.
QWebEngineWebAuthUxRequest::WebAuthUxState::CollectPin 2 The authenticator requires user verification. The application needs to display a PIN request dialog.
QWebEngineWebAuthUxRequest::WebAuthUxState::FinishTokenCollection 3 The authenticator requires token/user verification (like tap on the FIDO key) to complete the process.
QWebEngineWebAuthUxRequest::WebAuthUxState::RequestFailed 4 WebAuth request failed. Display error details.
QWebEngineWebAuthUxRequest::WebAuthUxState::Cancelled 5 WebAuth request is cancelled. Close the WebAuth dialog.
QWebEngineWebAuthUxRequest::WebAuthUxState::Completed 6 WebAuth request is completed. Close the WebAuth dialog.

特性文档编制

[read-only] pinRequest : const QWebEngineWebAuthPinRequest

This property holds the WebAuth request's PIN request information.

This is needed when the current WebAuth request state is CollectPin . WebAuth Dialog displays a PIN request dialog. The user needs to enter a PIN and invoke setPin () to proceed.

访问函数:

QWebEngineWebAuthPinRequest pinRequest () const

另请参阅 QWebEngineWebAuthPinRequest , CollectPin ,和 setPin ().

[read-only] relyingPartyId : const QString

This property holds the WebAuth request's relying party id.

访问函数:

QString relyingPartyId () const

[read-only] requestFailureReason : const RequestFailureReason

This property holds the WebAuth request's failure reason.

访问函数:

QWebEngineWebAuthUxRequest::RequestFailureReason requestFailureReason () const

另请参阅 stateChanged () 和 QWebEngineWebAuthUxRequest::RequestFailureReason .

[read-only] state : const WebAuthUxState

This property holds the WebAuth request's current UX state.

stateChanged () is emitted when the current state changes. Update the WebAuth dialog in reponse to the changes in state.

访问函数:

QWebEngineWebAuthUxRequest::WebAuthUxState state () const

通知程序信号:

void stateChanged (QWebEngineWebAuthUxRequest::WebAuthUxState state )

[read-only] userNames : const QStringList

This property holds the available user names for the resident credential support. This is needed when the current WebAuth request's UX state is SelectAccount . The WebAuth dialog displays user names. The user needs to select an account to proceed.

访问函数:

QStringList userNames () const

另请参阅 SelectAccount and setSelectedAccount ().

成员函数文档编制

[slot] void QWebEngineWebAuthUxRequest:: cancel ()

Cancels the current WebAuth request.

另请参阅 QWebEngineWebAuthUxRequest::Cancelled and stateChanged ().

[slot] void QWebEngineWebAuthUxRequest:: retry ()

Retries the current WebAuth request.

另请参阅 stateChanged ().

[slot] void QWebEngineWebAuthUxRequest:: setPin (const QString & pin )

发送 pin to the authenticator that prompts for a PIN. This is needed when the current WebAuth request's UX state is CollectPin . The WebAuth request is blocked until the user responds with a PIN.

另请参阅 QWebEngineWebAuthPinRequest and CollectPin .

[slot] void QWebEngineWebAuthUxRequest:: setSelectedAccount (const QString & selectedAccount )

发送 selectedAccount name to the authenticator. This is needed when the current WebAuth request's UX state is SelectAccount . The WebAuth request is blocked until the user selects an account and invokes this method.

另请参阅 userNames and SelectAccount .

[signal] void QWebEngineWebAuthUxRequest:: stateChanged ( QWebEngineWebAuthUxRequest::WebAuthUxState state )

This signal is emitted whenever the WebAuth UX's state 改变。

注意: 通知程序信号对于特性 state .

另请参阅 state and WebAuthUxState .