I want to pass username and password to LDAP and retrieve user information. I have code below but don't know where must I add password string in it?
strUsername = Request.Form("username")
strPassword = Request.Form("password")
Set rootDSE = GetObject("LDAP://RootDSE")
Set oConn = CreateObject("ADODB.Connection")
sDomainContainer = rootDSE.Get("defaultNamingContext")
Debug "DomainContainer: " & sDomainContainer
oConn.Properties("Encrypt Password") = true
oConn.Provider = "ADSDSOObject"
oConn.properties("user id") = sLdapReaderUsername
oConn.properties("password") = sLdapReaderPassword
oConn.Open "ADs Provider"
sQuery = "<LDAP://" & sDomainContainer & ">;(sAMAccountName=" & strUsername & ");adspath,mail,displayName;subtree"
Set userRS = oConn.Execute(sQuery)
If Not userRS.EOF and not err then
sFullName = userRS("displayName")
sEmail = userRS("mail")
sExternalID = ""
sOrganization = ""
Response.Write("sFullName: "&sFullName)
Response.Write("sEmail: "&sEmail)
.
..
...