Class DelegatingAuthenticationFailureHandler
java.lang.Object
org.springframework.security.web.authentication.DelegatingAuthenticationFailureHandler
- All Implemented Interfaces:
- AuthenticationFailureHandler
public class DelegatingAuthenticationFailureHandler
extends Object
implements AuthenticationFailureHandler
An 
AuthenticationFailureHandler that delegates to other
 AuthenticationFailureHandler instances based upon the type of
 AuthenticationException passed into
 onAuthenticationFailure(HttpServletRequest, HttpServletResponse, AuthenticationException)
 .- Since:
- 4.0
- 
Constructor SummaryConstructorsConstructorDescriptionDelegatingAuthenticationFailureHandler(LinkedHashMap<Class<? extends AuthenticationException>, AuthenticationFailureHandler> handlers, AuthenticationFailureHandler defaultHandler) Creates a new instance
- 
Method SummaryModifier and TypeMethodDescriptionvoidonAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException exception) Called when an authentication attempt fails.
- 
Constructor Details- 
DelegatingAuthenticationFailureHandlerpublic DelegatingAuthenticationFailureHandler(LinkedHashMap<Class<? extends AuthenticationException>, AuthenticationFailureHandler> handlers, AuthenticationFailureHandler defaultHandler) Creates a new instance- Parameters:
- handlers- a map of the- AuthenticationExceptionclass to the- AuthenticationFailureHandlerthat should be used. Each is considered in the order they are specified and only the first- AuthenticationFailureHandleris ued. This parameter cannot specify null or empty.
- defaultHandler- the default- AuthenticationFailureHandlerthat should be used if none of the handlers matches. This parameter cannot specify null.
- Throws:
- IllegalArgumentException- if invalid argument is specified
 
 
- 
- 
Method Details- 
onAuthenticationFailurepublic void onAuthenticationFailure(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, AuthenticationException exception) throws IOException, jakarta.servlet.ServletException Description copied from interface:AuthenticationFailureHandlerCalled when an authentication attempt fails.- Specified by:
- onAuthenticationFailurein interface- AuthenticationFailureHandler
- 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:
- IOException
- jakarta.servlet.ServletException
 
 
-