Skip to content

Commit

Permalink
Merge pull request #2118 from open-dynaMIX/fix_missing_groups_from_idp
Browse files Browse the repository at this point in the history
fix: new keycloak versions omit groups in claims if no groups are set
  • Loading branch information
open-dynaMIX authored Dec 21, 2023
2 parents 5aa2f27 + d88affa commit 020a117
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion caluma/caluma_user/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def __init__(self, token: str, claims: dict):
super().__init__(token=token, claims=claims)

self.username = self.claims[settings.OIDC_USERNAME_CLAIM]
self.groups = self.claims.get(settings.OIDC_GROUPS_CLAIM)
self.groups = self.claims.get(settings.OIDC_GROUPS_CLAIM, [])
self.group = self.groups[0] if self.groups else None
self.token = token
self.is_authenticated = True
Expand Down

0 comments on commit 020a117

Please sign in to comment.