• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Spring session using redis and spring security

 
Ranch Hand
Posts: 128
1
jQuery Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am integrating Spring session using redis and spring security. I am able to integrate it and removed all the errors which I faced.
But as per the requirement I am not able to get the SESSION attribute in cookie.
I am integrating it with my web application using xml and annotations.

The redis is installed on Windows.

Here is the code:

pom.xml


web.xml


applicationContext-session.xml


RedisSessionAction.java


With the above configuration, the application is running. Even on console it prints activity related to spring session and redis but it is not showing any SESSION attribute in cookie as well as on the redis where there is no key store related to it.

Can somebody help me to figure out what am I missing?


Thanks,
Atul
 
Atul More
Ranch Hand
Posts: 128
1
jQuery Spring Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I found the solution.
I missed the configuration which helps spring security to create and wire up a filter in front of all security infrastructure to look for active sessions and populate the security context from values stored in Redis.
I need to add a class.

SessionConfig.java


After adding this, everything is working as expected.


Thanks,
Atul
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!