From d201dc6802432b29c0362833a538b15281fca247 Mon Sep 17 00:00:00 2001 From: Johan Lundberg Date: Fri, 16 Apr 2021 17:14:40 +0200 Subject: Bandaid for crash when friendlyName is not set in metadata --- src/saml2/assertion.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/saml2/assertion.py b/src/saml2/assertion.py index c9ef1b31..d8bc12f9 100644 --- a/src/saml2/assertion.py +++ b/src/saml2/assertion.py @@ -454,7 +454,12 @@ class Policy(object): def post_entity_categories(maps, sp_entity_id=None, mds=None, required=None): restrictions = {} - required = [d['friendly_name'].lower() for d in (required or [])] + if required is not None: + _req = [] + for d in required: + local_name = get_local_name(acs=self.acs, attr=d['name'], name_format=d['name_format']) + _req.append(local_name.lower()) + required = _req if mds: ecs = mds.entity_categories(sp_entity_id) -- cgit v1.2.1