Skip to content

Commit

Permalink
support comma-separated value for seafile_groups claim (#6131)
Browse files Browse the repository at this point in the history
IDPs like Entra ID don't support multi-value claims except for group membership, but those values don't match up easily with Seafile group IDs.

This commit support a single-value input for seafile_groups to contain commas as separator, so it can easily be used with Entra ID static values and transformations like `Join()`.
  • Loading branch information
thewilli authored May 30, 2024
1 parent 7d1f6da commit c0f7fe9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions seahub/adfs_auth/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ def sync_saml_groups(self, user, attributes):
if not seafile_groups:
return

# support a list of comma-separated IDs as seafile_groups claim
if len(seafile_groups) == 1 and ',' in seafile_groups[0]:
seafile_groups = seafile_groups[0].split(',')

saml_group_ids = [int(group_id) for group_id in seafile_groups]

joined_groups = ccnet_api.get_groups(user.username)
Expand Down

0 comments on commit c0f7fe9

Please sign in to comment.