lepture / authlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
https://authlib.org/
BSD 3-Clause "New" or "Revised" License
4.39k stars 436 forks source link

rfc7009: return error if client validation fails #646

Closed amCap1712 closed 1 month ago

amCap1712 commented 2 months ago

Section 2 of RFC 7009 says:

"The authorization server first validates the client credentials (in case of a confidential client) and then verifies whether the token was issued to the client making the revocation request. If this validation fails, the request is refused and the client is informed of the error by the authorization server as described below."

Accordingly, update the code to return an invalid_grant error if the token being revoked does not belong to client credentials supplied.

What kind of change does this PR introduce? (check at least one)