Class DelegatingAuthenticationFailureHandler
- java.lang.Object
-
- org.springframework.security.web.authentication.DelegatingAuthenticationFailureHandler
-
- All Implemented Interfaces:
AuthenticationFailureHandler
public class DelegatingAuthenticationFailureHandler extends java.lang.Object implements AuthenticationFailureHandler
AnAuthenticationFailureHandlerthat delegates to otherAuthenticationFailureHandlerinstances based upon the type ofAuthenticationExceptionpassed intoonAuthenticationFailure(HttpServletRequest, HttpServletResponse, AuthenticationException).- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description DelegatingAuthenticationFailureHandler(java.util.LinkedHashMap<java.lang.Class<? extends AuthenticationException>,AuthenticationFailureHandler> handlers, AuthenticationFailureHandler defaultHandler)Creates a new instance
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidonAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception)Called when an authentication attempt fails.
-
-
-
Constructor Detail
-
DelegatingAuthenticationFailureHandler
public DelegatingAuthenticationFailureHandler(java.util.LinkedHashMap<java.lang.Class<? extends AuthenticationException>,AuthenticationFailureHandler> handlers, AuthenticationFailureHandler defaultHandler)
Creates a new instance- Parameters:
handlers- a map of theAuthenticationExceptionclass to theAuthenticationFailureHandlerthat should be used. Each is considered in the order they are specified and only the firstAuthenticationFailureHandleris ued. This parameter cannot specify null or empty.defaultHandler- the defaultAuthenticationFailureHandlerthat should be used if none of the handlers matches. This parameter cannot specify null.- Throws:
java.lang.IllegalArgumentException- if invalid argument is specified
-
-
Method Detail
-
onAuthenticationFailure
public void onAuthenticationFailure(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, AuthenticationException exception) throws java.io.IOException, javax.servlet.ServletExceptionDescription copied from interface:AuthenticationFailureHandlerCalled when an authentication attempt fails.- Specified by:
onAuthenticationFailurein interfaceAuthenticationFailureHandler- Parameters:
request- the request during which the authentication attempt occurred.response- the response.exception- the exception which was thrown to reject the authentication request.- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
-