mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-04-02 18:31:50 -04:00
Retry auth if failed to obtain the auth cookie
This commit is contained in:
parent
c408482c55
commit
3736189308
@ -413,7 +413,19 @@ fn read_auth_data(main_resource: &WebResource, auth_result_tx: mpsc::UnboundedSe
|
|||||||
}
|
}
|
||||||
Err(AuthDataError::NotFound) => {
|
Err(AuthDataError::NotFound) => {
|
||||||
info!("No auth data found in headers, trying to read from body...");
|
info!("No auth data found in headers, trying to read from body...");
|
||||||
|
let url = main_resource.uri().unwrap_or("".into());
|
||||||
|
let is_acs_endpoint = url.contains("/SAML20/SP/ACS");
|
||||||
|
|
||||||
read_auth_data_from_body(main_resource, move |auth_result| {
|
read_auth_data_from_body(main_resource, move |auth_result| {
|
||||||
|
// If the endpoint is `/SAML20/SP/ACS` and no auth data found in body, it should be considered as invalid
|
||||||
|
let auth_result = auth_result.map_err(|err| {
|
||||||
|
if matches!(err, AuthDataError::NotFound) && is_acs_endpoint {
|
||||||
|
AuthDataError::Invalid
|
||||||
|
} else {
|
||||||
|
err
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
send_auth_result(&auth_result_tx, auth_result)
|
send_auth_result(&auth_result_tx, auth_result)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user