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,kotlin,role="secondary",attrs="-attributes"]
  ----
  @Bean
  fun authenticator(contextSource: BaseLdapPathContextSource): BindAuthenticator {
      val authenticator = BindAuthenticator(contextSource)
      authenticator.setUserDnPatterns(arrayOf("uid={0},ou=people"))
      return authenticator
  }
  
  @Bean
  fun authenticationProvider(authenticator: LdapAuthenticator): LdapAuthenticationProvider {
      return LdapAuthenticationProvider(authenticator)
  }
  ----
  ====
  
negative.code: [source,kotlin,role="secondary"]
  ----
  @Bean
  fun authenticationManager(contextSource: BaseLdapPathContextSource): AuthenticationManager {
      val factory = LdapPasswordComparisonAuthenticationManagerFactory(
          contextSource, BCryptPasswordEncoder()
      )
      factory.setUserDnPatterns("uid={0},ou=people")
      factory.setPasswordAttribute("pwd") // <1>
      return factory.createAuthenticationManager()
  }
  ----
  ====
  
  <1> Specify the password attribute as `pwd`
  
  == LdapAuthoritiesPopulator
  
  