betoesquivel icon

datos que necesito para conectarme a ActiveDirectory

betoesquivel | PRO | 06/16/15 03:39:33 PM UTC | 0 ⭐ | 487 👁️ | Never ⏰ | []
Ruby |

740 B

|

None

|

0 👍

/

0 👎

      SERVER = 'ad01.company.com'   # Active Directory server name or IP
      PORT = 389                    # Active Directory server port (default 389)
      BASE = 'DC=company,DC=com'    # Base to search from
      DOMAIN = 'company.com'        # For simplified user@domain format login
      ### END CONFIGURATION ###
 
      def self.authenticate(login, pass)
        return false if login.empty? or pass.empty?
 
        conn = Net::LDAP.new :host => SERVER,
                             :port => PORT,
                             :base => BASE,
                             :auth => { :username => "#{login}@#{DOMAIN}",
                                        :password => pass,
                                        :method => :simple }

Comments