# HG changeset patch # User Kim Alvefur # Date 1679432238 -3600 # Node ID d3ebaef1ea7a531f9a30ebbf3fa815883a2ead37 # Parent 381c62ef52aa6bf0ecaff138cb1234b424f64ea5 mod_http_oauth2: Correctly verify OAuth client credentials on revocation Makes no sense to validate against username and password here, or using a token to revoke another token, or itself? In fact, upon further discussion, why do you need credentials to revoke a token? If you are not supposed to have the token, revoking it seems the most responsible thing to do with it, so it should be allowed, while if you are supposed to have it, you should be allowed to revoke it. diff -r 381c62ef52aa -r d3ebaef1ea7a mod_http_oauth2/mod_http_oauth2.lua --- a/mod_http_oauth2/mod_http_oauth2.lua Tue Mar 21 21:45:02 2023 +0100 +++ b/mod_http_oauth2/mod_http_oauth2.lua Tue Mar 21 21:57:18 2023 +0100 @@ -577,8 +577,12 @@ or not request.body or request.body == "" then return 400; end - local user = check_credentials(request, true); - if not user then + local credentials = get_request_credentials(request); + if not credentials or credentials.type ~= "basic" then + return 400; + end + -- OAuth "client" credentials + if not verify_client_secret(credentials.username, credentials.password) then return 401; end