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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
void
handle
(org.craftercms.commons.http.RequestContext context, AuthenticationException e) Redirects the response to target URL if target URL is not empty.protected void
sendError
(AuthenticationException e, org.craftercms.commons.http.RequestContext context) void
setTargetUrl
(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:
handle
in interfaceLoginFailureHandler
- Parameters:
context
- the request contexte
- the exception that caused the login to fail.- Throws:
SecurityProviderException
IOException
-
sendError
protected void sendError(AuthenticationException e, org.craftercms.commons.http.RequestContext context) throws IOException - Throws:
IOException
-