Class LoginSuccessHandlerImpl
- java.lang.Object
-
- org.craftercms.security.authentication.impl.LoginSuccessHandlerImpl
-
- All Implemented Interfaces:
LoginSuccessHandler
public class LoginSuccessHandlerImpl extends Object implements LoginSuccessHandler
Default implementation ofLoginSuccessHandler:- Deletes any authentication exception saved in the session.
- Adds the ticket ID and profile last modified cookies to response.
- Uses the Spring
RequestCacheto obtain the previous request before login and redirect to it.
- Author:
- Alfonso Vásquez
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanalwaysUseDefaultTargetUrlprotected StringdefaultTargetUrlprotected org.springframework.security.web.savedrequest.RequestCacherequestCache
-
Constructor Summary
Constructors Constructor Description LoginSuccessHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetDefaultTargetUrl()voidhandle(org.craftercms.commons.http.RequestContext context, Authentication authentication)Handles the request after a successful authentication.protected booleanisAlwaysUseDefaultTargetUrl()protected voidredirectToSavedRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidsetAlwaysUseDefaultTargetUrl(boolean alwaysUseDefaultTargetUrl)voidsetDefaultTargetUrl(String defaultTargetUrl)voidsetRequestCache(org.springframework.security.web.savedrequest.RequestCache requestCache)
-
-
-
Field Detail
-
requestCache
protected org.springframework.security.web.savedrequest.RequestCache requestCache
-
defaultTargetUrl
protected String defaultTargetUrl
-
alwaysUseDefaultTargetUrl
protected boolean alwaysUseDefaultTargetUrl
-
-
Method Detail
-
setRequestCache
public void setRequestCache(org.springframework.security.web.savedrequest.RequestCache requestCache)
-
setDefaultTargetUrl
public void setDefaultTargetUrl(String defaultTargetUrl)
-
getDefaultTargetUrl
protected String getDefaultTargetUrl()
-
setAlwaysUseDefaultTargetUrl
public void setAlwaysUseDefaultTargetUrl(boolean alwaysUseDefaultTargetUrl)
-
isAlwaysUseDefaultTargetUrl
protected boolean isAlwaysUseDefaultTargetUrl()
-
handle
public void handle(org.craftercms.commons.http.RequestContext context, Authentication authentication) throws SecurityProviderException, IOExceptionDescription copied from interface:LoginSuccessHandlerHandles the request after a successful authentication.- Specified by:
handlein interfaceLoginSuccessHandler- Parameters:
context- the request contextauthentication- the authentication object- Throws:
SecurityProviderExceptionIOException
-
redirectToSavedRequest
protected void redirectToSavedRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException- Throws:
IOException
-
-