List of usage examples for org.springframework.security.ldap.userdetails LdapUserDetailsMapper setPasswordAttributeName
public void setPasswordAttributeName(String passwordAttributeName)
From source file:au.edu.anu.orcid.security.SecurityConfig.java
@Autowired public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception { Properties properties = PropertyLoader.loadProperties("ldap.properties"); LdapUserDetailsMapper contextMapper = new LdapUserDetailsMapper(); //contextMapper.setRoleAttributes(new String[]{"affiliation"}); contextMapper.setPasswordAttributeName("password"); String ldapUri = properties.getProperty("ldap.uri"); String baseDn = properties.getProperty("ldap.baseDn"); String contextLdapUri = ldapUri + "/" + baseDn; LOGGER.debug("Ldap Url: {}", contextLdapUri); auth.ldapAuthentication().userDnPatterns("uid={0}, ou=People").contextSource().url(contextLdapUri).and() .userDetailsContextMapper(contextMapper); }