comparison mod_http_oauth2/mod_http_oauth2.lua @ 5196:6b63af56c8ac

mod_http_oauth2: Remove error message For a while I considered making this a required option but changed my mind and forgot to edit this.
author Kim Alvefur <zash@zash.se>
date Fri, 03 Mar 2023 22:03:50 +0100
parents b4932915e773
children 2e8a7a0f932d
comparison
equal deleted inserted replaced
5195:b4932915e773 5196:6b63af56c8ac
18 local registration_key = module:get_option_string("oauth2_registration_key"); 18 local registration_key = module:get_option_string("oauth2_registration_key");
19 local registration_algo = module:get_option_string("oauth2_registration_algorithm", "HS256"); 19 local registration_algo = module:get_option_string("oauth2_registration_algorithm", "HS256");
20 local registration_options = module:get_option("oauth2_registration_options", { default_ttl = 60 * 60 * 24 * 90 }); 20 local registration_options = module:get_option("oauth2_registration_options", { default_ttl = 60 * 60 * 24 * 90 });
21 21
22 local jwt_sign, jwt_verify; 22 local jwt_sign, jwt_verify;
23 if not registration_key then 23 if registration_key then
24 module:log("error", "Missing required 'oauth2_registration_key', generate a strong key and configure it")
25 else
26 -- Tie it to the host if global 24 -- Tie it to the host if global
27 registration_key = hashes.hmac_sha256(registration_key, module.host); 25 registration_key = hashes.hmac_sha256(registration_key, module.host);
28 jwt_sign, jwt_verify = jwt.init(registration_algo, registration_key, registration_key, registration_options); 26 jwt_sign, jwt_verify = jwt.init(registration_algo, registration_key, registration_key, registration_options);
29 end 27 end
30 28