I'm trying to implement LDAP authentication with Spring Security 4 and Java config. What is the equivalent of this XML in Java config:
<ldap-authentication-provider>
<password-compare hash="{ssha}"/>
</ldap-authentication-provider>
@Configuration
@EnableWebSecurity
public class PasswordCompareLdapConfig extends WebSecurityConfigurerAdapter {
protected void registerAuthentication(
AuthenticationManagerBuilder auth) throws Exception {
auth
.ldapAuthentication()
.passwordCompare()
.passwordEncoder(new BaseDigestPasswordEncoder())
.passwordAttribute("userPassword");
}
}