Skip to content

Commit ef65dbf

Browse files
Merge pull request #563 from erakli/fix_response_condition_check
Fix AuthnResponse.condition_ok to not require conditions ## 2.3.3 Element <Assertion> The <Assertion> element is of the `AssertionType` complex type. This type specifies the basic information that is common to all assertions, including the following elements and attributes: ### <Conditions> [Optional] Conditions that MUST be evaluated when assessing the validity of and/or when using the assertion. See _Section 2.5_ for additional information on how to evaluate conditions
2 parents c3d6209 + 624fc2b commit ef65dbf

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/saml2/response.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -569,11 +569,14 @@ def authn_statement_ok(self, optional=False):
569569
# check authn_statement.session_index
570570

571571
def condition_ok(self, lax=False):
572+
if not self.assertion.conditions:
573+
# Conditions is Optional for Assertion, so, if it's absent, then we
574+
# assume that its valid
575+
return True
576+
572577
if self.test:
573578
lax = True
574579

575-
# The Identity Provider MUST include a <saml:Conditions> element
576-
assert self.assertion.conditions
577580
conditions = self.assertion.conditions
578581

579582
logger.debug("conditions: %s", conditions)

0 commit comments

Comments
 (0)