【发布时间】:2020-08-26 13:16:51
【问题描述】:
在 Spring Boot 1.5.9 应用程序中,我重置了我的密码。使用令牌,我能够识别正在重置密码的用户。
这是我更新已连接用户密码的方式:
public void updatePassword(User entity) {
if (null != entity.getOldPassword() && null != entity.getPassword()) {
userDetailsService.changePassword(entity.getOldPassword(), encrypt(entity.getPassword()));
}
}
我使用 LdapUserDetailsManager userDetailsService,来自 spring security ldap 4.2.3.RELEASE,我没有看到任何方法可以重置我拥有 username 的用户的密码。
如何使用username(或ldap 中的uid)重置密码?
【问题讨论】:
-
那是因为 LDAP 是获取凭据的主要方式,要更改它们,您通常需要使用特定于每个供应商的额外 API。例如:stackoverflow.com/questions/15335614/…
-
我已经尝试过那个例子,但那不是针对 ldap,这是针对活动目录的。我还没有找到更新现有密码的解决方案,这个例子对我没有帮助。
-
LDAP 是规范,Microsoft Active Directory 是实现之一。您使用哪个 LDAP 服务器?
-
打开 LDAP。我已阅读此内容:tech.wrighting.org/2013/06/06/…,我现在正在尝试。
标签: java spring ldap spring-ldap spring-security-ldap