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

How to make the user sessions not expire in Redis in Spring Boot applicaion

I am new to spring-data-redis. I have integrated it with a spring-boot application. As part of this, I have added a few configs as follows: spring.session.store-type=redis spring.session.redis.namespace=tc server.servlet.session.timeout=-1 server.servlet.session.cookie.name=UISESSION server.servlet.session.cookie.http-only=true I don't want the user sessions to persist forever in…

VIEW QUESTION

Placeholder in PostgreSQL query with double colon :: cast

I have this SQL query: select date_trunc('month',created_at-'6d 18:06:56'::interval) +'6d 18:06:56'::interval as created_at, count(*)filter(where status='ACTIVE') as active, count(*)filter(where status='BLOCKED') as blocked from companies where now()-'12 months'::interval < created_at group by 1 order by 1; I tried to use it into Spring…

VIEW QUESTION
Back To Top
Search