【问题标题】:Is Spring Data LDAP generally intended for bind authentication?Spring Data LDAP 通常用于绑定身份验证吗?
【发布时间】:2019-07-29 06:52:40
【问题描述】:

我正在尝试使用 Spring Data LDAP 进行使用 OpenLDAP 服务器的用户身份验证。但是,通过 uid 和 userPassword 搜索失败,因为密码存储为 SSHA 散列。 我想知道 Spring Data LDAP 是否真的可以用于用户身份验证,因为教程通常专注于搜索,或者它们将密码映射到 userPassword 以外的某个属性。

@Entry(base = "ou=People", objectClasses = { "top", "person", "inetOrgPerson", "organizationalPerson",  "simpleSecurityObject" })
public class LdapUser {
@Id Name dn;

@Attribute(name = "userPassword")
private String password;

/** The user id. */
@Attribute(name = "uid")
private String userName;
}

public interface ILdapUserRepo extends LdapRepository<LdapUser>{
    public LdapUser findByUserNameAndPassword(String username, String password);
}

【问题讨论】:

    标签: ldap spring-data


    【解决方案1】:

    您的用例不是 Spring Data LDAP 的用途。 Spring Data LDAP 旨在通过查询和更新 LDAP 实体来从 LDAP 中查找对象。

    执行 LDAP 身份验证需要使用适当的连接器直接针对 LDAP 进行身份验证。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-07-30
      • 2020-09-08
      • 1970-01-01
      • 2017-04-12
      • 1970-01-01
      • 1970-01-01
      • 2016-08-05
      • 2016-08-12
      相关资源
      最近更新 更多