Improve authenticated application context initialization
[lgpl/argeo-commons.git] / security / runtime / org.argeo.security.core / src / main / java / org / argeo / security / core / AbstractSystemExecution.java
index 23a111b9430e51e50c5c5b507a560c7514ed2bde..856ceee60e0a0e55fb672f781e21adbac2936595 100644 (file)
@@ -68,11 +68,18 @@ public abstract class AbstractSystemExecution {
                if (securityContext.getAuthentication() != null) {
                        securityContext.setAuthentication(null);
                        authenticatedBySelf.set(false);
-                       if (log.isTraceEnabled())
+                       if (log.isTraceEnabled()) {
                                log.trace("System deauthenticated");
+                               // Thread.dumpStack();
+                       }
                }
        }
 
+       /** Whether the current thread was authenticated by this component. */
+       protected Boolean isAuthenticatedBySelf() {
+               return authenticatedBySelf.get();
+       }
+
        public void setAuthenticationManager(
                        AuthenticationManager authenticationManager) {
                this.authenticationManager = authenticationManager;