# HG changeset patch # User Kim Alvefur # Date 1683480555 -7200 # Node ID 3b30635d215cdab3df6b604b296fa0562824cf4f # Parent b45d9a81b3da91396eec2c25a5cf1171e519b095 mod_http_oauth2: Support granting zero role-scopes It seems Very Bad that if you uncheck all roles on the consent page, you get the default scopes, which seems the opposite of what you probably intended. Currently, mod_tokenauth will do the same thing, so work is needed there too to allow issuing tokens without roles. A token without a role could be used for OIDC login, and not much else. This seems like a valuable thing to support. diff -r b45d9a81b3da -r 3b30635d215c mod_http_oauth2/mod_http_oauth2.lua --- a/mod_http_oauth2/mod_http_oauth2.lua Sun May 07 19:40:57 2023 +0200 +++ b/mod_http_oauth2/mod_http_oauth2.lua Sun May 07 19:29:15 2023 +0200 @@ -124,8 +124,7 @@ end end end - -- otherwise the default role - return usermanager.get_user_role(username, module.host).name; + -- otherwise no role end local function filter_scopes(username, requested_scope_string)