support 2fa

This commit is contained in:
Kevin Yue
2021-11-15 11:06:33 +08:00
parent 692df2f2c5
commit 781223fe4f
11 changed files with 259 additions and 11 deletions

View File

@@ -4,6 +4,7 @@
#include <QtCore/QObject>
#include "normalloginwindow.h"
#include "challengedialog.h"
#include "loginparams.h"
#include "gatewayauthenticatorparams.h"
@@ -11,7 +12,7 @@ class GatewayAuthenticator : public QObject
{
Q_OBJECT
public:
explicit GatewayAuthenticator(const QString& gateway, const GatewayAuthenticatorParams params);
explicit GatewayAuthenticator(const QString& gateway, GatewayAuthenticatorParams params);
~GatewayAuthenticator();
void authenticate();
@@ -31,16 +32,18 @@ private slots:
private:
QString gateway;
const GatewayAuthenticatorParams params;
GatewayAuthenticatorParams params;
QString preloginUrl;
QString loginUrl;
NormalLoginWindow *normalLoginWindow{ nullptr };
ChallengeDialog *challengeDialog{ nullptr };
void login(const LoginParams& loginParams);
void doAuth();
void normalAuth(QString labelUsername, QString labelPassword, QString authMessage);
void samlAuth(QString samlMethod, QString samlRequest, QString preloginUrl = "");
void showChallenge(const QString &responseText);
};
#endif // GATEWAYAUTHENTICATOR_H