This week's book giveaway is in the Programmer Certification forum. We're giving away four copies of OCP Oracle Certified Professional Java SE 11 Programmer I Study Guide: Exam 1Z0-815 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I just started on a project that's using Spring Security and I would like to intercept successful login and logout events to do some work at those point of times.
Any idea what's the best way to achieve that?
Any indication as to where I need to put my plumbing code to run the logic required during those events (success login, logout) would pretty much be all I need.
posted 10 years ago
Ok so I figured out the login interception business using a SecurityListener class implementing a ApplicationListener and checking the type of the ApplicationEvent passed in like this:
Now my next problem is that there I can't seem to find a class representing a logout event. At this point I'm starting to wonder if logging out triggers an application event that would go through my securitylistener at all?