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

Log an error when Wildfire cannot connect to the LDAP server. JM-722

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/branches/3_0_branch@4401 b35dd754-fafc-0310-a699-88a17e54d16e
parent 6418d82c
...@@ -16,6 +16,8 @@ import org.jivesoftware.wildfire.auth.AuthProvider; ...@@ -16,6 +16,8 @@ import org.jivesoftware.wildfire.auth.AuthProvider;
import org.jivesoftware.wildfire.auth.UnauthorizedException; import org.jivesoftware.wildfire.auth.UnauthorizedException;
import org.jivesoftware.wildfire.user.UserNotFoundException; import org.jivesoftware.wildfire.user.UserNotFoundException;
import javax.naming.CommunicationException;
/** /**
* Implementation of auth provider interface for LDAP authentication service plug-in. * Implementation of auth provider interface for LDAP authentication service plug-in.
* Only plaintext authentication is currently supported.<p> * Only plaintext authentication is currently supported.<p>
...@@ -73,7 +75,7 @@ public class LdapAuthProvider implements AuthProvider { ...@@ -73,7 +75,7 @@ public class LdapAuthProvider implements AuthProvider {
} }
} }
String userDN = null; String userDN;
try { try {
// The username by itself won't help us much with LDAP since we // The username by itself won't help us much with LDAP since we
// need a fully qualified dn. We could make the assumption that // need a fully qualified dn. We could make the assumption that
...@@ -92,6 +94,12 @@ public class LdapAuthProvider implements AuthProvider { ...@@ -92,6 +94,12 @@ public class LdapAuthProvider implements AuthProvider {
throw new UnauthorizedException("Username and password don't match"); 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) { catch (Exception e) {
throw new UnauthorizedException(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