Skip to content

Commit a0a2e95

Browse files
author
Hans Hörberg
committed
Fix for EncryptedAssertion
1 parent 08eb8de commit a0a2e95

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/saml2/entity.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -839,12 +839,13 @@ def _parse_response(self, xmlstr, response_cls, service, binding, outstanding_ce
839839

840840
logger.debug("XMLSTR: %s" % xmlstr)
841841

842-
for encrypted_assertion in response.response.encrypted_assertion:
843-
if encrypted_assertion.extension_elements is not None:
844-
assertion_list = extension_elements_to_elements(encrypted_assertion.extension_elements, [saml])
845-
for assertion in assertion_list:
846-
_assertion = saml.assertion_from_string(str(assertion))
847-
response.response.assertion.append(_assertion)
842+
if hasattr(response.response, 'encrypted_assertion'):
843+
for encrypted_assertion in response.response.encrypted_assertion:
844+
if encrypted_assertion.extension_elements is not None:
845+
assertion_list = extension_elements_to_elements(encrypted_assertion.extension_elements, [saml])
846+
for assertion in assertion_list:
847+
_assertion = saml.assertion_from_string(str(assertion))
848+
response.response.assertion.append(_assertion)
848849

849850
if response:
850851
response = response.verify()

0 commit comments

Comments
 (0)