diff mod_auth_oauth_external/mod_auth_oauth_external.lua @ 5346:d9bc8712a745

mod_auth_oauth_external: Allow setting identity instead of discovery URL Shorter and the .well-known part is, well, well-known.
author Kim Alvefur <zash@zash.se>
date Thu, 16 Mar 2023 13:04:13 +0100
parents 3390bb2f9f6c
children b40299bbdf14
line wrap: on
line diff
--- a/mod_auth_oauth_external/mod_auth_oauth_external.lua	Thu Mar 16 12:45:52 2023 +0100
+++ b/mod_auth_oauth_external/mod_auth_oauth_external.lua	Thu Mar 16 13:04:13 2023 +0100
@@ -3,8 +3,9 @@
 local json = require "util.json";
 local sasl = require "util.sasl";
 
--- TODO -- local issuer_identity = module:get_option_string("oauth_external_issuer");
-local oidc_discovery_url = module:get_option_string("oauth_external_discovery_url")
+local issuer_identity = module:get_option_string("oauth_external_issuer");
+local oidc_discovery_url = module:get_option_string("oauth_external_discovery_url",
+	issuer_identity and issuer_identity .. "/.well-known/oauth-authorization-server" or nil);
 local validation_endpoint = module:get_option_string("oauth_external_validation_endpoint");
 local token_endpoint = module:get_option_string("oauth_external_token_endpoint");