Skip to content

Commit

Permalink
Store essential SAML attrs by default
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Elrod <[email protected]>
  • Loading branch information
relrod authored and dmzoneill committed Nov 22, 2024
1 parent e3cf45a commit f24ffa1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ansible_base/authentication/authenticator_plugins/saml.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,15 @@ def extra_data(self, user, backend, response, *args, **kwargs):
if "Group" in attrs:
response["Group"] = attrs["Group"]
data = super().extra_data(user, backend, response, *args, **kwargs)

excluded_fields = ('IDP_URL', 'IDP_X509_CERT', 'IDP_ENTITY_ID')
for field, attr_name in SAMLConfiguration.settings_to_enabled_idps_fields.items():
if field in excluded_fields:
continue
field_name = self.database_instance.configuration['ENABLED_IDPS'][idp_string][attr_name]
if field_name in attrs:
data[field_name] = attrs[field_name]

return data

def get_user_groups(self, extra_groups=[]):
Expand Down

0 comments on commit f24ffa1

Please sign in to comment.