mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
Fix saml login for portal-userauthcookie (#12)
This commit is contained in:
@@ -59,11 +59,19 @@ void SAMLLoginWindow::onResponseReceived(QJsonObject params)
|
||||
|
||||
const QString username = headers.value("saml-username").toString();
|
||||
const QString preloginCookie = headers.value("prelogin-cookie").toString();
|
||||
const QString userAuthCookie = headers.value("portal-userauthcookie").toString();
|
||||
|
||||
if (!username.isEmpty() && !preloginCookie.isEmpty()) {
|
||||
if (!username.isEmpty()) {
|
||||
samlResult.insert("username", username);
|
||||
}
|
||||
|
||||
if (!preloginCookie.isEmpty()) {
|
||||
samlResult.insert("preloginCookie", preloginCookie);
|
||||
}
|
||||
|
||||
if (!userAuthCookie.isEmpty()) {
|
||||
samlResult.insert("userAuthCookie", userAuthCookie);
|
||||
}
|
||||
}
|
||||
|
||||
void SAMLLoginWindow::onLoadFinished()
|
||||
@@ -71,7 +79,8 @@ void SAMLLoginWindow::onLoadFinished()
|
||||
LOGI << "Load finished " << this->webView->page()->url().toString();
|
||||
|
||||
// Check the SAML result
|
||||
if (!samlResult.value("username").isEmpty() && !samlResult.value("preloginCookie").isEmpty()) {
|
||||
if (samlResult.contains("username")
|
||||
&& (samlResult.contains("preloginCookie") || samlResult.contains("userAuthCookie"))) {
|
||||
emit success(samlResult);
|
||||
accept();
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user