just been poking around in the SecurityContext holder and that the contents of Authenciation.getDetails() will actually be a org.acegisecurity.ui.WebAuthenticationDetails from acegi...and guess what that contains... one ip address.

no need for the complex filter thread local thing, just use the SecurityContextHolder to get the authentication details.

Garet

On 4 Feb 2008, at 11:54, Rob Hills wrote:

Hi Richard,

[EMAIL PROTECTED] wrote:
Here's what I ended up with:

That all sounded pretty good to me.
Question:
But I'm not sure how to get either the session or request from the
ServletContext object - it does not list those properties - unless its just
too late and I'm not looking carefully.

No, I wouldn't say that. Not sure exactly where I got the following from, but this is my getRequest() method from my event interceptor class. From memory, it is dependent on having the ServletContext injected into the bean, but I may be wrong about that. The key point is, it works and i didn't have time to experiment with it at the time :-)

  private HttpServletRequest getRequest() {
return (HttpServletRequest) ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
  }
HTH,

Rob Hills
Waikiki, Western Australia

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



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

Reply via email to