<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Initiator/StartUserId Activiti REST in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199087#M152217</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you share the configuration you did to customise the authentication?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The org.activiti.rest.security.BasicAuthenticationProvider class shows how it's implemented by default.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 08 Apr 2015 10:29:26 GMT</pubDate>
    <dc:creator>trademak</dc:creator>
    <dc:date>2015-04-08T10:29:26Z</dc:date>
    <item>
      <title>Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199085#M152215</link>
      <description>Hi, we are using Activiti REST war in our application and we are using custom authentication and it is working perfectly fine.&amp;nbsp; We can start a process instance…etc.&amp;nbsp; But when we check the history of a process instance, the "startUserId" value is set to null.{&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "id": "15001",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "ur</description>
      <pubDate>Tue, 07 Apr 2015 13:27:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199085#M152215</guid>
      <dc:creator>anjan</dc:creator>
      <dc:date>2015-04-07T13:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199086#M152216</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In my CustomUserDetailsService, I have added the below code snippet and in the method loadUserByUsername method, I am trying to set the user name.&amp;nbsp; But I get NPE for identityService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@Autowired&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;private IdentityService identityService;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 09:20:05 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199086#M152216</guid>
      <dc:creator>anjan</dc:creator>
      <dc:date>2015-04-08T09:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199087#M152217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you share the configuration you did to customise the authentication?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The org.activiti.rest.security.BasicAuthenticationProvider class shows how it's implemented by default.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 10:29:26 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199087#M152217</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2015-04-08T10:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199088#M152218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Tijs, I looked at BasicAuthenticationProvider and added the identityService.&amp;nbsp; Anyway, here are the changes I made.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In SecurityConfiguration, I added the below line just before the &amp;lt;code&amp;gt;.httpBasic()&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;.addFilterBefore(new CustomHeaderAuthenticationFilter(),&amp;nbsp; BasicAuthenticationFilter.class)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the CustomHeaderAuthenticationFilter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class CustomHeaderAuthenticationFilter extends&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; RequestHeaderAuthenticationFilter {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; public CustomHeaderAuthenticationFilter() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; super();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; setPrincipalRequestHeader("Custom_User");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; setExceptionIfHeaderMissing(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; PreAuthenticatedAuthenticationProvider preAuth =&amp;nbsp; new PreAuthenticatedAuthenticationProvider();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; UserDetailsByNameServiceWrapper userDetails = new UserDetailsByNameServiceWrapper();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; userDetails.setUserDetailsService(new CustomUserDetailsService());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; preAuth.setPreAuthenticatedUserDetailsService(userDetails);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; List&amp;lt;AuthenticationProvider&amp;gt; providers = new ArrayList&amp;lt;AuthenticationProvider&amp;gt;(1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; providers.add(preAuth);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; setAuthenticationManager(new ProviderManager(providers));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; setContinueFilterChainOnUnsuccessfulAuthentication(true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And here is CustomUserDetailsService.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class CustomUserDetailsService implements UserDetailsService {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; @Autowired&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; private IdentityService identityService;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; @Override&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; List&amp;lt;GrantedAuthority&amp;gt; authorities = new ArrayList&amp;lt;GrantedAuthority&amp;gt;(1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; authorities.add(new GrantedAuthorityImpl("ROLE_USER"));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; UserDetails user = new User(username, "", true, true, true, true, authorities);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; identityService.setAuthenticatedUserId(username);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return user;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After successful authentication in our application, we set the "Custom_User" header to the user id and then make a call to Activiti REST.&amp;nbsp; I am able to successfully make this call.&amp;nbsp; But as mentioned in my original post, "startUserId" is not set.&amp;nbsp; So I tried to autowire IdentifyService.&amp;nbsp; But I am getting NullPointerException at &amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;identityService.setAuthenticatedUserId(username);&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the stacktrace:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SEVERE: Servlet.service() for servlet [dispatcher] in context with path [/activiti-rest] threw exception&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;java.lang.NullPointerException&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at my.custom.package.CustomUserDetailsService.loadUserByUsername(CustomUserDetailsService.java:25)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper.loadUserDetails(UserDetailsByNameServiceWrapper.java:51)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider.authenticate(PreAuthenticatedAuthenticationProvider.java:80)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:156)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doAuthenticate(AbstractPreAuthenticatedProcessingFilter.java:121)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:91)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:57)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:344)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:261)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; at java.lang.Thread.run(Thread.java:745)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 10:42:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199088#M152218</guid>
      <dc:creator>anjan</dc:creator>
      <dc:date>2015-04-08T10:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199089#M152219</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You are creating a new instance of CustomUserDetailsService by doing a new CustomUserDetailsService().&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By doing this, you are not using Spring to create the instance and any annotations in it will not be processes. Therefore IdentityService is null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Apr 2015 11:10:02 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199089#M152219</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2015-04-08T11:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199090#M152220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I changed the CustomHeaderAuthenticationFilter as below and used @Bean annotator.&amp;nbsp; But I am still getting the identityService as null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@Configuration&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;public class CustomHeaderAuthenticationFilter extends&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; RequestHeaderAuthenticationFilter {&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; @Bean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public CustomUserDetailsService customUserDetailsService()&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return new CustomUserDetailsService();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public CustomHeaderAuthenticationFilter() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; super();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; setPrincipalRequestHeader("Custom_User");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; setExceptionIfHeaderMissing(false);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; PreAuthenticatedAuthenticationProvider preAuth =&amp;nbsp; new PreAuthenticatedAuthenticationProvider();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; UserDetailsByNameServiceWrapper userDetails = new UserDetailsByNameServiceWrapper();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; userDetails.setUserDetailsService(customUserDetailsService());&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; preAuth.setPreAuthenticatedUserDetailsService(userDetails);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; List&amp;lt;AuthenticationProvider&amp;gt; providers = new ArrayList&amp;lt;AuthenticationProvider&amp;gt;(1);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; providers.add(preAuth);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; setAuthenticationManager(new ProviderManager(providers));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; setContinueFilterChainOnUnsuccessfulAuthentication(true);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Apr 2015 05:59:06 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199090#M152220</guid>
      <dc:creator>anjan</dc:creator>
      <dc:date>2015-04-09T05:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199091#M152221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is the package of the CustomUserDetailsService class also included in the Spring package scanning? Otherwise it won't be considered for dependency injection.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Best regards,&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Apr 2015 08:33:23 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199091#M152221</guid>
      <dc:creator>trademak</dc:creator>
      <dc:date>2015-04-12T08:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199092#M152222</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have included the &amp;lt;context:component-scan&amp;gt; (with package) in activiti-custom-context.xml file but identityService is still null.&amp;nbsp; One question though - I deployed both Activiti Explorer and Activiti REST in Tomcat (both are pointing to the same MySQL database).&amp;nbsp; Will this have any impact because both Explorer and REST will start a Process Engine?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 06:17:20 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199092#M152222</guid>
      <dc:creator>anjan</dc:creator>
      <dc:date>2015-04-14T06:17:20Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199093#M152223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I don´t think so. It is a common approach to use a shared database between Explorer and REST. I configured my Custom Filter like this: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Spring Configuration:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@Bean&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; public CustomAuthenticationFilter customTokenAuthenticationFilter() {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; return new CustomAuthenticationFilter("/**");&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; };&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;@Autowired&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;CustomAuthenticationFilter customAuthenticationFilter;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;.addFilterBefore(customAuthenticationFilter,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; BasicAuthenticationFilter.class).httpBasic();&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In my own filter, I extend &amp;lt;code&amp;gt;AbstractAuthenticationProcessingFilter&amp;lt;/code&amp;gt; and import &amp;lt;code&amp;gt;import org.activiti.engine.IdentityService;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After that, I use &amp;lt;code&amp;gt; @Autowired&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; private IdentityService identityService;&amp;lt;/code&amp;gt; and this works perfectly. &lt;/SPAN&gt;&lt;BR /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 08:41:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199093#M152223</guid>
      <dc:creator>b_schnarr</dc:creator>
      <dc:date>2015-04-14T08:41:17Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199094#M152224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Ben for the clarification.&amp;nbsp; I assume, you haven't made any changes to activiti-custom-context.xml file.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 08:45:44 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199094#M152224</guid>
      <dc:creator>anjan</dc:creator>
      <dc:date>2015-04-14T08:45:44Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199095#M152225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;No, nothing. All goes with the spring configuration and annotations. &lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 08:46:36 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199095#M152225</guid>
      <dc:creator>b_schnarr</dc:creator>
      <dc:date>2015-04-14T08:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Initiator/StartUserId Activiti REST</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199096#M152226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am able to resolve the issue.&amp;nbsp; But I used xml configuration in activiti-custom-context.xml (due to the issues of Autowiring of the beans).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="customHeaderAuthenticationFilter" class="org.springframework.security.web.authentication.preauth.RequestHeaderAuthenticationFilter"&amp;gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="principalRequestHeader" value="Custom_User"/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="authenticationManager" ref="authenticationManager" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="continueFilterChainOnUnsuccessfulAuthentication" value="true" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="exceptionIfHeaderMissing" value="false" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="preauthAuthProvider" class="org.springframework.security.web.authentication.preauth.PreAuthenticatedAuthenticationProvider"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="preAuthenticatedUserDetailsService"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="userDetailsServiceWrapper"&amp;nbsp; class="org.springframework.security.core.userdetails.UserDetailsByNameServiceWrapper"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="userDetailsService" ref="customUserDetailsService"/&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;security:authentication-manager alias="authenticationManager"&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;security:authentication-provider ref="preauthAuthProvider" /&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/security:authentication-manager&amp;gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;bean id="customUserDetailsService" class="com.custom.package.CustomUserDetailsService"&amp;gt;&amp;lt;/bean&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Modified SecurityConfiguration to add the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;@Autowired&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; RequestHeaderAuthenticationFilter customHeaderAuthenticationFilter;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .addFilterBefore(customHeaderAuthenticationFilter,&amp;nbsp; BasicAuthenticationFilter.class)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/code&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Also I have removed my custom CustomHeaderAuthenticationFilter as it is not required anymore.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks everyone for al the suggestions.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Apr 2015 13:16:17 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/initiator-startuserid-activiti-rest/m-p/199096#M152226</guid>
      <dc:creator>anjan</dc:creator>
      <dc:date>2015-04-14T13:16:17Z</dc:date>
    </item>
  </channel>
</rss>

