I’m using the ruby-net-ldap to connect in the Active Directory. I’m able
to connect but for some strange reason when i try to do any search
nothing is returned.
Follow the code:
username = 'user'
password = 'password'
ldap = Net::LDAP.new(:host => 'host', :port => 389, :base =>
‘dc=domainname,dc=domain’)
ldap.auth(username, password)
if ldap.bind
puts "# authentication succeeded"
filter = Net::LDAP::Filter.eq('name', "steven*")
ldap.search(:base => "dc=domainname,dc=domain", :filter => filter)
{|entry|
puts “found”
}
else
puts "# authentication failed"
end
The console show “# authentication succeeded” but “found” never is
printed
Someone already had some problem like this?