Software /
code /
prosody-modules
Comparison
mod_http_oauth2/mod_http_oauth2.lua @ 5425:3b30635d215c
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.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 07 May 2023 19:29:15 +0200 |
parent | 5424:b45d9a81b3da |
child | 5426:f75d95f27da7 |
comparison
equal
deleted
inserted
replaced
5424:b45d9a81b3da | 5425:3b30635d215c |
---|---|
122 if can_assume_role(username, requested_role) then | 122 if can_assume_role(username, requested_role) then |
123 return requested_role; | 123 return requested_role; |
124 end | 124 end |
125 end | 125 end |
126 end | 126 end |
127 -- otherwise the default role | 127 -- otherwise no role |
128 return usermanager.get_user_role(username, module.host).name; | |
129 end | 128 end |
130 | 129 |
131 local function filter_scopes(username, requested_scope_string) | 130 local function filter_scopes(username, requested_scope_string) |
132 local granted_scopes, requested_roles; | 131 local granted_scopes, requested_roles; |
133 | 132 |