mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2026-11-18 22:16:18 -05:00
PAN-OS binds the portal authentication-override cookie (portal-userauthcookie) to the client's host-id. GpParams never had a host-id, so to_params() omitted it from prelogin, getconfig and gateway login (prelogin even lists it in REQUIRED_PARAMS, but it was never produced and got silently dropped). On portals configured for SAML at both the portal and the gateway, the portal then returns portal-userauthcookie=empty. With no cookie to present, the gateway login falls back to a second, gateway-level SAML that the server rejects with saml-auth-status=-1. Add a stable host_id to GpParams (defaulting to host_utils::derive_uuid, the same per-machine UUID used for HIP reports) and emit "host-id" from to_params(), so prelogin, getconfig and gateway login all carry a consistent host-id. The portal then issues a real portal-userauthcookie, which the gateway accepts; the failing gateway-SAML path is never taken. Fixes #491 Co-authored-by: Rafa Floresta <[email protected]>