diff mod_http_oauth2/mod_http_oauth2.lua @ 5398:38da5ca498dd

mod_http_oauth2: Advertise supported grant types Seems redundant, since it's just the response types with other labels.
author Kim Alvefur <zash@zash.se>
date Tue, 02 May 2023 16:07:09 +0200
parents 18b57e91b5e5
children 89c9e9bba60d
line wrap: on
line diff
--- a/mod_http_oauth2/mod_http_oauth2.lua	Tue May 02 15:41:36 2023 +0200
+++ b/mod_http_oauth2/mod_http_oauth2.lua	Tue May 02 16:07:09 2023 +0200
@@ -956,6 +956,13 @@
 				revocation_endpoint = handle_revocation_request and module:http_url() .. "/revoke" or nil;
 				revocation_endpoint_auth_methods_supported = array({ "client_secret_basic" });
 				code_challenge_methods_supported = array(it.keys(verifier_transforms));
+				grant_types_supported = array(it.keys(response_type_handlers)):map(function(h)
+					if h == "token" then
+						return "implicit"
+					elseif h == "code" then
+						return "authorization_code"
+					end
+				end);
 				authorization_response_iss_parameter_supported = true;
 
 				-- OpenID