local host = module.host;
-- define auth provider
-local provider = { name = "internal_plain" };
+local provider = {};
log("debug", "initializing internal_plain authentication provider for host '%s'", host);
function provider.test_password(username, password)
return true;
end
+function provider.users()
+ return datamanager.users(host, "accounts");
+end
+
function provider.create_user(username, password)
return datamanager.store(username, host, "accounts", {password = password});
end
return new_sasl(host, getpass_authentication_profile);
end
-module:add_item("auth-provider", provider);
+module:provides("auth", provider);