0

I know that already have a lot of questions equals... But nothing works and I am going to be crazy.

I have had implementing JWT authentication in a Spring project and my Security configurer is here:

    @Override
    protected void configure(HttpSecurity httpSecurity) throws Exception {
        httpSecurity
            .csrf().disable()
            .authorizeRequests()
                .antMatchers("/auth/**").permitAll()
                .anyRequest().authenticated()
                .and()
            .exceptionHandling()
                .authenticationEntryPoint(unauthorizedHandler)
                .and()
            .sessionManagement()
                .sessionCreationPolicy(SessionCreationPolicy.STATELESS);

        httpSecurity
            .addFilterBefore(authenticationTokenFilterBean(), UsernamePasswordAuthenticationFilter.class);

        httpSecurity
            .headers().cacheControl();
    }

    @Override
    public void configure(WebSecurity web) throws Exception {
        web.ignoring().antMatchers("/auth/**");
    }

But all path require token.... I am already try to use @Secured("permitAll") in my controller class but also doesn't work.

dur
  • 15,689
  • 25
  • 79
  • 125
Develop_SP
  • 382
  • 5
  • 19

0 Answers0