Results 1 to 4 of 4

Thread: HttpSessionListener Equivalent?

  1. #1
    Join Date
    Nov 2004
    Posts
    7

    Default HttpSessionListener Equivalent?

    Hello!

    Can anyone tell me if there is an equivalent of a session listener within the Acegi framework?

    I want to perform some arbitrary tasks when a user has been authenticated and also when they log out.

    Thanks

    Paul

  2. #2
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    No, but Acegi Security publishes authentication events under net.sf.acegisecurity.providers.dao.event. In CVS there is also a new net.sf.acegisecurity.intercept.event for security interception events. Take a look at either LoggerListener for an example of how to write a listener.

  3. #3
    Join Date
    Nov 2004
    Posts
    7

    Default

    OK thanks - I missed that paragraph in the documentation.

    I've implemented a listener now that performs my task upon successful authentication.

    I'm still a bit unsure of how to do something when a user logs off though - there doesn't seem to be an event for that.

    We're using a logout.jsp that just invalidates the session. I really don't want to use a session listener here as I'd like to keep everything within Spring/Acegi.

    What would you recommend.

    Cheers
    Paul

  4. #4
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    2,768

    Default

    Acegi Security does not have a notion of "logout". Typically people do what you've done, in that they use HttpSession invalidation. If you need a Spring-only solution you'll need to write a logout MVC controller that fires a logout event prior to performing the HttpSession invalidation.

Similar Threads

  1. Replies: 2
    Last Post: Jan 5th, 2006, 12:15 AM
  2. Replies: 1
    Last Post: Oct 6th, 2005, 02:53 PM
  3. Replies: 1
    Last Post: Jun 3rd, 2005, 05:02 AM
  4. Replies: 3
    Last Post: May 24th, 2005, 03:05 PM
  5. Replies: 2
    Last Post: Nov 23rd, 2004, 07:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •