File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change 22
33
44class IonOIDCValidator (OAuth2Validator ):
5+ oidc_claim_scope = OAuth2Validator .oidc_claim_scope .copy ()
6+ oidc_claim_scope .update ({"groups" : "groups" }) # manually add it since groups is not part of the standard OIDC spec
7+
58 def get_additional_claims (self , request ):
69 claims = {}
710 user = request .user
@@ -24,4 +27,11 @@ def get_additional_claims(self, request):
2427 }
2528 )
2629
30+ if "groups" in request .scopes :
31+ claims .update (
32+ {
33+ "groups" : list (user .groups .values_list ("name" , flat = True )),
34+ }
35+ )
36+
2737 return claims
Original file line number Diff line number Diff line change @@ -648,6 +648,9 @@ def get_oidc_private_key():
648648 "email" : (
649649 "Access your notification email using OpenID Connect. This is either your personal email or, if unset, your @tjhsst.edu email address."
650650 ),
651+ "groups" : (
652+ "Access groups you are in using OpenID Connect, such as your grade level."
653+ )
651654 },
652655 # OAuth refresh tokens expire in 30 days
653656 "REFRESH_TOKEN_EXPIRE_SECONDS" : 60 * 60 * 24 * 30 ,
You can’t perform that action at this time.
0 commit comments