anchor.diff:  [source,java,role="primary",attrs="-attributes"]
   ----
   @Bean
  -BindAuthenticator authenticator(BaseLdapPathContextSource contextSource) {
  -	String searchBase = "ou=people";
  -	String filter = "(uid={0})";
  -	FilterBasedLdapUserSearch search =
  -		new FilterBasedLdapUserSearch(searchBase, filter, contextSource);
  -	BindAuthenticator authenticator = new BindAuthenticator(contextSource);
  -	authenticator.setUserSearch(search);
  -	return authenticator;
  -}
  -
  -@Bean
  -LdapAuthenticationProvider authenticationProvider(LdapAuthenticator authenticator) {
  -	return new LdapAuthenticationProvider(authenticator);
  +AuthenticationManager authenticationManager(BaseLdapPathContextSource contextSource) {
  +	LdapBindAuthenticationManagerFactory factory = new LdapBindAuthenticationManagerFactory(contextSource);
  +	factory.setUserSearchFilter("(uid={0})");
  +	factory.setUserSearchBase("ou=people");
  +	return factory.createAuthenticationManager();
   }
   ----
   
  
positive.code: [source,kotlin,role="secondary",attrs="-attributes"]
  ----
  @Bean
  fun authenticator(contextSource: BaseLdapPathContextSource): BindAuthenticator {
      val searchBase = "ou=people"
      val filter = "(uid={0})"
      val search = FilterBasedLdapUserSearch(searchBase, filter, contextSource)
      val authenticator = BindAuthenticator(contextSource)
      authenticator.setUserSearch(search)
      return authenticator
  }
  
  @Bean
  fun authenticationProvider(authenticator: LdapAuthenticator): LdapAuthenticationProvider {
      return LdapAuthenticationProvider(authenticator)
  }
  ----
  ====
  
negative.code: [source,java,role="primary"]
  ----
  @Bean
  AuthenticationManager authenticationManager(BaseLdapPathContextSource contextSource) {
  	LdapPasswordComparisonAuthenticationManagerFactory factory = new LdapPasswordComparisonAuthenticationManagerFactory(
  			contextSource, NoOpPasswordEncoder.getInstance());
  	factory.setUserDnPatterns("uid={0},ou=people");
  	return factory.createAuthenticationManager();
  }
  ----
  
  