skip to Main Content

Redis – Spring security config to require authentication for route does not work

I have spring config, where i am saving spring session in redis. @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { return http .csrf().disable() .cors(Customizer.withDefaults()) .authorizeHttpRequests(auth -> { auth.requestMatchers("/api/v1/auth/register/**", "/api/v1/auth/login" , "/api/v1/profile/**").permitAll(); auth.requestMatchers("/api/v1/profile").authenticated(); auth.anyRequest().authenticated(); }) .sessionManagement(sessionManagement -> sessionManagement .sessionCreationPolicy(IF_REQUIRED) // .sessionFixation(SessionManagementConfigurer.SessionFixationConfigurer::newSession)…

VIEW QUESTION
Back To Top
Search