Skip to content

Commit 8db6ab7

Browse files
committed
Make sure token.scopes exists.
1 parent 9c5b13f commit 8db6ab7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

oauth2_provider/oauth2_validators.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,10 @@ def get_oidc_claims(self, token, token_handler, request):
789789

790790
for k, v in data.items():
791791
if not self.oidc_claim_scope or (
792-
k in self.oidc_claim_scope and self.oidc_claim_scope[k] in token.scopes
792+
token
793+
and hasattr(token, "scopes")
794+
and k in self.oidc_claim_scope
795+
and self.oidc_claim_scope[k] in token.scopes
793796
):
794797
claims[k] = v(request) if callable(v) else v
795798
return claims

0 commit comments

Comments
 (0)