Null autowired object

I am trying to implement authentication as follows:

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

@Bean
public FilterRegistrationBean processEngineAuthenticationFilter() {
SpringBeanAutowiringSupport. processInjectionBasedOnCurrentContext ( this );
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setName(“camunda-auth”);
registration.setFilter(getProcessEngineAuthenticationFilter());
registration.addInitParameter(“authentication-provider”,
“com.enterprise.servicing.framework.security.CamundaAuthenticationProvider”);
List urlList = new ArrayList<>();
urlList.add("/*");
registration.setUrlPatterns(urlList);
return registration;
}

public class CamundaAuthenticationProvider implementsAuthenticationProvider {
@Autowired
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.