mirror of
https://github.com/ansible/awx.git
synced 2024-11-02 01:21:21 +03:00
fix a bug when Tower is integrated with ipsilon SAML server
https://github.com/ansible/ansible-tower/issues/6683
This commit is contained in:
parent
4f4af058b3
commit
b372cebf8d
@ -240,7 +240,10 @@ class TowerSAMLIdentityProvider(BaseSAMLIdentityProvider):
|
||||
another attribute to use.
|
||||
"""
|
||||
key = self.conf.get(conf_key, default_attribute)
|
||||
value = attributes[key][0] if key in attributes else None
|
||||
value = attributes[key] if key in attributes else None
|
||||
# In certain implementations (like https://pagure.io/ipsilon) this value is a string, not a list
|
||||
if isinstance(value, (list, tuple)):
|
||||
value = value[0]
|
||||
if conf_key in ('attr_first_name', 'attr_last_name', 'attr_username', 'attr_email') and value is None:
|
||||
logger.warn("Could not map user detail '%s' from SAML attribute '%s'; "
|
||||
"update SOCIAL_AUTH_SAML_ENABLED_IDPS['%s']['%s'] with the correct SAML attribute.",
|
||||
|
Loading…
Reference in New Issue
Block a user