1
0
mirror of https://github.com/ansible/awx.git synced 2024-11-01 08:21:15 +03:00

Merge pull request #4796 from wenottingham/get-our-finest-attributes

Fix SAML login when only certain attributes are set.

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot] 2019-09-21 15:51:43 +00:00 committed by GitHub
commit c628a54c79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -158,9 +158,9 @@ def update_user_orgs_by_saml_attr(backend, details, user=None, *args, **kwargs):
remove_admins = bool(org_map.get('remove_admins', True))
remove_auditors = bool(org_map.get('remove_auditors', True))
attr_values = kwargs.get('response', {}).get('attributes', {}).get(org_map['saml_attr'], [])
attr_admin_values = kwargs.get('response', {}).get('attributes', {}).get(org_map['saml_admin_attr'], [])
attr_auditor_values = kwargs.get('response', {}).get('attributes', {}).get(org_map['saml_auditor_attr'], [])
attr_values = kwargs.get('response', {}).get('attributes', {}).get(org_map.get('saml_attr'), [])
attr_admin_values = kwargs.get('response', {}).get('attributes', {}).get(org_map.get('saml_admin_attr'), [])
attr_auditor_values = kwargs.get('response', {}).get('attributes', {}).get(org_map.get('saml_auditor_attr'), [])
_update_org_from_attr(user, "member_role", attr_values, remove, False)
_update_org_from_attr(user, "admin_role", attr_admin_values, False, remove_admins)