Tôi đang cố sử dụng PHP adLDAP version 4.04 để xác thực trên mạng công ty mà không thành công.Php adLDAP Lỗi - Không thể liên kết với máy chủ: Yêu cầu xác thực mạnh (er)
PHP Version 5.2.4
Tôi cố gắng này Stackoverflow gửi PHP ldap - Strong(er) authentication required, không may mắn.
Tôi là NOT quản trị viên trên bộ điều khiển miền này; Tôi chỉ cần có khả năng truy vấn.
Tôi có thể ping HOSTNAMEOFDC.domain.location.company.com
(FQDN của Domain Controller của tôi)
Domain controller là một Windows Server 2012 R2 Standard
.
Tôi đã truy vấn thành công bộ điều khiển miền này bằng cách sử dụng DsQuery
và PowerShell AD Module
không có vấn đề và không có xác thực mà tôi đã phải nhập theo cách thủ công.
Mã của tôi:
<?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();
?>
tôi nhận được lỗi:
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
Sau đó, khi tôi bỏ ghi chú "use_ssl" => true"
tôi nhận được lỗi này:
FYI, ssl
được nạp trong tôi 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
Tôi cũng đã thử uncommenting "use_tls" => true"
và tôi nhận được lỗi này:
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
Ràng buộc Ldap được thực hiện với tên người dùng không phải là rdn, mặc dù máy chủ có thể được định cấu hình để chấp nhận tên người dùng. Và kiểm tra phiên bản giao thức của bạn quá, một số sẽ cần phải được thiết lập để phiên bản 3 – frz3993
@ frz3993 Xin lỗi newb-ary của tôi, những gì sẽ là một ví dụ RDN? Giống như 'Doman \ username'? –
Giống như một thành phần của DN như 'uid = 12345, ou = people'. Một số máy chủ cho phép tên miền \ tên người dùng. Nhưng tôi không nghĩ rằng đây là vấn đề – frz3993