LDAP authentication

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.

Palani K. 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.

Palani K. 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