0
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception{
   return http
        .csrf(csrf -> csrf.disable())
        .authorizeHttpRequests(auth -> {
            auth.requestMatchers("/auth/**").permitAll();
            auth.anyRequest().authenticated();
        })
        .httpBasic(Customizer.withDefaults())
        .build(); 
}

I tried to make post request using the "http://localhost:8080/auth/register" but it gives me to sign in. I tried using postman but it gives "401 Unauthorized" Status. Using permitAll() method it should have allowed to make post request, but I am not able to do it. I need help

0 Answers0