Diff

mod_http_oauth2/mod_http_oauth2.lua @ 5358:0905d348bd34

mod_http_oauth2: Include additional OpenID scopes in metadata Drops fallback because this module probably doesn't work with Prosody before the role stuff anyway.
author Kim Alvefur <zash@zash.se>
date Sat, 22 Apr 2023 14:22:56 +0200
parent 5357:eda3b078ba2c
child 5359:230fc6a0c086
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Sat Apr 22 14:02:56 2023 +0200
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Sat Apr 22 14:22:56 2023 +0200
@@ -869,8 +869,7 @@
 				token_endpoint = handle_token_grant and module:http_url() .. "/token" or nil;
 				jwks_uri = nil; -- TODO?
 				registration_endpoint = handle_register_request and module:http_url() .. "/register" or nil;
-				scopes_supported = usermanager.get_all_roles and array(it.keys(usermanager.get_all_roles(module.host))):push("openid")
-					or { "prosody:restricted"; "prosody:user"; "prosody:admin"; "prosody:operator"; "openid" };
+				scopes_supported = usermanager.get_all_roles and array(it.keys(usermanager.get_all_roles(module.host))):append(array(openid_claims:items()));
 				response_types_supported = array(it.keys(response_type_handlers));
 				authorization_response_iss_parameter_supported = true;