Forum: Ruby LDAP authentication

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
266f1a5c2a6e62a549bc2ae99ca4b1c2?d=identicon&s=25 Palani Kumar (palani)
on 2009-03-07 09:12

Hi
       Can anyone please help how can i implement the LDAP
authentication in Ruby on Rails .i am unaware of this .I need to
implement the login by using LDAP authentication. please anyone tell me
the complete step by step details how we can implement. what should i
do. please help me.
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (candlerb)
on 2009-03-07 14:05
Palani Kumar wrote:
>        Can anyone please help how can i implement the LDAP
> authentication in Ruby on Rails .i am unaware of this .I need to
> implement the login by using LDAP authentication. please anyone tell me
> the complete step by step details how we can implement. what should i
> do. please help me.

Suggested approach.

1. Enter "rails LDAP authentication" into Google. Read the results.

2. If that doesn't help, ask the question on a Rails mailing list.
Be07c8d0d6867fd9a0d525f7d17600e2?d=identicon&s=25 Damjan Rems (ther)
on 2009-03-07 14:53
Palani Kumar wrote:
>
>
> Hi
>        Can anyone please help how can i implement the LDAP
> authentication in Ruby on Rails .i am unaware of this .I need to
> implement the login by using LDAP authentication. please anyone tell me
> the complete step by step details how we can implement. what should i
> do. please help me.

The same question was questioned by me few months ago on this forums and
you can search here for more informations.


This is my solution:

gem install ruby-net-ldap

add  require 'net/ldap' => environment.rb

      ldap = Net::LDAP.new
      ldap.host = 'mydc.mydomain.com'
      ldap.port = 389
      ldap.auth "#{params[:usr]}@mydomain.com", params[:pass]
      unless ldap.bind
        flash[:error] = "Password or user incorect!"
        return false
      end

Works with Windows 2003 DC.


by
TheR
This topic is locked and can not be replied to.