我是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 [] []提前感谢您的帮助
发布于 2015-05-19 18:12:57
使用FR3D Ldap bundle,您在attributes列表中添加的第一个属性就是它用来搜索的属性。
在您的配置中,第一个属性是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 }发布于 2015-05-19 19:52:36
您必须调整搜索查询以通过电子邮件查找。
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 usernamehttps://stackoverflow.com/questions/30306262
复制相似问题