Spring security exclude endpoint from custom filter
<p>Having a spring security configuration with:</p>

<pre><code>http.antMatcher("/**/v1/public/company/employees/**")
                .authorizeRequests()
                .antMatchers(HttpMethod.OPTIONS, "/**/v1/public/company/employees/A").permitAll()
                .antMatchers(HttpMethod.POST, "/**/v1/public/company/employees/B").permitAll()
                .antMatchers("/**/v1/public/company/employees/**")
                .authenticated()
                .and()
                .csrf()
                .disable()
                .addFilterBefore(customFilter, AbstractPreAuthenticatedProcessingFilter.class);
</code></pre>

<p>How I can exclude public endpoints (<strong>A</strong> and <strong>B</strong>) from <code>customFilter</code>?</p>

<p><strong>Update</strong></p>

<p>Using:</p>

<pre><code>@Override
    public void configure(WebSecurity web) throws Exception {
        web
                .ignoring()
                .antMatchers(HttpMethod.OPTIONS, "/**/v1/public/company/employees/A")
                .antMatchers(HttpMethod.POST, "/**/v1/public/company/employees/B")
        }
</code></pre>

<p>seems enough, but I still don't know if it's the recommended way</p>