providers/saml: handle parse error
AUTHENTIK-1K5 Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
parent
8c9748e4a0
commit
61a876b582
|
@ -3,6 +3,7 @@ from base64 import b64decode
|
|||
from dataclasses import dataclass
|
||||
from typing import Optional
|
||||
from urllib.parse import quote_plus
|
||||
from xml.etree.ElementTree import ParseError # nosec
|
||||
|
||||
import xmlsec
|
||||
from defusedxml import ElementTree
|
||||
|
@ -175,7 +176,10 @@ class AuthNRequestParser:
|
|||
)
|
||||
except xmlsec.Error as exc:
|
||||
raise CannotHandleAssertion(ERROR_FAILED_TO_VERIFY) from exc
|
||||
return self._parse_xml(decoded_xml, relay_state)
|
||||
try:
|
||||
return self._parse_xml(decoded_xml, relay_state)
|
||||
except ParseError as exc:
|
||||
raise CannotHandleAssertion(ERROR_FAILED_TO_VERIFY) from exc
|
||||
|
||||
def idp_initiated(self) -> AuthNRequest:
|
||||
"""Create IdP Initiated AuthNRequest"""
|
||||
|
|
Reference in a new issue