title: Php adLDAP Error - Unable to bind to server: Strong(er) authentication required
body: <p>I am attempting to use <a href="http://adldap.sourceforge.net/" rel="nofollow noreferrer">PHP adLDAP version 4.04</a>  to authenticate on a corporate network with no success yet.</p>
  
  <p><code>PHP Version 5.2.4</code></p>
  
  <p>I tried this stackoverflow post <a href="https://stackoverflow.com/questions/5991591/php-ldap-stronger-authentication-required">PHP ldap - Strong(er) authentication required</a>, no luck.</p>
  
  <p>I am <strong>NOT</strong> an admin on this domain controller; I only need to be able to query.</p>
  
  <p>I am able to ping <code>HOSTNAMEOFDC.domain.location.company.com</code> (the FQDN of my Domain Controller)</p>
  
  <p>The domain controller is a <code>Windows Server 2012 R2 Standard</code>.</p>
  
  <p>I have successfully queried this domain controller using <code>DsQuery</code> and <code>PowerShell AD Module</code> with no problem and no authentication that I had to manually type.</p>
  
  <p>My code:</p>
  
  <pre><code>&lt;?php
  require_once("includes/php/adLDAP/src/adLDAP.php");
  $username = "domain\\username"; // also tried just "username"
  $password = "somepassword";
  
  // All possible settings are listed in this array
  $options = array(
          "account_suffix" =&gt; "@domain.location.company.com",
  //      "admin_username" =&gt; $username,
  //      "admin_password" =&gt; $password,
  //      "ad_port" =&gt; "636",
  //      "base_dn" =&gt; "DC=domain,DC=location,DC=company,DC=com",
          "domain_controllers" =&gt; array("HOSTNAMEOFDC.domain.location.company.com"),
  //      "real_primarygroup" =&gt; "",
  //      "recursive_groups" =&gt; "",
  //      "use_ssl" =&gt; true
  //      "use_tls" =&gt; true
  );
  
  $adldap = new adLDAP($options);
  
  
  // $authUser = $adldap-&gt;user()-&gt;authenticate($username, $password);
  $authUser = $adldap-&gt;user()-&gt;authenticate($username,$password);
  if ($authUser) {
      echo "User authenticated successfully";
  } else {
      // getLastError is not needed, but may be helpful for finding out why:
      echo $adldap-&gt;getLastError() . "&lt;br&gt;";
      echo "User authentication unsuccessful";
  }
  
  // Destroy
  $adldap-&gt;close();
  $adldap-&gt;__destruct();
  ?&gt;
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Strong(er) authentication required in C:\xampp\htdocs\Workspace\Project\scripts\includes\php\adLDAP\src\adLDAP.php on line 712
  Strong(er) authentication required
  User authentication unsuccessful
  </code></pre>
  
  <p>Then when I uncomment <code>"use_ssl" =&gt; true"</code> I get this error:</p>
  
  <p>FYI, <code>ssl</code> is loaded in my <code>php.ini</code></p>
  
  <pre><code>Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server in C:\xampp\htdocs\Workspace\Project\scripts\includes\php\adLDAP\src\adLDAP.php on line 712
  Can't contact LDAP server
  User authentication unsuccessful
  </code></pre>
  
  <p>I've also tried uncommenting <code>"use_tls" =&gt; true"</code> and I get this error:</p>
  
  <pre><code>Warning: ldap_start_tls() [function.ldap-start-tls]: Unable to start TLS: Connect error in C:\xampp\htdocs\Workspace\Project\scripts\includes\php\adLDAP\src\adLDAP.php on line 638
  
  Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server: Can't contact LDAP server in C:\xampp\htdocs\Workspace\Project\scripts\includes\php\adLDAP\src\adLDAP.php on line 712
  Can't contact LDAP server
  User authentication unsuccessful
  </code></pre>