Perform solaris authentication. Delegates to SolarisRealm.
if (!(_currentRealm instanceof SolarisRealm)) {
String msg = sm.getString("solarislm.badrealm");
throw new LoginException(msg);
}
SolarisRealm solarisRealm = (SolarisRealm)_currentRealm;
// A solaris user must have a name not null so check here.
if ( (_username == null) || (_username.length() == 0) ) {
String msg = sm.getString("solarislm.nulluser");
throw new LoginException(msg);
}
String[] grpList = solarisRealm.authenticate(_username, _password);
if (grpList == null) { // JAAS behavior
String msg = sm.getString("solarislm.loginfail", _username);
throw new LoginException(msg);
}
if (_logger.isLoggable(Level.FINEST)) {
_logger.finest("Solaris login succeeded for: " + _username);
}
//make a copy of groupList to pass to LoginModule. This copy is the one
// that will be made null there. DO NOT PASS the grpList as is - as
// it will get overwritten. Resulting in logins passing only once.
String[] groupListToForward = new String[grpList.length];
for (int i = 0; i< grpList.length; i++){
groupListToForward[i] = grpList[i];
}
commitAuthentication(_username, _password,
_currentRealm, groupListToForward);