You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by md...@apache.org on 2015/08/14 10:30:32 UTC

[03/31] syncope git commit: [SYNCOPE-652] Preliminary work (still struggling with OpenJPA slices)

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/DomainDataBinder.java
----------------------------------------------------------------------
diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/DomainDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/DomainDataBinder.java
new file mode 100644
index 0000000..0b85441
--- /dev/null
+++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/DomainDataBinder.java
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.api.data;
+
+import org.apache.syncope.common.lib.to.DomainTO;
+import org.apache.syncope.core.persistence.api.entity.Domain;
+
+public interface DomainDataBinder {
+
+    Domain create(DomainTO domainTO);
+
+    void update(Domain domain, DomainTO domainTO);
+
+    DomainTO getDomainTO(Domain domain);
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/provisioning-java/pom.xml
----------------------------------------------------------------------
diff --git a/core/provisioning-java/pom.xml b/core/provisioning-java/pom.xml
index 200ae0a..a1dc161 100644
--- a/core/provisioning-java/pom.xml
+++ b/core/provisioning-java/pom.xml
@@ -38,6 +38,12 @@ under the License.
   </properties>
 
   <dependencies>
+    <dependency> 
+      <groupId>javax.servlet</groupId> 
+      <artifactId>javax.servlet-api</artifactId> 
+      <scope>provided</scope>
+    </dependency>
+
     <dependency>
       <groupId>org.springframework</groupId>
       <artifactId>spring-context-support</artifactId>

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DomainDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DomainDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DomainDataBinderImpl.java
new file mode 100644
index 0000000..4ef408c
--- /dev/null
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/DomainDataBinderImpl.java
@@ -0,0 +1,70 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.provisioning.java.data;
+
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.SyncopeClientException;
+import org.apache.syncope.common.lib.to.DomainTO;
+import org.apache.syncope.common.lib.types.ClientExceptionType;
+import org.apache.syncope.core.persistence.api.entity.EntityFactory;
+import org.apache.syncope.core.persistence.api.entity.Domain;
+import org.apache.syncope.core.provisioning.api.data.DomainDataBinder;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+@Component
+public class DomainDataBinderImpl implements DomainDataBinder {
+
+    @Autowired
+    private EntityFactory entityFactory;
+
+    @Override
+    public Domain create(final DomainTO domainTO) {
+        Domain domain = entityFactory.newEntity(Domain.class);
+        update(domain, domainTO);
+        return domain;
+    }
+
+    @Override
+    public void update(final Domain domain, final DomainTO domainTO) {
+        if (domain.getKey() == null) {
+            domain.setKey(domainTO.getKey());
+        }
+
+        if (StringUtils.isBlank(domainTO.getAdminPwd()) || domainTO.getAdminCipherAlgorithm() == null) {
+            SyncopeClientException sce = SyncopeClientException.build(ClientExceptionType.RequiredValuesMissing);
+            sce.getElements().add("Actual password value and / or cipher algorithm");
+        }
+
+        domain.setPassword(domainTO.getAdminPwd(), domainTO.getAdminCipherAlgorithm());
+    }
+
+    @Override
+    public DomainTO getDomainTO(final Domain domain) {
+        DomainTO domainTO = new DomainTO();
+
+        domainTO.setKey(domain.getKey());
+
+        domainTO.setAdminCipherAlgorithm(domain.getAdminCipherAlgorithm());
+        domainTO.setAdminPwd(domainTO.getAdminPwd());
+
+        return domainTO;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
index b0fb8b0..f52b941 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/UserDataBinderImpl.java
@@ -88,7 +88,7 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
     public UserTO getAuthenticatedUserTO() {
         final UserTO authUserTO;
 
-        final String authUsername = AuthContextUtils.getAuthenticatedUsername();
+        final String authUsername = AuthContextUtils.getUsername();
         if (anonymousUser.equals(authUsername)) {
             authUserTO = new UserTO();
             authUserTO.setKey(-2);
@@ -244,8 +244,12 @@ public class UserDataBinderImpl extends AbstractAnyDataBinder implements UserDat
         if (userMod.getUsername() != null && !userMod.getUsername().equals(user.getUsername())) {
             propByRes.addAll(ResourceOperation.UPDATE, currentResources);
 
+            String oldUsername = user.getUsername();
             user.setUsername(userMod.getUsername());
-            AuthContextUtils.updateAuthenticatedUsername(userMod.getUsername());
+
+            if (oldUsername.equals(AuthContextUtils.getUsername())) {
+                AuthContextUtils.updateUsername(userMod.getUsername());
+            }
         }
 
         // security question / answer:

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJob.java
----------------------------------------------------------------------
diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJob.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJob.java
index 8f80ac0..34ca299 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJob.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/sync/AbstractProvisioningJob.java
@@ -24,11 +24,13 @@ import java.lang.reflect.ParameterizedType;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+import javax.annotation.Resource;
 import org.apache.commons.collections4.CollectionUtils;
 import org.apache.commons.collections4.Transformer;
 import org.apache.syncope.common.lib.SyncopeConstants;
 import org.apache.syncope.common.lib.types.Entitlement;
 import org.apache.syncope.common.lib.types.TraceLevel;
+import org.apache.syncope.core.misc.security.SyncopeAuthenticationDetails;
 import org.apache.syncope.core.misc.security.SyncopeGrantedAuthority;
 import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO;
 import org.apache.syncope.core.persistence.api.dao.ExternalResourceDAO;
@@ -49,7 +51,6 @@ import org.springframework.security.authentication.UsernamePasswordAuthenticatio
 import org.springframework.security.core.GrantedAuthority;
 import org.springframework.security.core.context.SecurityContextHolder;
 import org.springframework.security.core.userdetails.User;
-import org.springframework.security.core.userdetails.UserDetails;
 
 /**
  * Job for executing synchronization tasks.
@@ -61,6 +62,9 @@ import org.springframework.security.core.userdetails.UserDetails;
 public abstract class AbstractProvisioningJob<T extends ProvisioningTask, A extends ProvisioningActions>
         extends AbstractTaskJob {
 
+    @Resource(name = "adminUser")
+    protected String adminUser;
+
     /**
      * ConnInstance loader.
      */
@@ -404,10 +408,10 @@ public abstract class AbstractProvisioningJob<T extends ProvisioningTask, A exte
                     }
                 }, new ArrayList<GrantedAuthority>());
 
-        UserDetails userDetails = new User("admin", "FAKE_PASSWORD", authorities);
-
-        SecurityContextHolder.getContext().setAuthentication(
-                new UsernamePasswordAuthenticationToken(userDetails, "FAKE_PASSWORD", authorities));
+        UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken(
+                new User(adminUser, "FAKE_PASSWORD", authorities), "FAKE_PASSWORD", authorities);
+        auth.setDetails(new SyncopeAuthenticationDetails(taskDAO.getDomain(task)));
+        SecurityContextHolder.getContext().setAuthentication(auth);
 
         try {
             Class<T> clazz = getTaskClassReference();
@@ -415,16 +419,14 @@ public abstract class AbstractProvisioningJob<T extends ProvisioningTask, A exte
                 throw new JobExecutionException("Task " + taskId + " isn't a SyncTask");
             }
 
-            T provisioningTask = clazz.cast(this.task);
+            T provisioningTask = clazz.cast(task);
 
             Connector connector;
             try {
                 connector = connFactory.getConnector(provisioningTask.getResource());
             } catch (Exception e) {
-                final String msg = String.
-                        format("Connector instance bean for resource %s and connInstance %s not found",
-                                provisioningTask.getResource(), provisioningTask.getResource().getConnector());
-
+                String msg = String.format("Connector instance bean for resource %s and connInstance %s not found",
+                        provisioningTask.getResource(), provisioningTask.getResource().getConnector());
                 throw new JobExecutionException(msg, e);
             }
 

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/AddDomainFilter.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/AddDomainFilter.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/AddDomainFilter.java
new file mode 100644
index 0000000..1ae087a
--- /dev/null
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/AddDomainFilter.java
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.rest.cxf;
+
+import java.io.IOException;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.ext.Provider;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.core.misc.security.AuthContextUtils;
+
+/**
+ * Adds the domain header to all responses.
+ */
+@Provider
+public class AddDomainFilter implements ContainerResponseFilter {
+
+    @Override
+    public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) throws IOException {
+        resCtx.getHeaders().add(RESTHeaders.DOMAIN, AuthContextUtils.getDomain());
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/AddETagFilter.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/AddETagFilter.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/AddETagFilter.java
new file mode 100644
index 0000000..31c4d69
--- /dev/null
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/AddETagFilter.java
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.rest.cxf;
+
+import java.io.IOException;
+import javax.ws.rs.container.ContainerRequestContext;
+import javax.ws.rs.container.ContainerResponseContext;
+import javax.ws.rs.container.ContainerResponseFilter;
+import javax.ws.rs.core.EntityTag;
+import javax.ws.rs.core.HttpHeaders;
+import javax.ws.rs.ext.Provider;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.syncope.common.lib.to.AbstractAnnotatedBean;
+
+/**
+ * Adds the <tt>ETag</tt> header to any response containing an instance of {@link AbstractAnnotatedBean} as entity.
+ * The actual ETag value is computed on the basis of last change date (or creation date if not available).
+ */
+@Provider
+public class AddETagFilter implements ContainerResponseFilter {
+
+    @Override
+    public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) throws IOException {
+        if (resCtx.getEntity() instanceof AbstractAnnotatedBean && resCtx.getEntityTag() == null) {
+            AbstractAnnotatedBean sysInfo = (AbstractAnnotatedBean) resCtx.getEntity();
+            String etagValue = sysInfo.getETagValue();
+            if (StringUtils.isNotBlank(etagValue)) {
+                resCtx.getHeaders().add(HttpHeaders.ETAG, new EntityTag(etagValue).toString());
+            }
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AddETagFilter.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AddETagFilter.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AddETagFilter.java
deleted file mode 100644
index bdb40ac..0000000
--- a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/AddETagFilter.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.syncope.core.rest.cxf.service;
-
-import java.io.IOException;
-import javax.ws.rs.container.ContainerRequestContext;
-import javax.ws.rs.container.ContainerResponseContext;
-import javax.ws.rs.container.ContainerResponseFilter;
-import javax.ws.rs.core.EntityTag;
-import javax.ws.rs.core.HttpHeaders;
-import javax.ws.rs.ext.Provider;
-import org.apache.commons.lang3.StringUtils;
-import org.apache.syncope.common.lib.to.AbstractAnnotatedBean;
-
-/**
- * Adds the <tt>ETag</tt> filter to any response containing an instance of <tt>AbstractSysInfoTO</tt> as entity.
- * The actual ETag value is computed on the basis of last change date (or creation date if not available).
- *
- * @see AbstractSysInfoTO
- */
-@Provider
-public class AddETagFilter implements ContainerResponseFilter {
-
-    @Override
-    public void filter(final ContainerRequestContext reqCtx, final ContainerResponseContext resCtx) throws IOException {
-        if (resCtx.getEntity() instanceof AbstractAnnotatedBean && resCtx.getEntityTag() == null) {
-            AbstractAnnotatedBean sysInfo = (AbstractAnnotatedBean) resCtx.getEntity();
-            String etagValue = sysInfo.getETagValue();
-            if (StringUtils.isNotBlank(etagValue)) {
-                resCtx.getHeaders().add(HttpHeaders.ETAG, new EntityTag(etagValue).toString());
-            }
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/DomainServiceImpl.java
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/DomainServiceImpl.java b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/DomainServiceImpl.java
new file mode 100644
index 0000000..6632424
--- /dev/null
+++ b/core/rest-cxf/src/main/java/org/apache/syncope/core/rest/cxf/service/DomainServiceImpl.java
@@ -0,0 +1,66 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.syncope.core.rest.cxf.service;
+
+import java.net.URI;
+import java.util.List;
+import javax.ws.rs.core.Response;
+import org.apache.syncope.common.lib.to.DomainTO;
+import org.apache.syncope.common.rest.api.RESTHeaders;
+import org.apache.syncope.common.rest.api.service.DomainService;
+import org.apache.syncope.core.logic.DomainLogic;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+@Service
+public class DomainServiceImpl extends AbstractServiceImpl implements DomainService {
+
+    @Autowired
+    private DomainLogic logic;
+
+    @Override
+    public List<DomainTO> list() {
+        return logic.list();
+    }
+
+    @Override
+    public DomainTO read(final String key) {
+        return logic.read(key);
+    }
+
+    @Override
+    public Response create(final DomainTO anyTypeTO) {
+        DomainTO created = logic.create(anyTypeTO);
+        URI location = uriInfo.getAbsolutePathBuilder().path(String.valueOf(created.getKey())).build();
+        return Response.created(location).
+                header(RESTHeaders.RESOURCE_KEY, created.getKey()).
+                build();
+    }
+
+    @Override
+    public void update(final DomainTO anyTypeTO) {
+        logic.update(anyTypeTO);
+    }
+
+    @Override
+    public void delete(final String key) {
+        logic.delete(key);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/rest-cxf/src/main/resources/restCXFContext.xml
----------------------------------------------------------------------
diff --git a/core/rest-cxf/src/main/resources/restCXFContext.xml b/core/rest-cxf/src/main/resources/restCXFContext.xml
index c6a472e..5818422 100644
--- a/core/rest-cxf/src/main/resources/restCXFContext.xml
+++ b/core/rest-cxf/src/main/resources/restCXFContext.xml
@@ -88,9 +88,10 @@ under the License.
     <property name="javaDocPath" value="/WEB-INF/lib/syncope-common-rest-api-${syncope.version}-javadoc.jar"/>
   </bean>
   
-  <bean id="addETagFilter" class="org.apache.syncope.core.rest.cxf.service.AddETagFilter"/>
+  <bean id="addDomainFilter" class="org.apache.syncope.core.rest.cxf.AddDomainFilter"/>
+  <bean id="addETagFilter" class="org.apache.syncope.core.rest.cxf.AddETagFilter"/>
   
-  <jaxrs:server id="restContainer" address="/" 
+  <jaxrs:server id="restContainer" address="/"
                 basePackages="org.apache.syncope.common.rest.api.service, org.apache.syncope.core.rest.cxf.service" 
                 staticSubresourceResolution="true">
     <jaxrs:properties> 
@@ -108,6 +109,7 @@ under the License.
       <ref bean="exceptionMapper"/>
       <ref bean="searchContextProvider"/>
       <ref bean="wadlGenerator"/>
+      <ref bean="addDomainFilter"/>
       <ref bean="addETagFilter"/>
     </jaxrs:providers>
     <jaxrs:extensionMappings>

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
----------------------------------------------------------------------
diff --git a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
index 11bfce0..c124c05 100644
--- a/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
+++ b/core/workflow-activiti/src/main/java/org/apache/syncope/core/workflow/activiti/ActivitiUserWorkflowAdapter.java
@@ -252,7 +252,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
             final Boolean enabled, final boolean storePassword) {
 
         Map<String, Object> variables = new HashMap<>();
-        variables.put(WF_EXECUTOR, AuthContextUtils.getAuthenticatedUsername());
+        variables.put(WF_EXECUTOR, AuthContextUtils.getUsername());
         variables.put(USER_TO, userTO);
         variables.put(ENABLED, enabled);
         variables.put(STORE_PASSWORD, storePassword);
@@ -299,7 +299,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
         Set<String> preTasks = getPerformedTasks(user);
 
         final Map<String, Object> variables = new HashMap<>();
-        variables.put(WF_EXECUTOR, AuthContextUtils.getAuthenticatedUsername());
+        variables.put(WF_EXECUTOR, AuthContextUtils.getUsername());
         variables.put(TASK, task);
 
         // using BeanUtils to access all user's properties and trigger lazy loading - we are about to
@@ -674,7 +674,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     public List<WorkflowFormTO> getForms() {
         List<WorkflowFormTO> forms = new ArrayList<>();
 
-        final String authUser = AuthContextUtils.getAuthenticatedUsername();
+        final String authUser = AuthContextUtils.getUsername();
         if (adminUser.equals(authUser)) {
             forms.addAll(getForms(taskService.createTaskQuery().
                     taskVariableValueEquals(TASK_IS_FORM, Boolean.TRUE)));
@@ -788,7 +788,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     @Transactional
     @Override
     public WorkflowFormTO claimForm(final String taskId) {
-        final String authUser = AuthContextUtils.getAuthenticatedUsername();
+        final String authUser = AuthContextUtils.getUsername();
         Pair<Task, TaskFormData> checked = checkTask(taskId, authUser);
 
         if (!adminUser.equals(authUser)) {
@@ -813,7 +813,7 @@ public class ActivitiUserWorkflowAdapter extends AbstractUserWorkflowAdapter {
     @Transactional
     @Override
     public WorkflowResult<UserMod> submitForm(final WorkflowFormTO form) {
-        final String authUser = AuthContextUtils.getAuthenticatedUsername();
+        final String authUser = AuthContextUtils.getUsername();
         Pair<Task, TaskFormData> checked = checkTask(form.getTaskId(), authUser);
 
         if (!checked.getKey().getOwner().equals(authUser)) {

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/fit/core-reference/pom.xml
----------------------------------------------------------------------
diff --git a/fit/core-reference/pom.xml b/fit/core-reference/pom.xml
index d9716ec..166a394 100644
--- a/fit/core-reference/pom.xml
+++ b/fit/core-reference/pom.xml
@@ -261,7 +261,7 @@ under the License.
             </deployable>
             <deployable>
               <location>${project.build.directory}/${project.build.finalName}</location>
-              <pingURL>http://localhost:${cargo.servlet.port}/syncope/cacheStats.jsp</pingURL>
+              <pingURL>http://localhost:${cargo.servlet.port}/syncope/db.jsp</pingURL>
               <pingTimeout>60000</pingTimeout>
               <properties>
                 <context>syncope</context>

http://git-wip-us.apache.org/repos/asf/syncope/blob/252b1510/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 26e5754..7d722b3 100644
--- a/pom.xml
+++ b/pom.xml
@@ -335,7 +335,7 @@ under the License.
     <spring.version>4.1.7.RELEASE</spring.version>
     <spring-security.version>4.0.2.RELEASE</spring-security.version>
 
-    <openjpa.version>2.4.0</openjpa.version>
+    <openjpa.version>2.4.1-SNAPSHOT</openjpa.version>
     <commons-dbcp.version>2.1</commons-dbcp.version>
     <hibernate-validator.version>5.2.1.Final</hibernate-validator.version>
 
@@ -533,7 +533,12 @@ under the License.
         <artifactId>openjpa-persistence-jdbc</artifactId>
         <version>${openjpa.version}</version>
       </dependency>
-
+      <dependency>
+        <groupId>org.apache.openjpa</groupId>
+        <artifactId>openjpa-slice</artifactId>
+        <version>${openjpa.version}</version>
+      </dependency>
+    
       <dependency>
         <groupId>org.apache.commons</groupId>
         <artifactId>commons-dbcp2</artifactId>