-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add oidc capabilities * lint * fix: temp key for build step * fix(debug): prevent http failure in local env * feat(oidc): jwt with properties * lint * chore(black)
- Loading branch information
Showing
6 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from oauth2_provider.oauth2_validators import OAuth2Validator | ||
|
||
|
||
class LabsOAuth2Validator(OAuth2Validator): | ||
oidc_claim_scope = OAuth2Validator.oidc_claim_scope | ||
oidc_claim_scope.update( | ||
{ | ||
"name": "read", | ||
"email": "read", | ||
"pennid": "read", | ||
"is_staff": "read", | ||
"is_active": "read", | ||
} | ||
) | ||
|
||
def get_additional_claims(self, request): | ||
return { | ||
"name": request.user.preferred_name or request.user.get_full_name(), | ||
"email": request.user.email, | ||
"pennid": request.user.pennid, | ||
"is_staff": request.user.is_staff, | ||
"is_active": request.user.is_active, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters