if (theConsole.getConsole() == null && !howInteractive.equals(Interactiveness.SILENT)) {
throw MESSAGES.noConsoleAvailable();
}
// Username should not be null or empty.
if (user == null || user.isEmpty()) {
nextState = new ErrorState(theConsole, MESSAGES.noUsernameExiting(), null, stateValues);
return;
}
stateValues.setUserName(user);
// Password should not be null or empty.
if (password == null || password.isEmpty()) {
nextState = new ErrorState(theConsole, MESSAGES.noPasswordExiting(), null, stateValues);
return;
}
stateValues.setPassword(password.toCharArray());
stateValues.setRealm(realm);
stateValues.setManagement(management);