diff --git a/src/vpn_manager_globalprotect/backend.py b/src/vpn_manager_globalprotect/backend.py index 8dda41b..7be12b4 100644 --- a/src/vpn_manager_globalprotect/backend.py +++ b/src/vpn_manager_globalprotect/backend.py @@ -78,6 +78,8 @@ class GlobalProtectConnection( async def _prelogin(self, options: dict[str, Variant]): """Perform prelogin request.""" + self.logger.debug("Begin preauth with options:", {options}) + ## Extract options from vardict if "spoof_clientos" in options: clientos = options["spoof_clientos"].value @@ -143,6 +145,8 @@ class GlobalProtectConnection( # Raise a D-Bus generic prelogin failure raise errors.PreloginFailure(f"An unexpected error occurred: {rootex}") + self.logger.debug("Got XML response:", res.text) + # Pass XML parsing off to agent for security reasons result = await self._manager.request_credentials( AuthFlows.GLOBALPROTECT_PARSE_PRELOGIN, Variant("s", res.text) @@ -154,11 +158,16 @@ class GlobalProtectConnection( "Received unexpected response from agent. Expected strdict (a{ss}), got " f"{result.signature}" ) + + self.logger.debug("Got parsed result", result.value) + return result.value async def authenticate(self, options: dict[str, Variant]) -> Variant: f"""{super().authenticate.__doc__}""" + self.logger.info("Starting GlobalProtect authentication.") + preauth: dict[str, str] = await self._prelogin(options) if "saml-auth-method" not in preauth or "saml-request" not in preauth: