You should be able to write an ApplicationListener that listens for an
AuthenticationSuccessEvent:

http://www.springframework.org/docs/api/org/springframework/context/ApplicationListener.html

http://www.acegisecurity.org/multiproject/acegi-security/apidocs/org/acegisecurity/event/authentication/AuthenticationSuccessEvent.html

I've done this in the past and it works pretty well. After writing the
class, you can register this class in you applicationContext.xml and
it should work. If you need access to the request or session, you
should be able to get it from the RequestContextHolder (which gets
populated with the request by the RequestContextListener).

Matt

On 6/26/07, ujjala <[EMAIL PROTECTED]> wrote:

I want to capture user's login information after authentication like
1- user's logintime after authentication.
2- If user gives wrong password three times in a row,his account  should be
locked.
            For this purpose where should i write the code.
  I tried it in usercounterlistener by writing this code. But it gives
exception that filter
  is not available.

public void attributeAdded(HttpSessionBindingEvent event) {
        log.debug("event.name: " + event.getName());
        if (event.getName().equals(EVENT_KEY)) {
            SecurityContext securityContext = (SecurityContext)
event.getValue();
            User user = (User)
securityContext.getAuthentication().getPrincipal();
            user.setLogintimestamp(Calendar.getInstance().getTime());

System.out.println("UserCounterListener.attributeAdded()_______======="+user);

                        UserManager mgr = (UserManager) .getBean("userManager");
                        mgr.saveUser(user);
                //
System.out.println("UserCounterListener.attributeAdded()_______=======");
            addUsername(user);
        }
    }


I want to write a Action where flow should come just after
authentication(filter) then it should
go to some other filters to get the url(just like clickedstreamfilter).


--
View this message in context: 
http://www.nabble.com/To-get-user%27s-login-information.-tf3981882s2369.html#a11304050
Sent from the AppFuse - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
http://raibledesigns.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to