private static void initProvider(final Class<? extends AuthProvider> clazz) {

        // Check if we need to reset the auth provider class
        if (authProvider == null || !clazz.equals(authProvider.getClass())) {
            try {
                authProvider = clazz.newInstance();
            }
            catch (Exception e) {
                Log.error("Error loading auth provider: " + clazz.getName(), e);
                authProvider = new DefaultAuthProvider();
            }
        }
    }
Pluggable authentication service. Users of Openfire that wish to change the AuthProvider
implementation used to authenticate users can set the <code>AuthProvider.className</code>
system property. For example, if you have configured Openfire to use LDAP for user information,
you'd want to send a custom implementation of AuthFactory to make LDAP auth queries.
After changing the <code>AuthProvider.className</code> system property, you must restart your
application server.

@author Matt Tucker
xmppserver/src/main/java/org/jivesoftware/openfire/auth/AuthFactory.java