Skip to content

Commit 4e759a4

Browse files
Merge pull request #664 from rristow/master
Provide more information in case of AudienceRestrictions conditions not satisfied
2 parents 340b954 + 92dbdd7 commit 4e759a4

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/saml2/response.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,8 @@ def for_me(conditions, myself):
212212
if audience.text.strip() == myself:
213213
return True
214214
else:
215-
# print("Not for me: %s != %s" % (audience.text.strip(),
216-
# myself))
217-
pass
218-
215+
logger.debug("AudienceRestriction - One condition not satisfied: %s != %s" % (audience.text.strip(), myself))
216+
logger.debug("AudienceRestrictions not satisfied!")
219217
return False
220218

221219

@@ -613,7 +611,7 @@ def condition_ok(self, lax=False):
613611

614612
if not for_me(conditions, self.entity_id):
615613
if not lax:
616-
raise Exception("Not for me!!!")
614+
raise Exception("AudienceRestrictions conditions not satisfied! (Local entity_id=%s)" % self.entity_id)
617615

618616
if conditions.condition: # extra conditions
619617
for cond in conditions.condition:

0 commit comments

Comments
 (0)