I have been strugling with this one for few weeks now. I hope to get
some help here.
Following code works fine, except that I have to hard-code the user's
fullpath (2nd parameter of the OpenDSObject() method).
Here is the code:
--------------------------
sub login5(uid, password)
Dim userName, ldapserver, dso, lobjUser, ldap_path
ldap_path = "LDAP://servername/dc=domain,dc=co m"
userName =
"uid=#userid#,o u=int7,ou=inter nal,ou=people,c =us,cn=users,dc =campbells,dc=c om"
userName = Replace(userNam e, "#userid#", uid)
' Connect to the LDAP Directory
Set dso = GetObject("LDAP :")
'Validate the User Name and Password
Set lobjUser = dso.OpenDSObjec t(ldap_path, userName, password, 0)
If Err.number <> 0 Then
Response.Write "AUTHENTICA TION FAILURE!"
Set lobjUser = nothing
Set dso = nothing
Else
Response.Write "SUCCESS!"
end if
end sub
-------------------------
For this this work, I need to know exact path of the user (i.e.
userName =
"uid=#userid#,o u=int7,ou=inter nal,ou=people,c =us,cn=users,dc =campbells,dc=c om")
Is there anyway to do something like:
userName = "uid=#userid#,o u=*,ou=*,ou=*,c =*,cn=*,dc=camp bells,dc=com"
Thanks