I have a problem with my filter. I have it defined this way:
@WebFilter("springSecurityFilterChain")
public class JwtAuthenticationFilter extends AbstractAuthenticationProcessingFilter {...}
And in my web-fragment.xml I have:
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
The pattern should be valid but I keep getting this exception:
java.lang.IllegalArgumentException: Invalid <url-pattern> springSecurityFilterChain in filter mapping
I've also tried to changing the pattern with "/", "/security/*", "" both in the XML and in @WebFilter annotation but I keep getting this exception. Can someone explain me what I'm doing wrong?
Thank you.
EDIT
This is the Spring Security config:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.csrf().disable()
.exceptionHandling()
.authenticationEntryPoint(restAuthenticationEntryPoint)
.and().authorizeRequests().
anyRequest().authenticated().and()
.addFilterBefore(jwtAuthenticationFilter, BasicAuthenticationFilter.class);
http.antMatcher("/rest/login").securityContext().disable();
}