Last post Nov 23, 2007 04:34 AM by jovenatheart
Nov 10, 2007 04:34 AM|Ahmed J|LINK
I am able to connect LDAP server and managed to read username. However, I could not read user "password" from LDAP validate against password which user entered in the loginForm in the application. What I really try to do, I have "Login Form" in my application
where user enter "username" & "password". I need to validate this login against LDAP. How to do that ?
Below is the script I tried to retrieve username from LDAP which is working fine. But, could not retrieve the password. Pls help:
objConnection.Provider = "ADsDSOObject"
objConnection.Open("Active Directory Provider")
objCommand.ActiveConnection = objConnection
objCommand.CommandText = _
"Select userpassword,uid,Name, Location from 'LDAP://OU=myOU,DC=myDC,DC=myDC,DC=com' Where objectClass='user' and name = 'abc'"
objCommand.Properties("Searchscope") = ADS_SCOPE_SUBTREE
objRecordSet = objCommand.Execute
n = objRecordSet.RecordCount
mcounter = mcounter + 1
Nov 14, 2007 05:16 AM|XiaoYong Dai – MSFT|LINK
If user enters their credentials, you can try to query the Active Directory and see if there is any DirectoryServicesCOMException. Here is an example in c# code
Here is a C# -> VB.NET translator:
It's not perfect, but it will get you close.
Nov 23, 2007 04:34 AM|jovenatheart|LINK
I believe that password is a write only property on the AD. That's why you can't retrieve it.