anchor.diff:  [source,java,role="primary",attrs="-attributes"]
   ----
   @Bean
  -BindAuthenticator authenticator(BaseLdapPathContextSource contextSource) {
  -	BindAuthenticator authenticator = new BindAuthenticator(contextSource);
  -	authenticator.setUserDnPatterns(new String[] { "uid={0},ou=people" });
  -	return authenticator;
  -}
  -
  -@Bean
  -LdapAuthenticationProvider authenticationProvider(LdapAuthenticator authenticator) {
  -	return new LdapAuthenticationProvider(authenticator);
  +AuthenticationManager authenticationManager(BaseLdapPathContextSource contextSource) {
  +	LdapBindAuthenticationManagerFactory factory = new LdapBindAuthenticationManagerFactory(contextSource);
  +	factory.setUserDnPatterns("uid={0},ou=people");
  +	return factory.createAuthenticationManager();
   }
   ----
   
  
positive.code: [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);
  }
  ----
  
  
negative.code: [source,java,role="primary"]
  ----
  @Bean
  AuthenticationManager authenticationManager(BaseLdapPathContextSource contextSource) {
  	LdapPasswordComparisonAuthenticationManagerFactory factory = new LdapPasswordComparisonAuthenticationManagerFactory(
  			contextSource, new BCryptPasswordEncoder());
  	factory.setUserDnPatterns("uid={0},ou=people");
  	factory.setPasswordAttribute("pwd");  // <1>
  	return factory.createAuthenticationManager();
  }
  ----
  
  