Hi,
I just started on a project that's using Spring Security and I would like to intercept successful login and logout to do some actions at those point of times.
Any idea what's the best way to achieve that is?
Thanks
Hi,
I just started on a project that's using Spring Security and I would like to intercept successful login and logout to do some actions at those point of times.
Any idea what's the best way to achieve that is?
Thanks
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.
Lance, what about that table on page 12 (of the pdf)? There's documentation there for inserting more filters.
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?Code:public void onApplicationEvent(ApplicationEvent event) { if (event instanceof AuthenticationSuccessEvent) { ... } }
Any idea?
I just wanted to follow up on this, did anyone find a way to run some code when a user logs out? Explicitly and implicitly (session times out)? I need to do some processing on these events as well, and would like access to the UserDetails object to facilitate it.
Thanks,
David
Last edited by halcyon; Feb 10th, 2009 at 01:29 AM.
I have the same question: how to trigger code on logout.
This thread http://forum.springframework.org/showthread.php?t=29115
offers a suggestion, it that the excepted practice?
Or has this event been incorporated into the framework in 2 years?