# Ruby-net-ldap

**URL:** <https://www.ruby-forum.com/t/ruby-net-ldap/118270>\
**Category:** Rails\
**Created:** [October 25, 2007, 9:19am UTC](https://www.ruby-forum.com/t/ruby-net-ldap/118270 "2007-10-25T09:19:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![crazybass](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/eb9ed0/32.png) [@crazybass](https://www.ruby-forum.com/u/crazybass)\
**Post date:** [October 25, 2007, 9:19am UTC](https://www.ruby-forum.com/t/ruby-net-ldap/118270/1 "2007-10-25T09:19:52Z")

</div>

Hello

I have the following code to test authentication using ldap (i use  
ruby-net-ldap extension) :

require ‘rubygems’  
require ‘net/ldap’

def test  
user = ‘bla’  
pass = ‘bla’  
ldap = Net::LDAP.new :host =\> “10.20.0.128”, :port =\> 389, :auth =\>  
{:method =\> :simple, :username =\> user, :password =\> pass}  
p (ldap.bind) ? “Authorization Succeeded!” : “Authorization Failed:  
#{ldap.get\_operation\_result.message}”  
end

10.20.0.128 is my IP.

However I always get this error (which is originated by the ldap.bind  
instruction) : “no connection to server”

Can anyone help me?

Thanks

regards
