首页 文章

Symfony3 LDAP身份验证绑定凭据

提问于
浏览
2

我正在努力解决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上的参考文献也没有说明如何提供它们 .

谢谢!

1 回答

相关问题