Class LoginFailureHandlerImpl
- java.lang.Object
-
- org.craftercms.security.authentication.impl.LoginFailureHandlerImpl
-
- All Implemented Interfaces:
LoginFailureHandler
public class LoginFailureHandlerImpl extends Object implements LoginFailureHandler
Default implementation ofLoginFailureHandler, which redirects the response to a target URL or 401 is sent if there's no target URL.- Author:
- Alfonso Vásquez
-
-
Constructor Summary
Constructors Constructor Description LoginFailureHandlerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetTargetUrl()voidhandle(org.craftercms.commons.http.RequestContext context, AuthenticationException e)Redirects the response to target URL if target URL is not empty.protected voidsendError(AuthenticationException e, org.craftercms.commons.http.RequestContext context)voidsetTargetUrl(String targetUrl)
-
-
-
Field Detail
-
targetUrl
protected String targetUrl
-
-
Method Detail
-
setTargetUrl
public void setTargetUrl(String targetUrl)
-
getTargetUrl
protected String getTargetUrl()
-
handle
public void handle(org.craftercms.commons.http.RequestContext context, AuthenticationException e) throws SecurityProviderException, IOExceptionRedirects the response to target URL if target URL is not empty. If not, a 401 UNAUTHORIZED error is sent.- Specified by:
handlein interfaceLoginFailureHandler- Parameters:
context- the request contexte- the exception that caused the login to fail.- Throws:
SecurityProviderExceptionIOException
-
sendError
protected void sendError(AuthenticationException e, org.craftercms.commons.http.RequestContext context) throws IOException
- Throws:
IOException
-
-