Class AjaxAuthenticationFailureHandler

  • All Implemented Interfaces:
    org.springframework.security.web.authentication.AuthenticationFailureHandler

    public class AjaxAuthenticationFailureHandler
    extends org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
    Returns a 401 error code (Unauthorized) to the client, when Ajax authentication fails.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String UNAUTHORIZED_MESSAGE
      Constant UNAUTHORIZED_MESSAGE="Authentication failed"
      • Fields inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler

        logger
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onAuthenticationFailure​(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.security.core.AuthenticationException exception)
      • Methods inherited from class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler

        getRedirectStrategy, isAllowSessionCreation, isUseForward, saveException, setAllowSessionCreation, setDefaultFailureUrl, setRedirectStrategy, setUseForward
    • Field Detail

      • UNAUTHORIZED_MESSAGE

        public static final String UNAUTHORIZED_MESSAGE
        Constant UNAUTHORIZED_MESSAGE="Authentication failed"
        See Also:
        Constant Field Values
    • Constructor Detail

      • AjaxAuthenticationFailureHandler

        public AjaxAuthenticationFailureHandler()
    • Method Detail

      • onAuthenticationFailure

        public void onAuthenticationFailure​(javax.servlet.http.HttpServletRequest request,
                                            javax.servlet.http.HttpServletResponse response,
                                            org.springframework.security.core.AuthenticationException exception)
                                     throws IOException,
                                            javax.servlet.ServletException
        Specified by:
        onAuthenticationFailure in interface org.springframework.security.web.authentication.AuthenticationFailureHandler
        Overrides:
        onAuthenticationFailure in class org.springframework.security.web.authentication.SimpleUrlAuthenticationFailureHandler
        Throws:
        IOException
        javax.servlet.ServletException