From f8615e97126eb429ed837a16a5fbc932746afab1 Mon Sep 17 00:00:00 2001 From: peppelinux Date: Sun, 24 Jan 2021 15:01:51 +0100 Subject: [PATCH] Response with unvalued AudienceRestriction (Condition) Handling --- src/saml2/response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/saml2/response.py b/src/saml2/response.py index 50e4f6b03..950a5f6ba 100644 --- a/src/saml2/response.py +++ b/src/saml2/response.py @@ -209,10 +209,10 @@ def for_me(conditions, myself): if not restriction.audience: continue for audience in restriction.audience: - if audience.text.strip() == myself: + if audience.text and audience.text.strip() == myself: return True else: - logger.debug("AudienceRestriction - One condition not satisfied: %s != %s" % (audience.text.strip(), myself)) + logger.debug("AudienceRestriction - One condition not satisfied: {} != {}".format(audience.text, myself)) logger.debug("AudienceRestrictions not satisfied!") return False