Hi All,
What is Active Directory authentication?. How to use in Ruby on rails?.
Regards,
Periyasamy.R
Hi All,
What is Active Directory authentication?. How to use in Ruby on rails?.
Regards,
Periyasamy.R
On Mon, May 24, 2010 at 6:27 AM, Periyasamy R.
[email protected] wrote:
What is Active Directory authentication?. How to use in Ruby on rails?.
Using Apache SSPI:
Using LDAP:
http://www.ruby-forum.com/topic/55450#37973
A slightly different version using LDAP:
require ‘net/ldap’
class User
def self.authenticate(username, password)
return false if username.to_s.size == 0
return false if password.to_s.size == 0
begin
ldap = Net::LDAP.new(
:host => AD_DOMAIN_CONTROLLER,
:port => 389,
:auth => {
:method => :simple,
:username => "#{username}", # <- AD UPN
:password => "#{password}"
}
)
rescue
return false
end
ldap.bind ? User.find_by_login("#{username}") : nil
end
end
unknown wrote:
On Mon, May 24, 2010 at 6:27 AM, Periyasamy R.
[email protected] wrote:What is Active Directory authentication?. How to use in Ruby on rails?.
Using Apache SSPI:
Zorched / One-Line Fix | Active Directory Authentication for Ruby on RailsUsing LDAP:
Rails and Windows Active Directory Authentication? - Rails - Ruby-ForumA slightly different version using LDAP:
require ‘net/ldap’
class User
def self.authenticate(username, password)
return false if username.to_s.size == 0
return false if password.to_s.size == 0begin ldap = Net::LDAP.new( :host => AD_DOMAIN_CONTROLLER, :port => 389, :auth => { :method => :simple, :username => "#{username}", # <- AD UPN :password => "#{password}" } ) rescue return false end ldap.bind ? User.find_by_login("#{username}") : nil
end
end
Hi,
Great!. It worked for me.
Thanks,
Periyasamy.R
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs