Skip to content
Advertisement

Tag: spring-data-redis

Collection Object lost due to redis TTL using redission client

We are using Redission client for java to get the data from redis but object gets deleted from collection due to TTL. Example We are trying the below approach to get the data from Redis with TTL. final RList rList = client.getList(getEnvCacheKey(cacheKey)); rList.expire(7L, TimeUnit.SECONDS); rlist.add(“Value1”); rlist.add(“Value2”); assertThat(rList).containsOnly(“Value1”, “Value2”); // This condition is true until 7 seconds Now after 7 seconds

Spring Security returns 403 instead of 401 and creates invalid Redis session cookie

I’m using Spring Security and Spring Data Redis to keep track of user sessions with custom roles and entitlements. When I try to hit a PreAuthorized endpoint without a session cookie in my browser, it should return a 401. Instead a new (invalid) session cookie is created and the endpoint returns a 403. Here’s my SecurityConfig: I’m also using MethodSecurityConfig

Advertisement