繁体   English   中英

FR3DLdapBundle用电子邮件登录

[英]FR3DLdapBundle Login with email

我是LDAP概念的新手,必须与LDAP和FosUserBundle集成。 我已经安装了fosuser和FR3DLdapBundle这两个捆绑软件,fosuser可以正常工作,但是我缺少有关LDAP登录的信息。

我需要用电子邮件登录。

我有以下配置: http : //pastebin.com/USkJqtbD

我正在使用此网站进行测试: http : //www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/

我正在使用电子邮件:riemann@ldap.forumsys.com和密码:password

但是我有以下错误

[2015-05-18 16:36:58] ldap_driver.DEBUG: ldap_search(cn=read-only-admin,dc=example,dc=com, (&(objectClass=*)(uid=riemann@ldap.forumsys.com)), uid,mail) [] []

[2015-05-18 16:36:58] security.INFO: User riemann@ldap.forumsys.com not found on ldap [] []

预先感谢您的帮助

使用FR3D Ldap捆绑包,添加到属性列表中的第一个属性就是用于搜索的属性。

在您的配置中,第一个属性是uid ,因此我怀疑如果您使用uid作为用户名,那么它将正确。 要对其进行排序,您只需要切换顺序,以便您的mail属性在列表中排在首位。

fr3d_ldap:
    // ...
    user:
        // ...
        attributes:  # Specify ldap attributes mapping [ldap attribute, user object method]
            - { ldap_attr: mail,  user_method: setEmail } # Default
            - { ldap_attr: uid,  user_method: setUsername }

您必须调整搜索查询以通过电子邮件查找。

https://github.com/Maks3w/FR3DLdapBundle/blob/master/Resources/doc/index.md#4-configure-configyml

# app/config/config.yml
fr3d_ldap:
  driver:
    accountFilterFormat: (&(email=%s)) # Optional. sprintf format %s will be the username

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM