From 5f321ecab6f6c78e9557da640d7ce67db4d966a1 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Wed, 11 Nov 2015 16:05:53 -0500 Subject: [PATCH] Emit a warning for unmapped SAML paramters --- awx/main/backend.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/awx/main/backend.py b/awx/main/backend.py index 6354da0984..7b6ea7719b 100644 --- a/awx/main/backend.py +++ b/awx/main/backend.py @@ -119,6 +119,8 @@ class TowerSAMLIdentityProvider(BaseSAMLIdentityProvider): for social_attr in django_settings.SOCIAL_AUTH_SAML_ATTRS_MAP: map_attr = django_settings.SOCIAL_AUTH_SAML_ATTRS_MAP[social_attr] attrs[social_attr] = unicode(attributes[map_attr][0]) if map_attr in attributes else None + if attrs[social_attr] is None: + logger.warn("Could not map SAML attribute '%s', update SOCIAL_AUTH_SAML_ATTRS_MAP with the correct value" % social_attr) return attrs