Class ResetPasswordServiceImpl
- java.lang.Object
-
- org.alfresco.repo.security.authentication.ResetPasswordServiceImpl
-
- All Implemented Interfaces:
ResetPasswordService
public class ResetPasswordServiceImpl extends java.lang.Object implements ResetPasswordService
Reset password implementation based on workflow.- Since:
- 5.2.1
- Author:
- Jamal Kaabi-Mofrad
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classResetPasswordServiceImpl.InvalidResetPasswordWorkflowExceptionstatic classResetPasswordServiceImpl.ResetPasswordDetailsstatic classResetPasswordServiceImpl.ResetPasswordEmailDetailsstatic classResetPasswordServiceImpl.ResetPasswordWorkflowExceptionstatic classResetPasswordServiceImpl.ResetPasswordWorkflowInvalidUserExceptionstatic classResetPasswordServiceImpl.ResetPasswordWorkflowNotFoundException
-
Constructor Summary
Constructors Constructor Description ResetPasswordServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringcreateResetPasswordUrl(ClientAppConfig.ClientApp clientApp, java.lang.String id, java.lang.String key)This method creates a URL for the 'reset password' link which appears in the emailClientAppConfig.ClientAppgetClientAppConfig(java.lang.String clientName)Gets the registered client.protected java.lang.StringgetConfirmResetPasswordEmailTemplate(ClientAppConfig.ClientApp clientApp)protected java.lang.StringgetResetPasswordEmailTemplate(ClientAppConfig.ClientApp clientApp)voidinit()voidinitiateResetPassword(ResetPasswordServiceImpl.ResetPasswordDetails resetDetails)Validates the request reset password workflow and updates the workflow.voidperformResetPassword(org.activiti.engine.delegate.DelegateExecution execution)Updates the user's new password.voidrequestReset(java.lang.String userId, java.lang.String clientName)Request password reset (starts the workflow).protected voidsendEmail(ResetPasswordServiceImpl.ResetPasswordEmailDetails emailRequest)voidsendResetPasswordConfirmationEmail(org.activiti.engine.delegate.DelegateExecution execution, java.lang.String fallbackEmailTemplatePath, java.lang.String emailSubject)Updates the user's new password.voidsendResetPasswordEmail(org.activiti.engine.delegate.DelegateExecution execution, java.lang.String fallbackEmailTemplatePath, java.lang.String emailSubject)Sends reset password email.voidsetActionService(ActionService actionService)voidsetActivitiHistoryService(org.activiti.engine.HistoryService activitiHistoryService)voidsetActivitiTaskService(org.activiti.engine.TaskService activitiTaskService)voidsetAuthenticationService(MutableAuthenticationService authenticationService)voidsetClientAppConfig(ClientAppConfig clientAppConfig)voidsetDefaultEmailSender(java.lang.String defaultEmailSender)voidsetEmailHelper(EmailHelper emailHelper)voidsetNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)voidsetPersonService(PersonService personService)voidsetSendEmailAsynchronously(boolean sendEmailAsynchronously)voidsetSysAdminParams(SysAdminParams sysAdminParams)voidsetTimerEnd(java.lang.String timerEnd)voidsetWorkflowService(WorkflowService workflowService)protected java.lang.StringvalidateUserAndGetEmail(java.lang.String userId)
-
-
-
Method Detail
-
setWorkflowService
public void setWorkflowService(WorkflowService workflowService)
-
setActivitiHistoryService
public void setActivitiHistoryService(org.activiti.engine.HistoryService activitiHistoryService)
-
setActionService
public void setActionService(ActionService actionService)
-
setPersonService
public void setPersonService(PersonService personService)
-
setNodeService
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
-
setSysAdminParams
public void setSysAdminParams(SysAdminParams sysAdminParams)
-
setAuthenticationService
public void setAuthenticationService(MutableAuthenticationService authenticationService)
-
setActivitiTaskService
public void setActivitiTaskService(org.activiti.engine.TaskService activitiTaskService)
-
setEmailHelper
public void setEmailHelper(EmailHelper emailHelper)
-
setClientAppConfig
public void setClientAppConfig(ClientAppConfig clientAppConfig)
-
setTimerEnd
public void setTimerEnd(java.lang.String timerEnd)
-
setDefaultEmailSender
public void setDefaultEmailSender(java.lang.String defaultEmailSender)
-
setSendEmailAsynchronously
public void setSendEmailAsynchronously(boolean sendEmailAsynchronously)
-
init
public void init()
-
requestReset
public void requestReset(java.lang.String userId, java.lang.String clientName)Description copied from interface:ResetPasswordServiceRequest password reset (starts the workflow).- Specified by:
requestResetin interfaceResetPasswordService- Parameters:
userId- the user idclientName- the client app name (used to lookup the client that is registered to send emails so that client's specific configuration could be used.)
-
validateUserAndGetEmail
protected java.lang.String validateUserAndGetEmail(java.lang.String userId)
-
initiateResetPassword
public void initiateResetPassword(ResetPasswordServiceImpl.ResetPasswordDetails resetDetails)
Description copied from interface:ResetPasswordServiceValidates the request reset password workflow and updates the workflow.- Specified by:
initiateResetPasswordin interfaceResetPasswordService- Parameters:
resetDetails- theResetPasswordDetailsobject
-
getClientAppConfig
public ClientAppConfig.ClientApp getClientAppConfig(java.lang.String clientName)
Description copied from interface:ResetPasswordServiceGets the registered client.- Specified by:
getClientAppConfigin interfaceResetPasswordService- Parameters:
clientName- the client name- Returns:
ClientAppobject
-
sendResetPasswordEmail
public void sendResetPasswordEmail(org.activiti.engine.delegate.DelegateExecution execution, java.lang.String fallbackEmailTemplatePath, java.lang.String emailSubject)Description copied from interface:ResetPasswordServiceSends reset password email.- Specified by:
sendResetPasswordEmailin interfaceResetPasswordService- Parameters:
execution- theDelegateExecutionobject (is provided when a user requests password reset)fallbackEmailTemplatePath- the class path of the fallback email template (request reset password email)emailSubject- the email subject key
-
performResetPassword
public void performResetPassword(org.activiti.engine.delegate.DelegateExecution execution)
Description copied from interface:ResetPasswordServiceUpdates the user's new password.- Specified by:
performResetPasswordin interfaceResetPasswordService- Parameters:
execution- theDelegateExecutionobject
-
sendResetPasswordConfirmationEmail
public void sendResetPasswordConfirmationEmail(org.activiti.engine.delegate.DelegateExecution execution, java.lang.String fallbackEmailTemplatePath, java.lang.String emailSubject)Description copied from interface:ResetPasswordServiceUpdates the user's new password.- Specified by:
sendResetPasswordConfirmationEmailin interfaceResetPasswordService- Parameters:
execution- theDelegateExecutionobjectfallbackEmailTemplatePath- the class path of the fallback email template (confirmation email)emailSubject- the email subject key
-
sendEmail
protected void sendEmail(ResetPasswordServiceImpl.ResetPasswordEmailDetails emailRequest)
-
getResetPasswordEmailTemplate
protected java.lang.String getResetPasswordEmailTemplate(ClientAppConfig.ClientApp clientApp)
-
getConfirmResetPasswordEmailTemplate
protected java.lang.String getConfirmResetPasswordEmailTemplate(ClientAppConfig.ClientApp clientApp)
-
createResetPasswordUrl
protected java.lang.String createResetPasswordUrl(ClientAppConfig.ClientApp clientApp, java.lang.String id, java.lang.String key)
This method creates a URL for the 'reset password' link which appears in the email
-
-