summaryrefslogtreecommitdiffstats
path: root/src/core/authenticator_request_dialog_controller_p.h
diff options
context:
space:
mode:
authorAnu Aliyas <anu.aliyas@qt.io>2023-05-12 13:32:12 +0200
committerAnu Aliyas <anu.aliyas@qt.io>2023-07-12 17:20:57 +0200
commit605b0b3dcce24ff82c1e7a1ab3db7dace9668b81 (patch)
treee688549a6ef361f243ec82a406abb875ae0ee371 /src/core/authenticator_request_dialog_controller_p.h
parenta3452104907874f4a3ffee83ec99c639004405e6 (diff)
Support FIDO2 user verification
- Implemented AuthenticatorRequestClientDelegateQt support to handle authenticator requests. - Added FIDO user verification and resident credential support Fixes: QTBUG-90938 Fixes: QTBUG-90941 Change-Id: I6367791e1e9e8aaac27c376408377f838832f426 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/core/authenticator_request_dialog_controller_p.h')
-rw-r--r--src/core/authenticator_request_dialog_controller_p.h79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/core/authenticator_request_dialog_controller_p.h b/src/core/authenticator_request_dialog_controller_p.h
new file mode 100644
index 000000000..abb2710bf
--- /dev/null
+++ b/src/core/authenticator_request_dialog_controller_p.h
@@ -0,0 +1,79 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+
+#ifndef AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_P_H
+#define AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_P_H
+#include <QStringList>
+#include <QSharedPointer>
+#include "authenticator_request_client_delegate_qt.h"
+#include "authenticator_request_dialog_controller.h"
+
+namespace content {
+class WebContents;
+class RenderFrameHost;
+}
+
+namespace QtWebEngineCore {
+
+class AuthenticatorRequestDialogControllerPrivate
+{
+
+public:
+ AuthenticatorRequestDialogControllerPrivate(
+ content::RenderFrameHost *renderFrameHost,
+ base::WeakPtr<AuthenticatorRequestClientDelegateQt> authenticatorRequestDelegate);
+ ~AuthenticatorRequestDialogControllerPrivate();
+ void showWebAuthDialog();
+ void selectAccount(const QStringList &userList);
+ QStringList userNames() const;
+ QString relyingPartyId() const;
+ QWebEngineWebAuthUXRequest::WebAuthUXState state() const;
+ QWebEngineWebAuthPINRequest pinRequest();
+ QWebEngineWebAuthUXRequest::RequestFailureReason requestFailureReason() const;
+ void sendSelectAccountResponse(const QString &selectedAccount);
+ void setCurrentState(QWebEngineWebAuthUXRequest::WebAuthUXState uxState);
+ void setRelyingPartyId(const QString &rpId);
+
+ // Support pin functionality
+ void collectPIN(QWebEngineWebAuthPINRequest pinRequestInfo);
+ void finishCollectToken();
+ void handleRequestFailure(QWebEngineWebAuthUXRequest::RequestFailureReason reason);
+ void sendCollectPinResponse(const QString &pin);
+
+ // Deleting dialog;
+ void finishRequest();
+
+ // cancel request
+ void cancelRequest();
+ void retryRequest();
+ void startRequest(bool isConditionalRequest);
+
+ AuthenticatorRequestDialogController *q_ptr;
+
+private:
+ content::RenderFrameHost *m_renderFrameHost;
+ QStringList m_userList;
+ // QString m_selectedAccount;
+ QString m_pin;
+ QString m_relyingPartyId;
+
+ bool m_isStarted = false;
+ bool m_isConditionalRequest = false;
+ QWebEngineWebAuthUXRequest::WebAuthUXState m_currentState =
+ QWebEngineWebAuthUXRequest::NotStarted;
+ base::WeakPtr<AuthenticatorRequestClientDelegateQt> m_authenticatorRequestDelegate;
+ bool m_isDialogCreated = false;
+ QWebEngineWebAuthPINRequest m_pinRequest;
+
+ QWebEngineWebAuthUXRequest *m_request;
+ QWebEngineWebAuthUXRequest::RequestFailureReason m_requestFailureReason;
+
+ // m_pendingState holds requested steps until the UI is shown. The UI is only
+ // shown once the TransportAvailabilityInfo is available, but authenticators
+ // may request, e.g., PIN entry prior to that.
+ absl::optional<QWebEngineWebAuthUXRequest::WebAuthUXState> m_pendingState;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // AUTHENTICATOR_REQUEST_DIALOG_CONTROLLER_P_H