I'm using spring security 2.
1.may i know how to use securitycontextholder to get total number of active users?
2. can retrieve sessionregistry from securitycontextholder?
I'm using spring security 2.
1.may i know how to use securitycontextholder to get total number of active users?
2. can retrieve sessionregistry from securitycontextholder?
extend AuthenticationProcessingFilter
override
@Override
protected void onSuccessfulAuthentication(HttpServletRequest request,
HttpServletResponse response, Authentication authResult)
throws IOException {
and here you can do the things you want to do by keeping a application variable .
I do not know how to do with spring. But in servlets you need to implement a HttpSession Listener interface for a listener class . The interface has two methods namely sessionCreated() and sessionDestroyed() . Whenever a new session is created you can increment the static variable in the method sessionCreated.