betoesquivel

datos que necesito para conectarme a ActiveDirectory

Jun 16th, 2015
517
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.74 KB | None | 0 0
  1.       SERVER = 'ad01.company.com'   # Active Directory server name or IP
  2.       PORT = 389                    # Active Directory server port (default 389)
  3.       BASE = 'DC=company,DC=com'    # Base to search from
  4.       DOMAIN = 'company.com'        # For simplified user@domain format login
  5.       ### END CONFIGURATION ###
  6.  
  7.       def self.authenticate(login, pass)
  8.         return false if login.empty? or pass.empty?
  9.  
  10.         conn = Net::LDAP.new :host => SERVER,
  11.                              :port => PORT,
  12.                              :base => BASE,
  13.                              :auth => { :username => "#{login}@#{DOMAIN}",
  14.                                         :password => pass,
  15.                                         :method => :simple }
Advertisement
Add Comment
Please, Sign In to add comment