【发布时间】:2014-12-24 16:31:50
【问题描述】:
我正在尝试使用 PHP LDAP 验证电子邮件 ID 和密码。只是我想进行身份验证,无需访问联系人、邮件或日历。只需要确认他是有效用户。主机名正确。端口号也正确。请帮忙。 请注意我的场景
- 我的邮件 ID 是 xxxxx@childcompany.com,用户名是 yyyyyy
-
我的邮件由母公司 (mail.parentcompany.com) 托管和处理
$username = 'yyyyyy@parentcompany.com'; //If i use this line Unable to bind to server: Strong(er) authentication required $username = 'yyyyyy';//If i use this line Unable to bind to server: Invalid credentials $username = 'xxxxx@childcompany.com' //If i use this line Unable to bind to server: Invalid credentials $password = 'mypassword'; $ldap = ldap_connect("10.1.1.1",389) ; if ($ldap) { $ldapbind = ldap_bind($ldap,$username,$password ); if ($ldapbind) { echo "LDAP bind successful..."; } else { echo "LDAP bind failed..."; }}
【问题讨论】:
-
您的用户在 LDAP 服务器上的 DN 是什么?如果不知道这一点,您将很难让它发挥作用。
-
对不起@RobbyCornelissen .. 你在问域组件我对吗?
-
不。唯一标识 LDAP 服务器上的用户的专有名称。
标签: php authentication ldap