Class SendPasswordResetInstructionsAction
- java.lang.Object
-
- org.springframework.webflow.action.AbstractAction
-
- org.apereo.cas.web.flow.actions.BaseCasWebflowAction
-
- org.apereo.cas.pm.web.flow.actions.SendPasswordResetInstructionsAction
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean,org.springframework.webflow.execution.Action
public class SendPasswordResetInstructionsAction extends org.apereo.cas.web.flow.actions.BaseCasWebflowActionThis isSendPasswordResetInstructionsAction.- Since:
- 5.0.0
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apereo.cas.configuration.CasConfigurationPropertiescasPropertiesThe CAS configuration properties.protected org.apereo.cas.notifications.CommunicationsManagercommunicationsManagerThe communication manager for SMS/emails.protected org.apereo.cas.pm.PasswordManagementServicepasswordManagementServiceThe password management service.protected org.apereo.cas.pm.PasswordResetUrlBuilderpasswordResetUrlBuilderBuild the reset URL for the user.protected org.apereo.cas.authentication.principal.PrincipalResolverprincipalResolverThe principal resolver to resolve the user and fetch attributes for follow-up ops, such as email message body building.static java.lang.StringREQUEST_PARAMETER_USERNAMEParameter name to look up the user.protected org.apereo.cas.ticket.TicketFactoryticketFactoryTicket factory instance.protected org.apereo.cas.ticket.registry.TicketRegistryticketRegistryTicket registry instance to hold onto the token.
-
Constructor Summary
Constructors Constructor Description SendPasswordResetInstructionsAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apereo.cas.pm.PasswordManagementQuerybuildPasswordManagementQuery(org.springframework.webflow.execution.RequestContext requestContext)protected java.net.URLbuildPasswordResetUrl(java.lang.String username, org.apereo.cas.authentication.principal.WebApplicationService service)Utility method to generate a password reset URL.protected org.springframework.webflow.execution.EventdoExecute(org.springframework.webflow.execution.RequestContext requestContext)protected org.springframework.webflow.execution.EventgetErrorEvent(java.lang.String code, java.lang.String defaultMessage, org.springframework.webflow.execution.RequestContext requestContext)Gets error event.protected org.springframework.webflow.execution.EventgetInvalidContactEvent(org.springframework.webflow.execution.RequestContext requestContext)Get the "invalid contact" event.protected org.apereo.cas.notifications.mail.EmailCommunicationResultsendPasswordResetEmailToAccount(java.lang.String username, java.lang.String to, java.net.URL url, org.springframework.webflow.execution.RequestContext requestContext)protected booleansendPasswordResetSmsToAccount(java.lang.String to, java.net.URL url)
-
-
-
Field Detail
-
REQUEST_PARAMETER_USERNAME
public static final java.lang.String REQUEST_PARAMETER_USERNAME
Parameter name to look up the user.- See Also:
- Constant Field Values
-
casProperties
protected final org.apereo.cas.configuration.CasConfigurationProperties casProperties
The CAS configuration properties.
-
communicationsManager
protected final org.apereo.cas.notifications.CommunicationsManager communicationsManager
The communication manager for SMS/emails.
-
passwordManagementService
protected final org.apereo.cas.pm.PasswordManagementService passwordManagementService
The password management service.
-
ticketRegistry
protected final org.apereo.cas.ticket.registry.TicketRegistry ticketRegistry
Ticket registry instance to hold onto the token.
-
ticketFactory
protected final org.apereo.cas.ticket.TicketFactory ticketFactory
Ticket factory instance.
-
principalResolver
protected final org.apereo.cas.authentication.principal.PrincipalResolver principalResolver
The principal resolver to resolve the user and fetch attributes for follow-up ops, such as email message body building.
-
passwordResetUrlBuilder
protected final org.apereo.cas.pm.PasswordResetUrlBuilder passwordResetUrlBuilder
Build the reset URL for the user.
-
-
Method Detail
-
buildPasswordResetUrl
protected java.net.URL buildPasswordResetUrl(java.lang.String username, org.apereo.cas.authentication.principal.WebApplicationService service) throws java.lang.ExceptionUtility method to generate a password reset URL.- Parameters:
username- usernameservice- service from the flow scope- Returns:
- URL a user can use to start the password reset process
- Throws:
java.lang.Exception- the exception
-
doExecute
protected org.springframework.webflow.execution.Event doExecute(org.springframework.webflow.execution.RequestContext requestContext) throws java.lang.Exception- Specified by:
doExecutein classorg.springframework.webflow.action.AbstractAction- Throws:
java.lang.Exception
-
buildPasswordManagementQuery
protected org.apereo.cas.pm.PasswordManagementQuery buildPasswordManagementQuery(org.springframework.webflow.execution.RequestContext requestContext)
-
getInvalidContactEvent
protected org.springframework.webflow.execution.Event getInvalidContactEvent(org.springframework.webflow.execution.RequestContext requestContext)
Get the "invalid contact" event. It could be overriden to return success and hide the fact that the login does not exist.- Parameters:
requestContext- the request context- Returns:
- the event
-
sendPasswordResetSmsToAccount
protected boolean sendPasswordResetSmsToAccount(java.lang.String to, java.net.URL url)
-
sendPasswordResetEmailToAccount
protected org.apereo.cas.notifications.mail.EmailCommunicationResult sendPasswordResetEmailToAccount(java.lang.String username, java.lang.String to, java.net.URL url, org.springframework.webflow.execution.RequestContext requestContext)
-
getErrorEvent
protected org.springframework.webflow.execution.Event getErrorEvent(java.lang.String code, java.lang.String defaultMessage, org.springframework.webflow.execution.RequestContext requestContext)Gets error event.- Parameters:
code- the codedefaultMessage- the default messagerequestContext- the request context- Returns:
- the error event
-
-