Skip to content

Commit

Permalink
Fix OpenID group mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Nov 6, 2024
1 parent 9f1502d commit db4abb6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions karma/karma/openid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,10 @@ def handle_federated_userinfo(self, user_data):
pass
return super().handle_federated_userinfo(user_data)

def automap_user_attrs(self, user, user_data):
super().automap_user_attrs(user, user_data)
groups = getattr(user_data, "groups", [])
for group_name in groups:
group = Group.objects.get_or_create(name=group_name)[0]
group.user_set.add(user)
group.save()

0 comments on commit db4abb6

Please sign in to comment.