Class LoginFailureHandlerImpl
java.lang.Object
org.craftercms.security.authentication.impl.LoginFailureHandlerImpl
- All Implemented Interfaces:
LoginFailureHandler
Default implementation of
LoginFailureHandler, which redirects the
response to a target URL or 401 is sent if there's no target URL.- Author:
- Alfonso Vásquez
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stringvoidhandle(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 Details
-
targetUrl
-
-
Constructor Details
-
LoginFailureHandlerImpl
public LoginFailureHandlerImpl()
-
-
Method Details
-
setTargetUrl
-
getTargetUrl
-
handle
public void handle(org.craftercms.commons.http.RequestContext context, AuthenticationException e) throws SecurityProviderException, IOException Redirects 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
-