tags:

views:

13

answers:

1

I'm working on integrating ruby with ldap. And it's working fine.

Created test.com in ldap and I can bind with it successfully.

Then I created a new organizational unit company. Under company there are some users

Now I want to bind with the users(authentication) under company organizational unit.

I can access the user using Filter.eq

But I want to bind with the users. Suggestions plz..

A: 

Assuming you are using "activeldap" gem you could do this (in your Model):

ldap_mapping :dn_attribute => 'cn', :prefix => 'ou=company', :classes => ['inetOrgPerson']

So now you can instantiate users by "cn" and then authenticate by whatever password field you have defined.

Zepplock