Fixed some stuff.
This commit is contained in:
parent
14d1c4b38c
commit
4b28b98f8c
@ -78,6 +78,8 @@ class GlobalProtectConnection(
|
|||||||
async def _prelogin(self, options: dict[str, Variant]):
|
async def _prelogin(self, options: dict[str, Variant]):
|
||||||
"""Perform prelogin request."""
|
"""Perform prelogin request."""
|
||||||
|
|
||||||
|
self.logger.debug("Begin preauth with options:", {options})
|
||||||
|
|
||||||
## Extract options from vardict
|
## Extract options from vardict
|
||||||
if "spoof_clientos" in options:
|
if "spoof_clientos" in options:
|
||||||
clientos = options["spoof_clientos"].value
|
clientos = options["spoof_clientos"].value
|
||||||
@ -143,6 +145,8 @@ class GlobalProtectConnection(
|
|||||||
# Raise a D-Bus generic prelogin failure
|
# Raise a D-Bus generic prelogin failure
|
||||||
raise errors.PreloginFailure(f"An unexpected error occurred: {rootex}")
|
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
|
# Pass XML parsing off to agent for security reasons
|
||||||
result = await self._manager.request_credentials(
|
result = await self._manager.request_credentials(
|
||||||
AuthFlows.GLOBALPROTECT_PARSE_PRELOGIN, Variant("s", res.text)
|
AuthFlows.GLOBALPROTECT_PARSE_PRELOGIN, Variant("s", res.text)
|
||||||
@ -154,11 +158,16 @@ class GlobalProtectConnection(
|
|||||||
"Received unexpected response from agent. Expected strdict (a{ss}), got "
|
"Received unexpected response from agent. Expected strdict (a{ss}), got "
|
||||||
f"{result.signature}"
|
f"{result.signature}"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
self.logger.debug("Got parsed result", result.value)
|
||||||
|
|
||||||
return result.value
|
return result.value
|
||||||
|
|
||||||
async def authenticate(self, options: dict[str, Variant]) -> Variant:
|
async def authenticate(self, options: dict[str, Variant]) -> Variant:
|
||||||
f"""{super().authenticate.__doc__}"""
|
f"""{super().authenticate.__doc__}"""
|
||||||
|
|
||||||
|
self.logger.info("Starting GlobalProtect authentication.")
|
||||||
|
|
||||||
preauth: dict[str, str] = await self._prelogin(options)
|
preauth: dict[str, str] = await self._prelogin(options)
|
||||||
|
|
||||||
if "saml-auth-method" not in preauth or "saml-request" not in preauth:
|
if "saml-auth-method" not in preauth or "saml-request" not in preauth:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user