Search in sources :

Example 1 with ResetPasswordDetails

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());
        }
    }
}
Also used : ResetPasswordWorkflowException(org.alfresco.repo.security.authentication.ResetPasswordServiceImpl.ResetPasswordWorkflowException) ResetPasswordDetails(org.alfresco.repo.security.authentication.ResetPasswordServiceImpl.ResetPasswordDetails)

Aggregations

ResetPasswordDetails (org.alfresco.repo.security.authentication.ResetPasswordServiceImpl.ResetPasswordDetails)1 ResetPasswordWorkflowException (org.alfresco.repo.security.authentication.ResetPasswordServiceImpl.ResetPasswordWorkflowException)1