Je tente d'utiliser PHP adLDAP version 4.04 pour m'authentifier sur un réseau d'entreprise sans succès pour le moment.Erreur php adLDAP - Impossible de lier au serveur: authentification (er) forte requise
PHP Version 5.2.4
J'ai essayé Stackoverflow poster PHP ldap - Strong(er) authentication required, pas de chance.
Je suis PAS un administrateur sur ce contrôleur de domaine; Je dois seulement pouvoir interroger.
Je suis en mesure de ping HOSTNAMEOFDC.domain.location.company.com
(le nom complet de mon contrôleur de domaine)
Le contrôleur de domaine est un Windows Server 2012 R2 Standard
.
J'ai interrogé avec succès ce contrôleur de domaine en utilisant DsQuery
et PowerShell AD Module
sans problème et sans authentification que j'ai dû taper manuellement.
Mon code:
<?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" => "@domain.location.company.com",
// "admin_username" => $username,
// "admin_password" => $password,
// "ad_port" => "636",
// "base_dn" => "DC=domain,DC=location,DC=company,DC=com",
"domain_controllers" => array("HOSTNAMEOFDC.domain.location.company.com"),
// "real_primarygroup" => "",
// "recursive_groups" => "",
// "use_ssl" => true
// "use_tls" => true
);
$adldap = new adLDAP($options);
// $authUser = $adldap->user()->authenticate($username, $password);
$authUser = $adldap->user()->authenticate($username,$password);
if ($authUser) {
echo "User authenticated successfully";
} else {
// getLastError is not needed, but may be helpful for finding out why:
echo $adldap->getLastError() . "<br>";
echo "User authentication unsuccessful";
}
// Destroy
$adldap->close();
$adldap->__destruct();
?>
Je reçois l'erreur:
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
Puis, quand je décommenter "use_ssl" => true"
je reçois cette erreur:
Pour votre information, ssl
est chargé dans mon php.ini
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
J'ai aussi essayé décommentant "use_tls" => true"
et je reçois cette erreur:
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
Ldap bind se fait avec le nom d'utilisateur rdn not, bien que les serveurs puissent être configurés pour accepter le nom d'utilisateur. Et vérifiez votre version du protocole aussi, certains devront être mis à la version 3 – frz3993
@ frz3993 Excusez mon newb-ary, ce qui serait un exemple RDN? Comme 'Doman \ nom d'utilisateur'? –
Plus comme un composant de DN comme 'uid = 12345, ou = people'. Certains serveurs autorisent le domaine \ nom d'utilisateur. Mais je ne pense pas que c'est le problème – frz3993