ldap integration in ruby
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 com开发者_开发知识库pany
. 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..
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.
精彩评论