mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Add support to switch gateway
This commit is contained in:
@@ -140,18 +140,16 @@ void GatewayAuthenticator::samlAuth(QString samlMethod, QString samlRequest, QSt
|
||||
{
|
||||
PLOGI << "Trying to perform SAML login with saml-method " << samlMethod;
|
||||
|
||||
SAMLLoginWindow *loginWindow = samlLogin(samlMethod, samlRequest, preloginUrl);
|
||||
SAMLLoginWindow *loginWindow = new SAMLLoginWindow;
|
||||
|
||||
if (!loginWindow) {
|
||||
openMessageBox("SAML Login failed for gateway");
|
||||
return;
|
||||
}
|
||||
|
||||
connect(loginWindow, &SAMLLoginWindow::success, this, &GatewayAuthenticator::onSAMLLoginFinished);
|
||||
connect(loginWindow, &SAMLLoginWindow::success, this, &GatewayAuthenticator::onSAMLLoginSuccess);
|
||||
connect(loginWindow, &SAMLLoginWindow::fail, this, &GatewayAuthenticator::onSAMLLoginFail);
|
||||
connect(loginWindow, &SAMLLoginWindow::rejected, this, &GatewayAuthenticator::onLoginWindowRejected);
|
||||
|
||||
loginWindow->login(samlMethod, samlRequest, preloginUrl);
|
||||
}
|
||||
|
||||
void GatewayAuthenticator::onSAMLLoginFinished(const QMap<QString, QString> &samlResult)
|
||||
void GatewayAuthenticator::onSAMLLoginSuccess(const QMap<QString, QString> &samlResult)
|
||||
{
|
||||
PLOGI << "SAML login succeeded, got the prelogin cookie " << samlResult.value("preloginCookie");
|
||||
|
||||
@@ -161,3 +159,8 @@ void GatewayAuthenticator::onSAMLLoginFinished(const QMap<QString, QString> &sam
|
||||
|
||||
login(params);
|
||||
}
|
||||
|
||||
void GatewayAuthenticator::onSAMLLoginFail(const QString msg)
|
||||
{
|
||||
emit fail(msg);
|
||||
}
|
||||
|
Reference in New Issue
Block a user