providers/saml: handle uncompressed SAML AuthNRequest
This commit is contained in:
parent
e138076e1d
commit
447e81d0b8
|
@ -159,8 +159,9 @@ class Processor:
|
||||||
request_acs_url = self._request_params["ACS_URL"]
|
request_acs_url = self._request_params["ACS_URL"]
|
||||||
|
|
||||||
if self._remote.acs_url != request_acs_url:
|
if self._remote.acs_url != request_acs_url:
|
||||||
msg = "couldn't find ACS url '{}' in SAML2IDP_REMOTES " "setting.".format(
|
msg = (
|
||||||
request_acs_url
|
f"ACS URL of {request_acs_url} doesn't match Provider "
|
||||||
|
f"ACS URL of {self._remote.acs_url}."
|
||||||
)
|
)
|
||||||
self._logger.info(msg)
|
self._logger.info(msg)
|
||||||
raise CannotHandleAssertion(msg)
|
raise CannotHandleAssertion(msg)
|
||||||
|
|
|
@ -6,7 +6,10 @@ import zlib
|
||||||
def decode_base64_and_inflate(b64string):
|
def decode_base64_and_inflate(b64string):
|
||||||
"""Base64 decode and ZLib decompress b64string"""
|
"""Base64 decode and ZLib decompress b64string"""
|
||||||
decoded_data = base64.b64decode(b64string)
|
decoded_data = base64.b64decode(b64string)
|
||||||
return zlib.decompress(decoded_data, -15)
|
try:
|
||||||
|
return zlib.decompress(decoded_data, -15)
|
||||||
|
except zlib.error:
|
||||||
|
return decoded_data
|
||||||
|
|
||||||
|
|
||||||
def deflate_and_base64_encode(string_val):
|
def deflate_and_base64_encode(string_val):
|
||||||
|
|
Reference in New Issue