diff options
author | Ivan Kanakarakis <ivan.kanak@gmail.com> | 2020-02-02 17:43:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-02 17:43:16 +0100 |
commit | 4e759a43a48a19a91dbe50f7193a91d8cb014e8d (patch) | |
tree | 128cb240f3d876aec1e8ee9078d4ce457f85b71c | |
parent | 340b95482dfa7c558b5bb3ad90ae9b8a81061a96 (diff) | |
parent | 92dbdd79178b142721e6409b56c07c8333b66d26 (diff) | |
download | pysaml2-4e759a43a48a19a91dbe50f7193a91d8cb014e8d.tar.gz |
Merge pull request #664 from rristow/master
Provide more information in case of AudienceRestrictions conditions not satisfied
-rw-r--r-- | src/saml2/response.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/saml2/response.py b/src/saml2/response.py index f61a376f..f2e2f53e 100644 --- a/src/saml2/response.py +++ b/src/saml2/response.py @@ -212,10 +212,8 @@ def for_me(conditions, myself): if audience.text.strip() == myself: return True else: - # print("Not for me: %s != %s" % (audience.text.strip(), - # myself)) - pass - + logger.debug("AudienceRestriction - One condition not satisfied: %s != %s" % (audience.text.strip(), myself)) + logger.debug("AudienceRestrictions not satisfied!") return False @@ -613,7 +611,7 @@ class AuthnResponse(StatusResponse): if not for_me(conditions, self.entity_id): if not lax: - raise Exception("Not for me!!!") + raise Exception("AudienceRestrictions conditions not satisfied! (Local entity_id=%s)" % self.entity_id) if conditions.condition: # extra conditions for cond in conditions.condition: |