Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: Jos Backus
RE: Simple Search - Insufficient Access Right [ reply ]  
2008-07-16 18:49
I wonder if this is related to

http://rubyforge.org/tracker/index.php?func=detail&aid=18962&group_id=143&atid=633

By: Perry Smith
RE: Simple Search - Insufficient Access Right [ reply ]  
2007-07-27 04:06
I have a very similar problem. In my case, I get Insufficent Access Rights about 75% of the time. The other 25% it works.

I've tried dumping out what is written over the socket and read from the socket. The data written matches. The data read is the same initially but then the good returned message has a length of 86 bytes while the bad returned message is 64 bytes. Then things drift apart from that point.

But, I find it odd that the same data that is written would produce different results.

Any help would be appreciated.

By: Dennis Crall
Simple Search - Insufficient Access Rights [ reply ]  
2007-07-19 13:58
I'm trying to convert a class that uses Ruby/LDAP to use net/ldap. The Ruby/LDAP code works correctly, but I'm interested in converting the app to jruby.

With net/ldap I can bind to the directory, but a simple search returns error code 50, "Insufficient Access Rights". I'm hoping I have a simple mistake that someone with experience will spot.

Thanks in advance for your help. My code follows:

treebase = "ou=myou,o=univ of iowa,c=US"
query = Net::LDAP::Filter.eq( "sn", "Crall" )

ldap = Net::LDAP.new
ldap.host = 'ldap.uiowa.com'
ldap.port = 389
ldap.auth "cn=test,ou=test,o=test", "pwd"
if ldap.bind
# authentication succeeded
puts "Bind succeeded"
else
# authentication failed
p ldap.get_operation_result
end

auth_info = {
:method => :simple,
:username => "cn=test,ou=test,o=test",
:password => "pwd",
}

Net::LDAP.open(:host => 'ldap.uiowa.com', :port => 389,
:auth => auth_info, :base => treebase ) do |ldap|

ldap.search( :filter => query, :scope => Net::LDAP::SearchScope_SingleLevel, :base => treebase ) do |entry|
puts "DN: #{entry.dn}"
end

p ldap.get_operation_result
end