【发布时间】:2017-02-23 10:42:26
【问题描述】:
我正在为 symfony 项目中的 ldap 身份验证而苦苦挣扎。
我的服务如下所示:
ldap:
class: Symfony\Component\Ldap\Ldap
factory: ['Symfony\Component\Ldap\Ldap', 'create']
arguments:
- 'ext_ldap'
- host: 'ldap.example.com'
对 ldap 服务器的绑定和示例查询工作正常:
$ldap = $this->get('ldap');
$ldap->bind('binduser', 'bindpw');
$query = $ldap->query('OU=MyBusiness,DC=example,DC=com', 'sAMAccountName=xxx');
现在我想对 ldap 服务器进行身份验证。我使用了http://symfony.com/doc/current/security/ldap.html#configuration-example-for-form-login 的防火墙设置。 但最大的问题是在哪里放置绑定凭据?
这里对应的日志条目是:
php.DEBUG: Warning: ldap_bind(): Unable to bind to server: Invalid credentials
所以很明显缺少什么,但我找不到向 form_login_ldap 提供绑定凭据的方法。
http://symfony.com/doc/current/reference/configuration/security.html 上的参考资料也没有显示如何提供它们。
谢谢!
【问题讨论】:
标签: php authentication ldap symfony