File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -74,10 +74,13 @@ def validate_scope(self, requested_scope: str | None) -> list[str] | None:
7474 if self .scope is None :
7575 # Client registered without scope restrictions — allow any requested scope
7676 return requested_scopes
77- allowed_scopes = self .scope .split (" " )
78- for scope in requested_scopes :
79- if scope not in allowed_scopes :
80- raise InvalidScopeError (f"Client was not registered with scope { scope } " )
77+ requested = set (requested_scopes )
78+ allowed = set (self .scope .split ())
79+ if not requested .issubset (allowed ):
80+ invalid = requested - allowed
81+ raise InvalidScopeError (
82+ f"Client was not registered with scope(s): { ' ' .join (sorted (invalid ))} "
83+ )
8184 return requested_scopes
8285
8386 def validate_redirect_uri (self , redirect_uri : AnyUrl | None ) -> AnyUrl :
You can’t perform that action at this time.
0 commit comments