Results 1 to 2 of 2

Thread: About Logout

Hybrid View

  1. #1

    Default About Logout

    I am using what you suggested in the post that to set the securecontext to null for logout. It works however, when I try to use the url again after log off, I get a nulll pointer exception. Here is what I was doing. I use the ContextHolder.getContext() to get the current secureContext. Then from there I call getAuthentication() to get a hand on the current Authentication object. There is a problem at this point. After I set the Context to null during the logout, I tried to reaccess the URL, Acegi did not stop me access it rather it passed the securety check and went directly to the URL, and caused a null pointer exception.
    I wonder what is the other way to do logout.

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

    Default

    Without really knowing your configuration and the URL you're mentioning, it's hard to offer specific suggestions.

    The best way to clear the context is:

    Code:
    ContextHolder.setContext(null);
    This must happen after your HttpSessionIntegrationFilter copies the Authentication from HttpSession to ContextHolder, but before it copies the Authentication (which is then null) from ContextHolder back to HttpSession.

    Your alternative is to simply invalidate the HttpSession. See the Contacts sample's logoff.jsp.

Similar Threads

  1. HOWTO: Acegi Logout
    By dmfrey in forum Security
    Replies: 10
    Last Post: Nov 4th, 2007, 11:46 AM
  2. CAS logout
    By garyfisher in forum Security
    Replies: 14
    Last Post: Jul 19th, 2007, 02:02 PM
  3. Replies: 2
    Last Post: Aug 1st, 2005, 04:51 AM
  4. logout method
    By gmansoor in forum Security
    Replies: 6
    Last Post: May 9th, 2005, 07:52 PM
  5. Replies: 1
    Last Post: May 5th, 2005, 09:42 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
  •