Skip to content

WebSecurityConfig - Algumas coisas estão depreciadas #16

@Devzin2911

Description

@Devzin2911

@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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions