Hi, I have extended LoginUrlAuthenticationEntryPoint in order to send an Error code in certain situations instead of redirecting to the login page, but the error status is not being set.
I am setting up the header in an ajax request from the client, the header is being set properly and response.sendError, but I never get the error code on the other end.Code:public class AjaxAwareAuthenticationEntryPoint extends LoginUrlAuthenticationEntryPoint { private static final Logger logger = LoggerFactory.getLogger(AjaxAwareAuthenticationEntryPoint.class); @Override public void commence(HttpServletRequest request, HttpServletResponse response, AuthenticationException authException) throws IOException, ServletException { if(request.getHeader("ajax") != null) { response.sendError(HttpStatus.SC_REQUEST_TIMEOUT); } else { super.commence(request, response, authException); } } }
I am injecting the custom entry point in the <http> element of the spring security namespace.
I am using JQuery on the client side.
What am I doing wrong?
Thanks,
Angel


