request.setRoles(roles);
}
@Override
public boolean isValid(final AuthenticationRequest request) {
final AuthenticationRequestPassword passwordRequest = (AuthenticationRequestPassword) request;
final String username = passwordRequest.getName();
Assert.assertNotNull(username);
if (username.equals("")) {
LOG.debug("empty username");
return false; // failed authentication
}
final String password = passwordRequest.getPassword();
Assert.assertNotNull(password);
final Hashtable<String, String> env = new Hashtable<String, String>(4);
env.put(Context.INITIAL_CONTEXT_FACTORY, LdapAuthenticationConstants.SERVER_DEFAULT);
env.put(Context.PROVIDER_URL, ldapProvider);