mod_bosh: Store time to destroy session in inactive_sessions, removing dependency...
[prosody.git] / plugins / mod_auth_cyrus.lua
index ed3d5408f573895e33d3ed2ad47c7ce4d46ef60f..447fae517c19440b6af16e5599dca6d42eb2d2d7 100644 (file)
@@ -27,6 +27,18 @@ local new_sasl = function(realm)
        );
 end
 
+do -- diagnostic
+       local list;
+       for mechanism in pairs(new_sasl(module.host):mechanisms()) do
+               list = (not(list) and mechanism) or (list..", "..mechanism);
+       end
+       if not list then
+               module:log("error", "No Cyrus SASL mechanisms available");
+       else
+               module:log("debug", "Available Cyrus SASL mechanisms: %s", list);
+       end
+end
+
 function new_default_provider(host)
        local provider = { name = "cyrus" };
        log("debug", "initializing default authentication provider for host '%s'", host);
@@ -55,8 +67,7 @@ function new_default_provider(host)
        end
 
        function provider.get_sasl_handler()
-               local realm = module:get_option("sasl_realm") or module.host;
-               local handler = new_sasl(realm);
+               local handler = new_sasl(module.host);
                if require_provisioning then
                        function handler.require_provisioning(username)
                                return usermanager_user_exists(username, module.host);