Skip to content

Commit

Permalink
fix: new keycloak versions omit groups in claims if no groups are set
Browse files Browse the repository at this point in the history
  • Loading branch information
open-dynaMIX committed Dec 21, 2023
1 parent 5aa2f27 commit d88affa
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 d88affa

Please sign in to comment.