Package io.jmix.core.security
Interface UserManager
- All Known Implementing Classes:
AbstractDatabaseUserRepository
,DatabaseUserRepository
public interface UserManager
Interface provides API for some actions with users
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
changePassword
(String userName, String oldPassword, String newPassword) Changes the password for the specific user and saves changes to the database immediately.org.springframework.security.core.userdetails.UserDetails
changePassword
(String userName, String oldPassword, String newPassword, boolean saveChanges) Changes the password for the specific user.resetPasswords
(Set<org.springframework.security.core.userdetails.UserDetails> users) Generates new passwords for passed users and saves changes to the database immediately.resetPasswords
(Set<org.springframework.security.core.userdetails.UserDetails> users, boolean saveChanges) Generates new passwords for passed users.void
resetRememberMe
(Collection<org.springframework.security.core.userdetails.UserDetails> users) Resets 'remember me' token for the specific user.
-
Method Details
-
changePassword
default void changePassword(String userName, @Nullable String oldPassword, @Nullable String newPassword) throws PasswordNotMatchException Changes the password for the specific user and saves changes to the database immediately.- Parameters:
userName
- user loginoldPassword
- non-encoded old user passwordnewPassword
- non-encoded new user password- Throws:
PasswordNotMatchException
- if the oldPassword is notnull
and the oldPassword does not equal to the current password or if the oldPassword isnull
and the newPassword does equal the current password
-
changePassword
org.springframework.security.core.userdetails.UserDetails changePassword(String userName, @Nullable String oldPassword, @Nullable String newPassword, boolean saveChanges) throws PasswordNotMatchException Changes the password for the specific user.- Parameters:
userName
- users loginoldPassword
- non-encoded old user passwordnewPassword
- non-encoded new user passwordsaveChanges
- whether to save changes to the database- Throws:
PasswordNotMatchException
- if the oldPassword is notnull
and the oldPassword does not equal to the current password or if the oldPassword isnull
and the newPassword does equal the current password
-
resetPasswords
default Map<org.springframework.security.core.userdetails.UserDetails,String> resetPasswords(Set<org.springframework.security.core.userdetails.UserDetails> users) Generates new passwords for passed users and saves changes to the database immediately.- Parameters:
users
- users which need reset passwords- Returns:
- map which contains new passwords for the passed users
-
resetPasswords
Map<org.springframework.security.core.userdetails.UserDetails,String> resetPasswords(Set<org.springframework.security.core.userdetails.UserDetails> users, boolean saveChanges) Generates new passwords for passed users.- Parameters:
users
- users which need reset passwordssaveChanges
- whether to save changes to the database- Returns:
- map which contains new passwords for the passed users
-
resetRememberMe
Resets 'remember me' token for the specific user.- Parameters:
users
- - users which need reset 'remember me' token
-