Skip to content

Commit c83dfa8

Browse files
committed
fix: trim leading slash from auth callback data
1 parent 61b0505 commit c83dfa8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

crates/gpapi/src/auth.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ impl SamlAuthData {
8484

8585
pub fn from_gpcallback(data: &str) -> anyhow::Result<SamlAuthData, AuthDataParseError> {
8686
let auth_data = data.trim_start_matches("globalprotectcallback:");
87+
// Further remove the leading "/" if it exists, because some versions of GP may include it
88+
let auth_data = auth_data.trim_start_matches('/');
8789

8890
if auth_data.starts_with("cas-as") {
8991
info!("Got CAS auth data from globalprotectcallback");
@@ -104,7 +106,7 @@ impl SamlAuthData {
104106
}
105107

106108
let auth_data = decode_to_string(auth_data).map_err(|e| {
107-
warn!("Failed to decode SAML auth data: {}, data: {}", e, auth_data);
109+
warn!("Failed to decode SAML auth data: {}, data: {}", e, data);
108110
AuthDataParseError::Invalid(anyhow::anyhow!(e))
109111
})?;
110112
let auth_data = Self::from_html(&auth_data)?;

0 commit comments

Comments
 (0)