「ログイン時にパスワードを変更する」機能のためにログインのみをカスタマイズした場合はUserLocalServiceUtil.updatePassword
、4 番目のパラメータではなく、ポータルのデフォルトの動作をそのまま使用することもできます。
public static User updatePassword(long userId,
String password1,
String password2,
boolean passwordReset,
boolean silentUpdate)
throws PortalException,
SystemException
Updates the user's password, optionally with tracking and validation of the change.
Parameters:
userId - the primary key of the user
password1 - the user's new password
password2 - the user's new password confirmation
passwordReset - whether the user should be asked to reset their password the next time they login
silentUpdate - whether the password should be updated without being tracked, or validated. Primarily used for password imports.
Returns:
the user
Throws:
PortalException - if a user with the primary key could not be found
SystemException - if a system exception occurred