I am attempting to authenticate users via LDAP.
I am able to query ldap and fill a listbox with users found in a certain OU.
When i try to authenticate via a user found in the above list, it returns my msgbox of "Failed to Login".
Here is my code:
This is put in a button function
Dim uid As String = txtusername.Text & ",OU=fake,OU=fake,DC=fake,DC=com"
Dim password As String = txtpassword.Text
Dim de As New DirectoryEntry("LDAP://fake.com/OU=fake,OU=fake,DC=fake,DC=com", uid, password, AuthenticationTypes.None)
Try
Dim ds As DirectorySearcher = New DirectorySearcher(de)
ds.FindOne()
MsgBox("Login!")
Catch
MsgBox("Fail!")
End Try