GetResponse response = client.prepareGet(authIndex, authType, user)
.setFields(passwordField, rolesField)
.execute().actionGet();
if (response.isExists()) {
Log.debug("user [{}] exists; looking for credentials...", user);
Credential credential = null;
GetField passwordGetField = response.getField(passwordField);
if (passwordGetField != null) {
Log.debug("user [{}] using password auth", user);
credential = Credential.getCredential((String) passwordGetField.getValue());
}