From: Damjan Rems Date: 2008-10-24T19:29:56+09:00 Subject: LDAP authentication in Windows 2003 AD I am trying to authenticate user against Windows 2003 AD. This is what I have found so far, but what ever I do I get error: # This is my source code, which I picked sowhere on net: ------------------------------------- require "ldap" # Provides access to authenticate user from LDAP using the user provided # user name and password class MyLDAP < LDAP::Conn BASE_DN = "dc=mydomain,dc=com" PEOPLE_DN = "ou=users,dc=mydomain,dc=com" LDAP_HOST = "mydc" LDAP_PORT = 389 PROTOCOL_VERSION = 3 # sets up connection to LDAP server def initialize (host = LDAP_HOST, version = PROTOCOL_VERSION) super( host, LDAP_PORT ) set_option( LDAP::LDAP_OPT_PROTOCOL_VERSION, version ) return self end # Bind with the user supplied information def bind(mydn, pass) dn = "uid=" + mydn + "," + PEOPLE_DN super( dn, pass ) end end #** user.rb ** # Takes user login name and password and connects to LDAP def login(login, password) if password == '' return false end begin conn = MyLDAP.new.bind(login, password) rescue => e puts e.inspect return false end return conn.bound? conn.unbind end puts login('myusr','mypwd') --------------------------------- Is there anything that needs to bo be set on Windows server? Help please. by TheR -- Posted via http://www.ruby-forum.com/.