Comparison

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
parent 5345:3390bb2f9f6c
child 5433:b40299bbdf14
comparison
equal deleted inserted replaced
5345:3390bb2f9f6c 5346:d9bc8712a745
1 local http = require "net.http"; 1 local http = require "net.http";
2 local async = require "util.async"; 2 local async = require "util.async";
3 local json = require "util.json"; 3 local json = require "util.json";
4 local sasl = require "util.sasl"; 4 local sasl = require "util.sasl";
5 5
6 -- TODO -- local issuer_identity = module:get_option_string("oauth_external_issuer"); 6 local issuer_identity = module:get_option_string("oauth_external_issuer");
7 local oidc_discovery_url = module:get_option_string("oauth_external_discovery_url") 7 local oidc_discovery_url = module:get_option_string("oauth_external_discovery_url",
8 issuer_identity and issuer_identity .. "/.well-known/oauth-authorization-server" or nil);
8 local validation_endpoint = module:get_option_string("oauth_external_validation_endpoint"); 9 local validation_endpoint = module:get_option_string("oauth_external_validation_endpoint");
9 local token_endpoint = module:get_option_string("oauth_external_token_endpoint"); 10 local token_endpoint = module:get_option_string("oauth_external_token_endpoint");
10 11
11 local username_field = module:get_option_string("oauth_external_username_field", "preferred_username"); 12 local username_field = module:get_option_string("oauth_external_username_field", "preferred_username");
12 local allow_plain = module:get_option_boolean("oauth_external_resource_owner_password", true); 13 local allow_plain = module:get_option_boolean("oauth_external_resource_owner_password", true);