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

Commit f061a88

Browse files
committed
Verify correct user
1 parent 5879a9a commit f061a88

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/oidcop/oauth2/token.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,11 @@ def process_request(self, req: Union[Message, dict], **kwargs):
119119
return self.error_cls(error="invalid_request", error_description="Missing code")
120120

121121
_session_info = _mngr.get_session_info_by_token(_access_code, grant=True)
122+
if _session_info["client_id"] != req["client_id"]:
123+
logger.debug("{} owner of token".format(_session_info["client_id"]))
124+
logger.warning("Client using token it was not given")
125+
return self.error_cls(error="invalid_grant", error_description="Wrong client")
126+
122127
grant = _session_info["grant"]
123128

124129
_based_on = grant.get_token(_access_code)

0 commit comments

Comments
 (0)