log.entering("UnixLoginModule", "login");
if (confError != null) {
throw RB.newLoginException("unixlogin.error.conf", new Object[]{confError});
}
PasswordCallback pwCallback = new PasswordCallback(RB.getString("unixlogin.userprompt"), false);
NameCallback nameCallback = new NameCallback(RB.getString("unixlogin.pwprompt"));
try {
callbackHandler.handle(new Callback[]{nameCallback, pwCallback});
} catch (IOException ex) {
throw RB.newLoginException("unixlogin.error.iocb", ex,
new Object[]{ex.getLocalizedMessage()});
} catch (UnsupportedCallbackException ex) {
throw RB.newLoginException("unixlogin.error.invalidcb", ex,
new Object[]{ex.getLocalizedMessage()});
}
String username = nameCallback.getName();
if (username == null || username.length() == 0) {
loginSucceded = false;
log.exiting("UnixLoginModule", "login", Boolean.FALSE);
return loginSucceded;
}
char[] pw = pwCallback.getPassword();
if (pw == null) {
loginSucceded = false;
log.exiting("UnixLoginModule", "login", Boolean.FALSE);
return loginSucceded;
}