Hi Since there are so many ldap packages there any idea which is the best one currently ? I just need to do simple thing. I need to find out common name (cn) by using ldapsearch for the ENV variable REMOTE_USER ie. user''s login name. Any ideas and possible way to do this ? Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
and I dont need to authenticate just anonymous search will do On Feb 7, 12:36 pm, KTU <ketuo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi > > Since there are so many ldap packages there any idea which is the best > one currently ? > > I just need to do simple thing. I need to find out common name (cn) by > using ldapsearch > for the ENV variable REMOTE_USER ie. user''s login name. > > Any ideas and possible way to do this ? > > Thanks--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ok i found simple answer by using ruby net-ldap module
http://rubyforge.org/projects/net-ldap/
require ''rubygems''
require ''net/ldap''
ldap = Net::LDAP.new :host => ''your-host-name-here'',
:port => 389,
:auth => {
:method => :anonymous
}
login = request.env[''REMOTE_USER'']
filter = Net::LDAP::Filter.eq( "uid", login )
treebase = "ou=company,ou=people,o=us"
ldap.search( :base => treebase, :filter => filter ) do |entry|
@fullname = entry[:cn]
On Feb 7, 12:44 pm, KTU <ketuo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> and I dont need to authenticate just anonymous search will do
>
> On Feb 7, 12:36 pm, KTU
<ketuo...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Hi
>
> > Since there are so many ldap packages there any idea which is the best
> > one currently ?
>
> > I just need to do simple thing. I need to find out common name (cn) by
> > using ldapsearch
> > for the ENV variable REMOTE_USER ie. user''s login name.
>
> > Any ideas and possible way to do this ?
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---