Spring数据LDAP通常用于绑定身份验证吗?
我正在尝试使用SpringDataLDAP通过OpenLDAP服务器进行用户身份验证。但是,按uid和userPassword搜索失败,因为密码存储为SSHA哈希。 我想知道springdataldap是否真的可以用于用户身份验证,因为教程通常集中于搜索,或者它们将密码映射到userPassword以外的属性Spring数据LDAP通常用于绑定身份验证吗?,ldap,spring-data,Ldap,Spring Data,我正在尝试使用SpringDataLDAP通过OpenLDAP服务器进行用户身份验证。但是,按uid和userPassword搜索失败,因为密码存储为SSHA哈希。 我想知道springdataldap是否真的可以用于用户身份验证,因为教程通常集中于搜索,或者它们将密码映射到userPassword以外的属性 @Entry(base = "ou=People", objectClasses = { "top", "person", "inetOrgPerson", "organizational
@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);
}
@Entry(base=“ou=People”,objectClasses={“top”,“person”,“inetOrgPerson”,“organizationalPerson”,“simpleSecurityObject”})
公共类LdapUser{
@Id名称dn;
@属性(name=“userPassword”)
私有字符串密码;
/**用户id*/
@属性(name=“uid”)
私有字符串用户名;
}
公共接口ILdapUserRepo扩展了LdapRepository{
public LdapUser findByUserNameAndPassword(字符串用户名、字符串密码);
}
您的用例不是Spring Data LDAP的目标。SpringDataLDAP旨在通过查询和更新LDAP实体来查找LDAP中的对象
执行LDAP身份验证需要使用适当的连接器直接针对LDAP进行身份验证