title: ldapsearch with username and password
body: <p>Here is my LDAP ORG Structure:</p>
  
  <p><a href="https://i.stack.imgur.com/wYY5F.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wYY5F.png" alt="LDAP ORG Structure"></a></p>
  
  <p>I created user with first, last name with password. But it is not working when am trying to connect using jdbc. Error says invalid credentials. Then I tried ldapsearch as follows:</p>
  
  <p>I followed this <a href="https://www.linuxsecrets.com/blog/3security-and-authentication/2015/07/02/1550-complete-guide-installing-openldap-and-phpldapadmin" rel="nofollow noreferrer">process</a> for users and group creation: </p>
  
  <pre><code>root@ip:/home# ldapwhoami
  SASL/DIGEST-MD5 authentication started
  Please enter your password:
  ldap_sasl_interactive_bind_s: Invalid credentials (49)
      additional info: SASL(-13): user not found: no secret in database
  
  root@ip:/# ldapsearch -x -LLL -h ip -D username -w password -b"cn=admin,dc=ivhdev,dc=local" -s sub "(objectClass=*)" "givenName=username*"
  ldap_bind: Invalid DN syntax (34)
      additional info: invalid DN
  </code></pre>
  
  <p>Please suggest/correct me, if am passing the right info in DN syntax. I am unable to validate the user credentials with their name and password.</p>