In spring-boot application using springsecurity for writing custom autentication. CustomUserService is a interface and has a implementation class and a repository to fetch data from database.
@Component
public class CustomAuthenticationProvider implements AuthenticationProvider{
@Autowired
private CustomUserService userService;
@override
someMethod(){//method of CustomUserService interface.
userService.display();//here "userService" is always null coming
}
}
kept @service on implementation & used @ComponentScan for basepackages discovery