Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit 82cb13a

Browse files
committed
Fix log
1 parent cdfa5e5 commit 82cb13a

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

src/oidcop/oauth2/authorization.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,15 @@ def check_unknown_scopes_policy(request_info, client_id, endpoint_context):
250250
if not endpoint_context.conf["capabilities"].get("deny_unknown_scopes"):
251251
return
252252

253-
allowed_scopes = endpoint_context.scopes_handler.get_allowed_scopes(client_id=client_id)
254-
253+
scope = request_info["scope"]
254+
filtered_scopes = set(
255+
endpoint_context.scopes_handler.filter_scopes(scope, client_id=client_id)
256+
)
257+
scopes = set(scope)
255258
# this prevents that authz would be released for unavailable scopes
256-
if set(request_info["scope"]) != set(
257-
endpoint_context.scopes_handler.filter_scopes(request_info["scope"], client_id=client_id)
258-
):
259-
_msg = "{} requested an unauthorized scope ({})"
260-
logger.warning(_msg.format(client_id, scope))
259+
if scopes != filtered_scopes:
260+
diff = " ".join(scopes - filtered_scopes)
261+
logger.warning(f"{client_id} requested unauthorized scopes: {diff}")
261262
raise UnAuthorizedClientScope()
262263

263264

0 commit comments

Comments
 (0)