From: bluengreen Date: 2007-02-24T00:30:55+09:00 Subject: Re: NET::LDAP Problems..... Just in case anybody else is struggling with these issues here is what I did for work arounds, but after comparing with ldapsearch and various RFC's I'm not sure they are work arounds for NET::LDAP as much as just the way the spec is defined.... For the password issue I wrapped the bind with a condition that the password length be greater than 1. unless password.to_s.size < 1 result = ldap.bind_as( :base => "dc=net,dc=com", :filter => "(cn=#{username})", :password => "#{password}" ) end For the DN search issue, it seems this is appropriate behavior, as verified by ldapsearch at the commandline. The appropriate read method is to set the tree base to your DN that you want and set scope to base. So do this if you want to return a specific DN using NET::LDAP # set your dn treebase = "cn=pnovess,dc=net,dc=com" # query ldap - set scope to base ldap.search( :base => treebase, :scope => Net::LDAP::SearchScope_BaseObject ) do |entry| .... do stuff here ... end Hope this helps saves someone the several hours of research I spent. Thanks, Phill On Feb 22, 9:25 pm, "bluengreen" wrote: > Just wondering if anyone knows anything about this project? > > A couple of things that I recently discovered.... > > 1 - the bind and bind_as methods will return results if you provide a > empty password.... > 2 - The search does not work when searching against DN's. > > Maybe I'm missing how to do this or something. Anyone who may know > how to correct these problems please share the wealth. > > Is this project still alive or should I try the alternative? I think > this library is the most functional I have seen but still some bumps. > > Thanks, > Phill