@OverRide
protected void configure(HttpSecurity http) throws Exception {
http.headers().frameOptions().disable();
http.cors().and().csrf().disable()
.addFilterAfter(new JWTFilter(), UsernamePasswordAuthenticationFilter.class)
.authorizeRequests()
.antMatchers(SWAGGER_WHITELIST).permitAll()
.antMatchers("/h2-console/**").permitAll()
.antMatchers(HttpMethod.POST,"/login").permitAll()
.antMatchers(HttpMethod.POST,"/users").permitAll()
.antMatchers(HttpMethod.GET,"/users").hasAnyRole("USERS","MANAGERS")
.antMatchers("/managers").hasAnyRole("MANAGERS")
.anyRequest().authenticated()
.and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
}
Nessa parte especifica do código do WebSecurityConfig ele fica informando que o antMatchers está depreciado, ele fica com erro, tentei buscar uma outra implementação mas não consegui, consegue me ajudar ?
@OverRide
protected void configure(HttpSecurity http) throws Exception {
http.headers().frameOptions().disable();
http.cors().and().csrf().disable()
.addFilterAfter(new JWTFilter(), UsernamePasswordAuthenticationFilter.class)
.authorizeRequests()
.antMatchers(SWAGGER_WHITELIST).permitAll()
.antMatchers("/h2-console/**").permitAll()
.antMatchers(HttpMethod.POST,"/login").permitAll()
.antMatchers(HttpMethod.POST,"/users").permitAll()
.antMatchers(HttpMethod.GET,"/users").hasAnyRole("USERS","MANAGERS")
.antMatchers("/managers").hasAnyRole("MANAGERS")
.anyRequest().authenticated()
.and()
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
}
Nessa parte especifica do código do WebSecurityConfig ele fica informando que o antMatchers está depreciado, ele fica com erro, tentei buscar uma outra implementação mas não consegui, consegue me ajudar ?