Package org.springframework.security.config.ldap

# Class LdapPasswordComparisonAuthenticationManagerFactory

java.lang.Object
org.springframework.security.config.ldap.AbstractLdapAuthenticationManagerFactory<org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator>
org.springframework.security.config.ldap.LdapPasswordComparisonAuthenticationManagerFactory

public class LdapPasswordComparisonAuthenticationManagerFactory extends AbstractLdapAuthenticationManagerFactory<org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator>
Creates an `AuthenticationManager` that can perform LDAP authentication using password comparison.

Since:
  5.7

## Constructor Summary

Constructors
Constructor
Description
`LdapPasswordComparisonAuthenticationManagerFactory(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)`

## Method Summary

Modifier and Type
Method
Description
`protected org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator`
`createDefaultLdapAuthenticator()`
Allows subclasses to supply the default `AbstractLdapAuthenticator`.
`void`
`setPasswordAttribute(String passwordAttribute)`
The attribute in the directory which contains the user password.
`void`
`setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)`
Specifies the `PasswordEncoder` to be used when authenticating with password comparison.

### Methods inherited from class org.springframework.security.config.ldap.AbstractLdapAuthenticationManagerFactory

`createAuthenticationManager, getContextSource, setAuthoritiesMapper, setContextSource, setLdapAuthoritiesPopulator, setUserDetailsContextMapper, setUserDnPatterns, setUserSearchBase, setUserSearchFilter`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LdapPasswordComparisonAuthenticationManagerFactory

public LdapPasswordComparisonAuthenticationManagerFactory(org.springframework.ldap.core.support.BaseLdapPathContextSource contextSource, org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)

## Method Details

### setPasswordEncoder

public void setPasswordEncoder(org.springframework.security.crypto.password.PasswordEncoder passwordEncoder)
Specifies the `PasswordEncoder` to be used when authenticating with password comparison.

Parameters:
  `passwordEncoder` - the `PasswordEncoder` to use

### setPasswordAttribute

public void setPasswordAttribute(String passwordAttribute)
The attribute in the directory which contains the user password. Only used when authenticating with password comparison. Defaults to "userPassword".

Parameters:
  `passwordAttribute` - the attribute in the directory which contains the user password

### createDefaultLdapAuthenticator

protected org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator createDefaultLdapAuthenticator()
Description copied from class: `AbstractLdapAuthenticationManagerFactory`
Allows subclasses to supply the default `AbstractLdapAuthenticator`.

Specified by:
  `createDefaultLdapAuthenticator` in class `AbstractLdapAuthenticationManagerFactory<org.springframework.security.ldap.authentication.PasswordComparisonAuthenticator>`
Returns:
  the `AbstractLdapAuthenticator` that will be configured for LDAP authentication