Refactoring to remove warnings in LDAP module.
This commit is contained in:
parent
c96da98e14
commit
929b6bb1a0
|
@ -50,7 +50,7 @@ import org.apache.commons.logging.LogFactory;
|
||||||
* against an LDAP server.
|
* against an LDAP server.
|
||||||
* <p>
|
* <p>
|
||||||
* There are many ways in which an LDAP directory can be configured so this class delegates most of
|
* There are many ways in which an LDAP directory can be configured so this class delegates most of
|
||||||
* its responsibilites to two separate strategy interfaces, {@link LdapAuthenticator}
|
* its responsibilities to two separate strategy interfaces, {@link LdapAuthenticator}
|
||||||
* and {@link LdapAuthoritiesPopulator}.
|
* and {@link LdapAuthoritiesPopulator}.
|
||||||
*
|
*
|
||||||
* <h3>LdapAuthenticator</h3>
|
* <h3>LdapAuthenticator</h3>
|
||||||
|
@ -237,13 +237,17 @@ public class LdapAuthenticationProvider implements AuthenticationProvider, Messa
|
||||||
final UsernamePasswordAuthenticationToken userToken = (UsernamePasswordAuthenticationToken)authentication;
|
final UsernamePasswordAuthenticationToken userToken = (UsernamePasswordAuthenticationToken)authentication;
|
||||||
|
|
||||||
String username = userToken.getName();
|
String username = userToken.getName();
|
||||||
|
String password = (String) authentication.getCredentials();
|
||||||
|
|
||||||
|
if (logger.isDebugEnabled()) {
|
||||||
|
logger.debug("Processing authentication request for user: " + username);
|
||||||
|
}
|
||||||
|
|
||||||
if (!StringUtils.hasLength(username)) {
|
if (!StringUtils.hasLength(username)) {
|
||||||
throw new BadCredentialsException(messages.getMessage("LdapAuthenticationProvider.emptyUsername",
|
throw new BadCredentialsException(messages.getMessage("LdapAuthenticationProvider.emptyUsername",
|
||||||
"Empty Username"));
|
"Empty Username"));
|
||||||
}
|
}
|
||||||
|
|
||||||
String password = (String) authentication.getCredentials();
|
|
||||||
Assert.notNull(password, "Null password was supplied in authentication token");
|
Assert.notNull(password, "Null password was supplied in authentication token");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -56,6 +56,7 @@ public abstract class AbstractLdapIntegrationTests {
|
||||||
protected AbstractLdapIntegrationTests() {
|
protected AbstractLdapIntegrationTests() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void startServer() throws Exception {
|
public static void startServer() throws Exception {
|
||||||
shutdownRunningServers();
|
shutdownRunningServers();
|
||||||
|
|
Loading…
Reference in New Issue