Skip to content

Commit 624fc2b

Browse files
author
Egor Panfilov
committed
Fix AuthnResponse.condition_ok to be not so restrictive
As we can see in specs, Conditions are not required, so we should not to check assertion on its existence.
1 parent c07b12e commit 624fc2b

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)