Deprecate single-arg PasswordComparisonAuthenticator ctor
Add new constructor accepting PasswordEncoder to eventually remove deprecated LdapShaPasswordEncoder usage. Closes gh-18430 Signed-off-by: LeeJiWon <dlwldnjs1009@gmail.com>
This commit is contained in:
+14
-1
@@ -52,14 +52,27 @@ public final class PasswordComparisonAuthenticator extends AbstractLdapAuthentic
|
|||||||
|
|
||||||
private static final Log logger = LogFactory.getLog(PasswordComparisonAuthenticator.class);
|
private static final Log logger = LogFactory.getLog(PasswordComparisonAuthenticator.class);
|
||||||
|
|
||||||
private PasswordEncoder passwordEncoder = new LdapShaPasswordEncoder(KeyGenerators.shared(0));
|
private PasswordEncoder passwordEncoder;
|
||||||
|
|
||||||
private String passwordAttributeName = "userPassword";
|
private String passwordAttributeName = "userPassword";
|
||||||
|
|
||||||
private boolean usePasswordAttrCompare = false;
|
private boolean usePasswordAttrCompare = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use
|
||||||
|
* {@link #PasswordComparisonAuthenticator(BaseLdapPathContextSource, PasswordEncoder)}
|
||||||
|
* instead
|
||||||
|
*/
|
||||||
|
@Deprecated(since = "7.1")
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public PasswordComparisonAuthenticator(BaseLdapPathContextSource contextSource) {
|
public PasswordComparisonAuthenticator(BaseLdapPathContextSource contextSource) {
|
||||||
|
this(contextSource, new LdapShaPasswordEncoder(KeyGenerators.shared(0)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public PasswordComparisonAuthenticator(BaseLdapPathContextSource contextSource, PasswordEncoder passwordEncoder) {
|
||||||
super(contextSource);
|
super(contextSource);
|
||||||
|
Assert.notNull(passwordEncoder, "passwordEncoder must not be null");
|
||||||
|
this.passwordEncoder = passwordEncoder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
@@ -35,6 +35,7 @@ import static org.mockito.Mockito.mock;
|
|||||||
/**
|
/**
|
||||||
* @author Luke Taylor
|
* @author Luke Taylor
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
public class PasswordComparisonAuthenticatorMockTests {
|
public class PasswordComparisonAuthenticatorMockTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user