概述
介绍
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);
}