Invalid Credentials error not reported correctly #2

matthauck opened this Issue Mar 20, 2012 · 0 comments

1 participant


I currently have an LDAP server I'm trying to access via jruby-ldap. The code is as follows:

conn = '', 1389
conn.bind(dn, pass)
puts "Authenticated!"
rescue LDAP::ResultError => e
puts "Sound the alarm! '#{e.message}'}"

The funny thing is that when my credentials are wrong, it reports error code -1: "Can't contact LDAP Server", even though the proper error code should be 49: Invalid Credentials. When I run the same code with MRI ruby (or with ldapsearch), it properly reports the right error messages.

It would be helpful to distinguish whether an bind failure is coming from not being able to contact the LDAP server, versus a user's password being wrong and thus a failed authentication.

@matthauck matthauck closed this Mar 20, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment