INFO: I am trying to authenticate and adLDAP
PROBLEM: adLDAP telling me “User authentication unsuccessful”
QUESTION: How do I find out what I need to do when there are no errors telling me what handle this.
SEARCHED/TRIED:
- http://adldap.sourceforge.net/faq.php
- stackoverflow.com/questions/2465260/using-adldap-php-class-but-getting-error-when-looking-for-group-user-belongs-to
- adldap.sourceforge.net/wiki/doku.php?id=documentation_examples#authenticating_a_user
- http://phreek.org/blog/2011/12/enable-php-ldap-module-in-xampp
CODE:
require_once(dirname(__FILE__) . '/adLDAP.php');
$adldap = new adLDAP();
$username = "user";
// $username = "domain\user"; // I have also tried
$password = "pass";
$authUser = $adldap->authenticate($username, $password);
if ($authUser == true) {
echo "User authenticated successfully";
}
else {
echo "User authentication unsuccessful";
}
echo('<hr />');
$result=$adldap->user_info("jboyle");
print_r($result);
HTML OUTPUT:
User authentication unsuccessful
Fatal error: Call to undefined method adLDAP::user_info() in C:\xampp\htdocs\adLDAP\compare.php on line 18
Replace:
with
Result:
Info/sources:
https://sourceforge.net/projects/adldap/forums/forum/358759/topic/1719128?message=4368835
http://adldap.sourceforge.net/wiki/doku.php?id=ldap_over_ssl#tell_apache_how_to_use_ldaps
Do a phpinfo() and check where the HOME variable points to in the Apache environment. Create a symbolic link or copy ldap.conf to this location.
If you get a connect error may be because your local OpenSSL installation doesn’t recognise the certificate (or its authority) provided by the server. This can be circumvented by adding the following line to ldap.conf on your server or similar:
Change TLS_REQCERT allow to TLS_REQCERT never
Apache must be able to read ldap.conf, you cannot skip this step.