November 2017
Intermediate to advanced
542 pages
14h 24m
English
Next, we'll need to configure another AuthenticationProvider interface that checks user credentials against the LDAP provider. Simply update the Spring Security configuration to use an o.s.s.ldap.authentication.LdapAuthenticationProvider reference, as follows:
//src/main/java/com/packtpub/springsecurity/configuration/SecurityConfig.java @Override public void configure(AuthenticationManagerBuilder auth) throws Exception { auth .ldapAuthentication() .userSearchBase("") .userSearchFilter("(uid={0})") .groupSearchBase("ou=Groups") .groupSearchFilter("(uniqueMember={0})") .contextSource(contextSource()) .passwordCompare() .passwordAttribute("userPassword"); } @Bean public DefaultSpringSecurityContextSource ...Read now
Unlock full access