Hello,
I have the same issue, but in a custom application, I handle this using Spring aspects, all the interaction with the activiti API is done in a Service Bean, creating a loginAspect before each execution ensures the authentication authenticatedUserId is set,
<code>
@Aspect
public class LoginAspect {
@Before("execution(* com.company.WfService.*(..))")
public void logBefore(JoinPoint joinPoint){
log.info("Starting Checking authentification");
//Se registra el usuario
String wfUserName = Authentication.getAuthenticatedUserId();
String auth = get current logged user….
if ( wfUserName != null && wfUserName.compareTo(auth.getUsername()) != 0 ){
Authentication.setAuthenticatedUserId(auth.getUsername());
}else if ( wfUserName == null ){
Authentication.setAuthenticatedUserId(auth.getUsername());
}
}
}
</code>