Note that there are some explanatory texts on larger screens.

plurals
  1. POVB.NET Connection to LDAP fails unknown username or bad password
    text
    copied!<p>I would really welcome some help with this issue. We have a php code that works and connects to the LDAP. When I try to connect using VB.NET 2010, it fails to bind with logon failure unknown username or bad password. Below is the connection information. When I talk to the folks who run the ldap server, they say I am binding sucessfully, below is the log file for the sucessful bind? If I continue and try to execute a search I don't get any results. The server is running openLDAP ver 2.3.39 on a linux server, server requires connection on port 636 for secure connection, or 389 for anonymous. </p> <p>using the following imports in code:</p> <pre><code>Imports System.DirectoryServices Imports System.DirectoryServices.Protocols Imports System.Data.SqlClient Imports System.Net.NetworkCredential </code></pre> <p>my connection:</p> <pre><code>Dim dirEntry As DirectoryEntry = New DirectoryEntry("LDAP://xxx.MyDomain.xxx/cn=users,dc=MyDomain,dc=xxx", "uid=my-bind,cn=users,dc=MyDomain,dc=xxx", "MyPassword") dirEntry.AuthenticationType = AuthenticationTypes.SecureSocketsLayer </code></pre> <p>my BindLog:</p> <blockquote> <p>Mar 16 15:10:17 ldap4 slapd[17391]: conn=110556 op=0 RESULT tag=97 err=0 text= Mar 16 15:10:17 ldap4 slapd[17391]: conn=110555 op=0 BIND dn="uid=my-bind,cn=users,dc=myDomain,dc=xxx" method=128 Mar 16 15:10:17 ldap4 slapd[17391]: conn=110555 op=0 BIND dn="uid=my-bind,cn=users,dc=myDomain.xxx" mech=SIMPLE ssf=0 Mar 16 15:10:17 ldap4 slapd[17391]: conn=110555 op=0 RESULT tag=97 err=0 text=</p> </blockquote> <p>my search:</p> <pre><code>Try Dim search As New DirectorySearcher(enTry) search.Filter = ("(&amp;(objectClass=users)(cn=" &amp; myUser &amp; "))") Dim result As SearchResult = search.FindOne() Dim myResult As Boolean = Nothing If result Is Nothing Then myResult = False Else myResult = True End If .... do some processing here Catch f As Exception Console.WriteLine(f.Message &amp; vbCrLf &amp; f.HelpLink.ToString) End Try </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload