has anyone had anyexperience with either activeldap or ldap? i am trying to just authenticate an internal user for my particular web app. in php i used to just attempt a bind to test for the authentication. when i attemp this with ruby ldap it just seems to hang. this being the case i have not tried using activeldap to get any information out of the ldap directory. i was trying something like this: conn = LDAP::SSLConn.new(''ldap.server'', 636 ) conn.bind( ''user'', ''password'' ) any experience would be appreciated -felix
That looks OK - I normally pass conn.bind a black On 07/10/05, Felix McCoey <felix.mccoey-8PZlF8N9LqR+XZJcv9eMoEEOCMrvLtNR@public.gmane.org> wrote:> has anyone had anyexperience with either activeldap or ldap? > > i am trying to just authenticate an internal user for my particular web > app. in php i used to just attempt a bind to test for the > authentication. when i attemp this with ruby ldap it just seems to hang. > this being the case i have not tried using activeldap to get any > information out of the ldap directory. > > i was trying something like this: > > conn = LDAP::SSLConn.new(''ldap.server'', 636 ) > conn.bind( ''user'', ''password'' )That looks OK - I normally pass conn.bind a block # get all email addresses of the user mentioned conn.bind { querystring = "(&(objectClass=inetOrgPerson)(uid=$0))" basedn = "o=whatever'' conn.search(basedn, LDAP::LDAP_SCOPE_SUBTREE, querystring) { |e| e.vals(''mail'').each do |m| puts "#{m}\t#{e.vals(''givenName'')}\t" end } } but that in itself shouldn''t break stuff. Is ''user'' a DN? You don''t normaly bind with just a username. Normally you do an anonymous lookup for the http user to get a DN, then bind with that and the password. -- Rasputin :: Jack of All Trades - Master of Nuns
Dick Davies wrote:> That looks OK - I normally pass conn.bind a black > > On 07/10/05, Felix McCoey <felix.mccoey-8PZlF8N9LqR+XZJcv9eMoEEOCMrvLtNR@public.gmane.org> wrote: > >>has anyone had anyexperience with either activeldap or ldap? >> >>i am trying to just authenticate an internal user for my particular web >>app. in php i used to just attempt a bind to test for the >>authentication. when i attemp this with ruby ldap it just seems to hang. >>this being the case i have not tried using activeldap to get any >>information out of the ldap directory. >> >>i was trying something like this: >> >>conn = LDAP::SSLConn.new(''ldap.server'', 636 ) >>conn.bind( ''user'', ''password'' ) > > > That looks OK - I normally pass conn.bind a block > > # get all email addresses of the user mentioned > conn.bind { > querystring = "(&(objectClass=inetOrgPerson)(uid=$0))" > basedn = "o=whatever'' > > conn.search(basedn, LDAP::LDAP_SCOPE_SUBTREE, querystring) { |e| > e.vals(''mail'').each do |m| > puts "#{m}\t#{e.vals(''givenName'')}\t" > end > } > > } > > > but that in itself shouldn''t break stuff. > > Is ''user'' a DN? > You don''t normaly bind with just a username. Normally you do an > anonymous lookup for > the http user to get a DN, then bind with that and the password.thanks, i was actually passing the wrong dn to bind with, ALSO i was specifying the wrong port even though i entered it correctly in this post! der! Sometimes a little break can make you see things that you hadn''t seen before. thanks again
As for activeldap, I had to stop using it because of an error the maintainer has been looking at for a while. If anybody else has seen the error or worked around it, please let me know. Maybe we can work to solve it. Thanks, Sean On 10/7/05, Felix McCoey <felix.mccoey-8PZlF8N9LqR+XZJcv9eMoEEOCMrvLtNR@public.gmane.org> wrote:> Dick Davies wrote: > > That looks OK - I normally pass conn.bind a black > > > > On 07/10/05, Felix McCoey <felix.mccoey-8PZlF8N9LqR+XZJcv9eMoEEOCMrvLtNR@public.gmane.org> wrote: > > > >>has anyone had anyexperience with either activeldap or ldap? > >> > >>i am trying to just authenticate an internal user for my particular web > >>app. in php i used to just attempt a bind to test for the > >>authentication. when i attemp this with ruby ldap it just seems to hang. > >>this being the case i have not tried using activeldap to get any > >>information out of the ldap directory. > >> > >>i was trying something like this: > >> > >>conn = LDAP::SSLConn.new(''ldap.server'', 636 ) > >>conn.bind( ''user'', ''password'' ) > > > > > > That looks OK - I normally pass conn.bind a block > > > > # get all email addresses of the user mentioned > > conn.bind { > > querystring = "(&(objectClass=inetOrgPerson)(uid=$0))" > > basedn = "o=whatever'' > > > > conn.search(basedn, LDAP::LDAP_SCOPE_SUBTREE, querystring) { |e| > > e.vals(''mail'').each do |m| > > puts "#{m}\t#{e.vals(''givenName'')}\t" > > end > > } > > > > } > > > > > > but that in itself shouldn''t break stuff. > > > > Is ''user'' a DN? > > You don''t normaly bind with just a username. Normally you do an > > anonymous lookup for > > the http user to get a DN, then bind with that and the password. > > thanks, i was actually passing the wrong dn to bind with, ALSO i was > specifying the wrong port even though i entered it correctly in this > post! der! Sometimes a little break can make you see things that you > hadn''t seen before. > > thanks again > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >