Commit ad062ba7 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Added logging when LDAP server is not available. JM-772

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@4353 b35dd754-fafc-0310-a699-88a17e54d16e
parent 0464075f
......@@ -16,6 +16,8 @@ import org.jivesoftware.wildfire.auth.AuthProvider;
import org.jivesoftware.wildfire.auth.UnauthorizedException;
import org.jivesoftware.wildfire.user.UserNotFoundException;
import javax.naming.CommunicationException;
/**
* Implementation of auth provider interface for LDAP authentication service plug-in.
* Only plaintext authentication is currently supported.<p>
......@@ -73,7 +75,7 @@ public class LdapAuthProvider implements AuthProvider {
}
}
String userDN = null;
String userDN;
try {
// The username by itself won't help us much with LDAP since we
// need a fully qualified dn. We could make the assumption that
......@@ -92,6 +94,12 @@ public class LdapAuthProvider implements AuthProvider {
throw new UnauthorizedException("Username and password don't match");
}
}
catch (CommunicationException e) {
// Log error here since it will be wrapped with an UnauthorizedException that
// is never logged
Log.error("Error connecting to LDAP server", e);
throw new UnauthorizedException(e);
}
catch (Exception e) {
throw new UnauthorizedException(e);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment