¿Cómo defino http "security = 'none' en JavaConfig?

Quiero definir algo similar a este XML en Spring Boot usando Java Config.

<http pattern="/webservices/**" security="none"/>

Necesito una forma diferente de asegurarlos y no puedo iniciar sesión con formularios. Asegurarlos vendrá más tarde. Por ahora, quiero dejar de protegerlos con http.formLogin ().

He anulado WebSecurityConfigurerAdapter.configure () como tal. No puedo encontrar una API para decir así:

http.securityNone().antMatchers("/webservices")

Aquí está mi método configure () ahora:

@Override
protected void configure(HttpSecurity http) throws Exception
    http.csrf().disable(); 
    http.headers().frameOptions().disable();

    http.authorizeRequests()
          .antMatchers("/resources/**", 
//"/services/**",  THIS LOGS IN AUTOMATICALLY AS 'ANONYMOUS'.  NO GOOD!
//"/remoting/**",  THIS LOGS IN AUTOMATICALLY AS 'ANONYMOUS'.  NO GOOD!
                      "/pages/login",
                      "/pages/loginFailed").permitAll()

    // Only authenticated can access these URLs and HTTP METHODs
    .antMatchers("/secured/**").authenticated()
    .antMatchers(HttpMethod.HEAD,"/**").authenticated()
    .antMatchers(HttpMethod.GET,"/**").authenticated()
    .antMatchers(HttpMethod.POST,"/**").authenticated()
    .antMatchers(HttpMethod.PUT,"/**").authenticated()
    .antMatchers(HttpMethod.DELETE,"/**").authenticated();

    // Accept FORM-based authentication
    http.formLogin()
        .failureUrl("/pages/loginFailed")
        .defaultSuccessUrl("/")
        .loginPage("/pages/login")
        .permitAll()
        .and()
        .logout()
        .logoutRequestMatcher(new AntPathRequestMatcher("/pages/logout"))
        .logoutSuccessUrl("/pages/login")
        .permitAll();

    http.formLogin().successHandler(new AppLoginSuccessHandler());

}

Respuestas a la pregunta(1)

Su respuesta a la pregunta