OpenLDAP身份validationUID与CN问题

我在使用uidvalidation服务时遇到了问题,我认为这是用户身份validation的标准方法。 所以基本上,我的用户是这样添加到LDAP:

# jsmith, Users, example.com dn: uid=jsmith,ou=Users,dc=example,dc=com uidNumber: 10003 loginShell: /bin/bash sn: Smith mail: [email protected] homeDirectory: /home/jsmith displayName: John Smith givenName: John uid: jsmith gecos: John Smith gidNumber: 10000 cn: John Smith title: System Administrator 

但是,当我尝试使用典型的webapps或这样的服务进行身份validation:

 jsmith password 

我得到:

 ldapsearch -x -h ldap.example.com -D "cn=jsmith,ou=Users,dc=example,dc=com" -W -b "dc=example,dc=com" Enter LDAP Password: ldap_bind: Invalid credentials (49) 

但是,如果我使用:

 ldapsearch -x -h ldap.example.com -D "uid=jsmith,ou=Users,dc=example,dc=com" -W -b "dc=example,dc=com" 

有用。

但是,大多数webapps和authentication方法似乎使用另一种方法。 所以在我使用的webapp,除非我指定用户为: uid=smith,ou=users,dc=example,dc=com没有任何作品。

在webapp中,我只需要用户在用户字段中input:jsmith。

请记住,我的LDAP正在使用“新” cn=config方法来存储设置。 所以如果有人有一个明显的ldif我错过了,请提供。

让我知道如果你需要更多的信息。 这是Ubuntu 12.04上的OpenLDAP。

您示例中的ldapsearch工具使用简单的BIND来更改连接的授权状态。 简单的BIND操作需要专有名称和凭证。 在给定的条目中,可分辨的名称是uid=jsmith,ou=Users,dc=example,dc=com ,not cn=jsmith,ou=Users,dc=example,dc=com

此目录服务器configuration会导致服务器在实际使用的名称为cn=jsmith,ou=Users,dc=example,dc=com doe不存在时返回invalid credentials的结果代码。 这是推荐的configuration:它为攻击者提供较less的信息。