mod_http_oauth2: Support granting zero role-scopes
authorKim Alvefur <zash@zash.se>
Sun, 07 May 2023 19:29:15 +0200
changeset 5429 3b30635d215c
parent 5428 b45d9a81b3da
child 5430 f75d95f27da7
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.
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)