Hey all, Has anyone attempted to do any kind of external authentication with Rails? My work uses AD and NIS to manage logins to all of our machines (windows and *nix, respectively) and I''d really prefer to not give people a new password to use the system I''m developing. Is there an NIS or LDAP authentication generator/snippet/whatever out there? I''ve written the same thing in PHP, but I''m lazier now and don''t want to rewrite it in Ruby unless I have to. If nothing exists, I''ll get to work on it and release it when I''m done. Thanks! Ben
On Jun 9, 2005, at 10:52 AM, Ben Bleything wrote:> Hey all, > > Has anyone attempted to do any kind of external authentication with > Rails? My work uses AD and NIS to manage logins to all of our > machines > (windows and *nix, respectively) and I''d really prefer to not give > people a new password to use the system I''m developing. >I believe there is an ActiveLDAP module. I''m not sure if it is RubyForge or not, so you may just want to do a google search. I haven''t actually used it though.> Is there an NIS or LDAP authentication generator/snippet/whatever out > there? I''ve written the same thing in PHP, but I''m lazier now and > don''t > want to rewrite it in Ruby unless I have to. If nothing exists, I''ll > get to work on it and release it when I''m done. > > Thanks! > Ben > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >Joseph Hosteny jhosteny-ee4meeAH724@public.gmane.org H: 412.362.8672 C: 412.418.6023
Yes, We use our AD directory to authenticate our intranet applications via LDAP. It works like a champ and only took a few minutes to implement; require ''ldap'' require ''ldap/control'' def User.authenticate(server, port, username, password) conn = LDAP::Conn.new(server, port) begin conn.bind(username, password) rescue end return conn.bound? end I also use the AD LDAP directory to populate some local databases that I need to have populated from AD. On 6/9/05, Ben Bleything <ben-TGHtUsa5cOzMFIMGWPqnnw@public.gmane.org> wrote:> Hey all, > > Has anyone attempted to do any kind of external authentication with > Rails? My work uses AD and NIS to manage logins to all of our machines > (windows and *nix, respectively) and I''d really prefer to not give > people a new password to use the system I''m developing. > > Is there an NIS or LDAP authentication generator/snippet/whatever out > there? I''ve written the same thing in PHP, but I''m lazier now and don''t > want to rewrite it in Ruby unless I have to. If nothing exists, I''ll > get to work on it and release it when I''m done. > > Thanks! > Ben > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
On Thu, Jun 09, 2005, Ira Burton wrote:> Yes, > > We use our AD directory to authenticate our intranet applications via > LDAP. It works like a champ and only took a few minutes to implement; > > require ''ldap'' > require ''ldap/control'' > > def User.authenticate(server, port, username, password) > conn = LDAP::Conn.new(server, port) > begin > conn.bind(username, password) > rescue > end > return conn.bound? > end > > I also use the AD LDAP directory to populate some local databases that > I need to have populated from AD.Wow, that''s awesome. So LDAP is taken care of! Now to do the NIS bit... Thanks for sharing that! Ben