Skip to content
Snippets Groups Projects
Verified Commit c1dda6cc authored by Tom Teichler's avatar Tom Teichler :beers: Committed by Jonathan Weth
Browse files

Allow to request groups

(cherry picked from commit 6e2ed65c)
parent 31e88404
No related branches found
No related tags found
1 merge request!733Prepare release 2.0rc6
......@@ -351,6 +351,7 @@ if _settings.get("oauth2.oidc.enabled", False):
"address": _("Full home postal address"),
"email": _("Email address"),
"phone": _("Home and mobile phone"),
"groups": _("Groups"),
}
)
......
......@@ -72,4 +72,8 @@ class CustomOAuth2Validator(OAuth2Validator):
"postal_code": request.user.person.postal_code,
}
if "groups" in request.scopes and has_person(request.user):
for group in request.user.person.groups.all():
claims["groups"].append(group.name)
return claims
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment