C# and authenticating with LDAP
C#
1
Posts
1
Posters
0
Views
1
Watching
-
Hi I was wondering if anyone could offer some advice on authenticating a .NET application with LDAP. The code seems to work fine with AD, but fails with LDAP: (extract)
DirectoryEntry entry = new DirectoryEntry("LDAP://testdomain/DC=testdomain", "testdomain/testuser", textPassword.Text); Object obj = entry.NativeObject; DirectorySearcher search = new DirectorySearcher(entry); search.Filter = "(SAMAccountName=testuser)"; search.PropertiesToLoad.Add("cn"); SearchResult result = search.FindOne(); if (null == result) { . . . }
The test PC runs on a Windows XP box with .NET Framework 1.1, and is bound to the respective authentication server every time. The authentication server is a Mac OS X 10.4 server running LDAPv3. Any suggestions?