[英]How to enable LDAP authentication in PHP
我有一台服務器(Windows Server 2012 R2),需要在PHP中配置LDAP用戶身份驗證。 服務器是域控制器,已安裝PHP(5.6),PHP已經具有LDAP擴展名。 與ldp.exe中的憑據綁定有效。
我知道的:
域控制器:LDAP服務器簽名要求
沒有
網絡安全:LDAP客戶端簽名要求
協商簽名
PHP代碼:
// using ldap bind
$ldaprdn = 'bigboss'; // ldap rdn or dn
$ldappass = 'AdmiN123'; // associated password
// connect to ldap server
$ldapconn = ldap_connect("ldap://172.16.31.70")
or die("Could not connect to LDAP server.");
if ($ldapconn) {
// binding to ldap server
$ldapbind = ldap_bind($ldapconn, $ldaprdn, $ldappass);
// verify binding
if ($ldapbind) {
echo "LDAP bind successful...";
} else {
echo "LDAP bind failed...";
}
}
我的錯,我需要編輯
$ldaprdn = 'bigboss'
至
$ldaprdn = '[domain name]\bigboss'
謝謝
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.