# LDAP bind error

**URL:** <https://www.ruby-forum.com/t/ldap-bind-error/116631>\
**Category:** Ruby\
**Created:** [October 8, 2007, 6:37am UTC](https://www.ruby-forum.com/t/ldap-bind-error/116631 "2007-10-08T06:37:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [October 8, 2007, 6:37am UTC](https://www.ruby-forum.com/t/ldap-bind-error/116631/1 "2007-10-08T06:37:47Z")

</div>

## i am new to ruby … in java my ldap server is connecting like

username=“myname”  
password="\*\*\*\*\*\*\*\*\*"  
LDAPConnection ld = new LDAPConnection();  
ld.connect( “192.168.1.1”, 389);  
con=ld.authenticate  
(“uid=”+username+",ou=People,dc=mydomain,dc=com",password);  
/// con—\>true

## but in ruby

ldap\_con = Net::LDAP.new({:host =\> ‘192.168.1.1’, :port =\> 389,  
:auth=\>{ :method=\>:simple,:username =\>  
username,  
:password =\> password  
}  
})  
@con=ldap\_con.bind

## #@con —\>false (always )

what is wrong here  
any help please…

---

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [October 8, 2007, 9:22am UTC](https://www.ruby-forum.com/t/ldap-bind-error/116631/2 "2007-10-08T09:22:17Z")

</div>

On 10/8/07, Pokkai D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> /// con—\>true  
> @con=ldap\_con.bind
> 
> ## #@con —\>false (always )
> 
> ## what is wrong here any help please…
> 
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

Try giving the whole DN as the user name.

---

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [October 8, 2007, 10:12am UTC](https://www.ruby-forum.com/t/ldap-bind-error/116631/3 "2007-10-08T10:12:13Z")

</div>

Francis C. wrote:

> Try giving the whole DN as the user name.

sorry i did’t get you…  
can you show a sample (how to give the whole DN as the user name )

thank you

---

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [October 8, 2007, 1:38pm UTC](https://www.ruby-forum.com/t/ldap-bind-error/116631/4 "2007-10-08T13:38:53Z")

</div>

On 10/8/07, Pokkai D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Francis C. wrote:
> 
> > Try giving the whole DN as the user name.
> 
> sorry i did’t get you…  
> can you show a sample (how to give the whole DN as the user name )

It’s in your own example:

uid=username,ou=People,dc=mydomain,dc=com

---

<div class="post-metadata">

**Author:** ![mokkai](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c2a13f/32.png) [@mokkai](https://www.ruby-forum.com/u/mokkai)\
**Post date:** [October 8, 2007, 2:25pm UTC](https://www.ruby-forum.com/t/ldap-bind-error/116631/5 "2007-10-08T14:25:57Z")

</div>

Francis C. wrote:

> uid=username,ou=People,dc=mydomain,dc=com

not fine  
same error…
