comparison mod_http_oauth2/mod_http_oauth2.lua @ 5416:2393dbae51ed

mod_http_oauth2: Add option for specifying TTL of registered clients Meant to simplify configuration, since TTL vs ignoring expiration is expected to be the main thing one would want to configure. Unsure what the implications of having unlimited lifetime of clients are, given no way to revoke them currently, short of rotating the signing secret. On one hand, it would be annoying to have the client expire. On the other hand, it is trivial to re-register it.
author Kim Alvefur <zash@zash.se>
date Thu, 04 May 2023 18:41:33 +0200
parents 993f28798c75
children 3902082c42c4
comparison
equal deleted inserted replaced
5415:f8797e3284ff 5416:2393dbae51ed
75 local default_refresh_ttl = module:get_option_number("oauth2_refresh_token_ttl", nil); 75 local default_refresh_ttl = module:get_option_number("oauth2_refresh_token_ttl", nil);
76 76
77 -- Used to derive client_secret from client_id, set to enable stateless dynamic registration. 77 -- Used to derive client_secret from client_id, set to enable stateless dynamic registration.
78 local registration_key = module:get_option_string("oauth2_registration_key"); 78 local registration_key = module:get_option_string("oauth2_registration_key");
79 local registration_algo = module:get_option_string("oauth2_registration_algorithm", "HS256"); 79 local registration_algo = module:get_option_string("oauth2_registration_algorithm", "HS256");
80 local registration_options = module:get_option("oauth2_registration_options", { default_ttl = 60 * 60 * 24 * 90 }); 80 local registration_ttl = module:get_option("oauth2_registration_ttl", nil);
81 local registration_options = module:get_option("oauth2_registration_options",
82 { default_ttl = registration_ttl; accept_expired = not registration_ttl });
81 83
82 local pkce_required = module:get_option_boolean("oauth2_require_code_challenge", false); 84 local pkce_required = module:get_option_boolean("oauth2_require_code_challenge", false);
83 85
84 local verification_key; 86 local verification_key;
85 local jwt_sign, jwt_verify; 87 local jwt_sign, jwt_verify;