diff --git a/backend/accounts/models.py b/backend/accounts/models.py index 955444b..edcaceb 100644 --- a/backend/accounts/models.py +++ b/backend/accounts/models.py @@ -71,7 +71,7 @@ class User(AbstractUser): @property def id(self): - return self.username + return self.uuid def get_preferred_name(self): if self.preferred_name != "": diff --git a/backend/accounts/oauth2_validator.py b/backend/accounts/oauth2_validator.py index 8d8f7fe..cf37cc8 100644 --- a/backend/accounts/oauth2_validator.py +++ b/backend/accounts/oauth2_validator.py @@ -7,6 +7,7 @@ class LabsOAuth2Validator(OAuth2Validator): { "name": "read", "email": "read", + "pennkey": "read", "pennid": "read", "is_staff": "read", "is_active": "read", @@ -17,6 +18,7 @@ def get_additional_claims(self, request): return { "name": request.user.preferred_name or request.user.get_full_name(), "email": request.user.get_email(), + "pennkey": request.user.username, "pennid": request.user.pennid, "is_staff": request.user.is_staff, "is_active": request.user.is_active,