概述
介绍
UserDetailsPasswordService是Spring Security从5.1版本开始提供的一个接口。它定义了实现类要提供可以修改用户账号密码的能力。
比如InMemoryUserDetailsManager就实现了接口UserDetailsPasswordService,可以对自己管理的用户账号的密码进行修改。
继承关系

源代码
源代码版本 : Spring Security 5.1.4.RELEASE
package org.springframework.security.core.userdetails;
/**
* An API for changing a UserDetails password.
* @author Rob Winch
* @since 5.1
*/
public interface UserDetailsPasswordService {
/**
* Modify the specified user's password. This should change the user's password in the
* persistent user repository (datbase, LDAP etc).
*
* @param user the user to modify the password for
* @param newPassword the password to change to
* @return the updated UserDetails with the new password
*/
UserDetails updatePassword(UserDetails user, String newPassword);
}
本文介绍了Spring Security 5.1版本中新增的UserDetailsPasswordService接口,该接口允许实现类修改用户账号密码,具体如InMemoryUserDetailsManager的实现。文章详细解释了接口的方法updatePassword,用于更改指定用户的密码,并更新到持久化用户存储中。
1036

被折叠的 条评论
为什么被折叠?



