diff mod_http_oauth2/mod_http_oauth2.lua @ 5203:c60cff787d6a

mod_http_oauth2: Return actually enabled response types in discovery
author Kim Alvefur <zash@zash.se>
date Sat, 04 Mar 2023 21:24:35 +0100
parents b81fd0d22c66
children eb8b3a068ecc
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Sat Mar 04 17:06:47 2023 +0100
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Sat Mar 04 21:24:35 2023 +0100
@@ -11,6 +11,8 @@
 local base64 = encodings.base64;
 local schema = require "util.jsonschema";
 local jwt = require"util.jwt";
+local it = require "util.iterators";
+local array = require "util.array";
 
 local tokens = module:depends("tokenauth");
 
@@ -477,7 +479,7 @@
 				jwks_uri = nil; -- TODO?
 				registration_endpoint = handle_register_request and module:http_url() .. "/register" or nil;
 				scopes_supported = { "prosody:restricted"; "prosody:user"; "prosody:admin"; "prosody:operator" };
-				response_types_supported = { "code"; "token" }; -- TODO derive from active config
+				response_types_supported = array(it.keys(response_type_handlers));
 				authorization_response_iss_parameter_supported = true;
 			};
 		};