Skip to content
Snippets Groups Projects
Commit 6e2ed65c authored by Tom Teichler's avatar Tom Teichler :beers:
Browse files

Allow to request groups

parent 35943230
No related branches found
No related tags found
1 merge request!718Resolve "[OpenID Connect] Group claim"
......@@ -345,6 +345,7 @@ if _settings.get("oauth2.oidc.enabled", False):
"address": _("Full home postal address"),
"email": _("Email address"),
"phone": _("Home and mobile phone"),
"groups": _("Groups"),
}
)
......
......@@ -77,6 +77,10 @@ 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