Changeset

12916:5a06d07596f9

mod_auth_internal_hashed: Add oauthbearer handler to our SASL profile
author Matthew Wild <mwild1@gmail.com>
date Wed, 01 Mar 2023 13:05:17 +0000
parents 12915:70f6a8dceb1d
children 12917:e4de42495fb7
files plugins/mod_auth_internal_hashed.lua
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_auth_internal_hashed.lua	Wed Mar 01 13:04:36 2023 +0000
+++ b/plugins/mod_auth_internal_hashed.lua	Wed Mar 01 13:05:17 2023 +0000
@@ -30,6 +30,8 @@
 -- Default; can be set per-user
 local default_iteration_count = module:get_option_number("default_iteration_count", 10000);
 
+local tokenauth = module:depends("tokenauth");
+
 -- define auth provider
 local provider = {};
 
@@ -178,7 +180,8 @@
 			stored_key = stored_key and from_hex(stored_key);
 			server_key = server_key and from_hex(server_key);
 			return stored_key, server_key, iteration_count, salt, not credentials.disabled;
-		end
+		end;
+		oauthbearer = tokenauth.sasl_handler(provider, "oauth2", module:shared("tokenauth/oauthbearer_config"));
 	};
 	return new_sasl(host, testpass_authentication_profile);
 end