// Specify connection timeout, value of zero or less means use networks timeout value
env.put(COM_SUN_JNDI_LDAP_CONNECT_TIMEOUT, connectionTimeOut);
// Set our authentication settings.
AuthType authType = settings.getAuthType();
if (authType == AuthType.SIMPLE) {
env.put(Context.SECURITY_AUTHENTICATION, authType.toString()
.toLowerCase());
env.put(Context.SECURITY_PRINCIPAL, settings.getUsername());
env.put(Context.SECURITY_CREDENTIALS, settings.getPassword());
LOG.info("Using simple authentication.");
} else {