-// if (ldapUserDetailsService == null) {
-// ldapUserDetailsService = new LdapUserDetailsService(null,
-// authoritiesPopulator);
-// ldapUserDetailsService.setUserDetailsMapper(userDetailsMapper);
-// }
+ if (ldapUserDetailsService == null) {
+ FilterBasedLdapUserSearch ldapUserSearch = new FilterBasedLdapUserSearch(
+ userBase, "(" + usernameAttributeName + "={0})",
+ contextSource);
+ ldapUserDetailsService = new LdapUserDetailsService(ldapUserSearch,
+ authoritiesPopulator);
+ ldapUserDetailsService.setUserDetailsMapper(userDetailsMapper);
+ }