class X509AuthenticationFilter extends AbstractAuthenticationProcessingFilter {

    @Override
    public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException {
        HttpServletRequest request = (HttpServletRequest) req;
        HttpServletResponse response = (HttpServletResponse) res;
        if (!requiresAuthentication(request, response)) {
            chain.doFilter(request, response);
            return;
        }
        Authentication authResult = attemptAuthentication(request, response);
        if (authResult == null) {
            chain.doFilter(request, response);
            return;
        }
        successfulAuthentication(request, response, chain, authResult);
    }

    public  X509AuthenticationFilter(String endpoint,
                                    AuthenticationSuccessHandler successHandler,
                                    AuthenticationProvider authenticationProvider);

}