Null autowired object

I am trying to implement authentication as follows:

I have defined the filter as follows"
public class CamundaSecurityFilter {
private CamundaAuthenticationProvider authenticationProvider;

public FilterRegistrationBean processEngineAuthenticationFilter() {
SpringBeanAutowiringSupport. processInjectionBasedOnCurrentContext ( this );
FilterRegistrationBean registration = new FilterRegistrationBean();
List urlList = new ArrayList<>();
return registration;

public class CamundaAuthenticationProvider implementsAuthenticationProvider {
private TenantIdDao tenantIdDao;


I have created this tenantIdDao. If I include this in any @Service it works correcttly. However this tenantIdDao is always null at runtime in CamundaAuthenticationProvider. I am not sure why that would be the case. This could be more of a spring boot issue than Camunda, not sure though. Please help if you can.

Sounds like you may need delay the order of your @Configuration.