class FailedAuthenticationHandler implements AuthenticationFailureHandler {

    @Override
    public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) throws ServletException {
        log.debug("Unauthorized access to '{}' endpoint", request.getRequestURI());
        handler.handleException(request, response, exception);
    }

}