Spring Security and Virgo [message #1252474] |
Fri, 21 February 2014 03:56  |
Eclipse User |
|
|
|
I integrated Spring Security correctly inside Virgo. But my question is:
I have three bundles:
- Bundle A(Domain Layer).
- Bundle B (Security Layer).
- Bundle C (Web Layer).
From Bundle B, I create the Spring SecurityContext everytime I create a Web Session from Bundle C with the current user logon, I know that the SecurityContext created is a ThreadLocal variable, my problem is that I implemented an auditory system from bundle A throw JPA Listeners so I must recover the active User every time I insert or update any domain entities. The problem is that I try to recover the Spring SecurityContext from Bundle A throw SecurityContextHolder.getContext() and I obtain null ;(, but if I configure Spring security like Global strategy, that is, SecurityContext is a public static variable i could obtain the last user logon.
How can I obtain my ThreadLocal Spring SecurityContext from any bundle???, What is the difference between a ThreadLocal variable and a static public variable inside OSGi???
Best Regards.
|
|
|
|
Re: Spring Security and Virgo [message #1255408 is a reply to message #1252758] |
Mon, 24 February 2014 07:06  |
Eclipse User |
|
|
|
My problem is not realy create the Spring SecurityContext and save it in my case in the thread of the bundle B, my problem is how can obtain this threadlocal variable with my SecurityContext from the other bundle A, because the auditory process is created from this bundle A, and i must access to the principal security object injected in the SecurityContext created in other bundle B.
|
|
|
Powered by
FUDForum. Page generated in 0.04895 seconds