use of org.alfresco.repo.security.authentication.ResetPasswordServiceImpl.ResetPasswordDetails in project alfresco-remote-api by Alfresco.
the class PeopleImpl method resetPassword.
@Override
public void resetPassword(String personId, final PasswordReset passwordReset) {
checkResetPasswordData(passwordReset);
checkRequiredField("personId", personId);
ResetPasswordDetails resetDetails = new ResetPasswordDetails().setUserId(personId).setPassword(passwordReset.getPassword()).setWorkflowId(passwordReset.getId()).setWorkflowKey(passwordReset.getKey());
try {
// This is an un-authenticated API call so we wrap it to run as System
AuthenticationUtil.runAsSystem(() -> {
resetPasswordService.initiateResetPassword(resetDetails);
return null;
});
} catch (ResetPasswordWorkflowException ex) {
// See APPSREPO-35 acceptance criteria
if (LOGGER.isWarnEnabled()) {
LOGGER.warn(ex.getMessage());
}
}
}
Aggregations