"Container Auth: ServerAuthContext.validateRequest");
}
Subject subject = null;
boolean firstAuthentication = true;
SecurityContext sc = SecurityContext.getCurrent();
if (sc == null || sc.didServerGenerateCredentials()) {
subject = new Subject();
} else {
subject = sc.getSubject();
firstAuthentication = false;
}
sAC.validateRequest((AuthParam)param, subject, sharedState);
if (rvalue && firstAuthentication) {
Set principalSet = subject.getPrincipals();
// must be at least one new principal to establish
// non-default security contex
if (principalSet != null && !principalSet.isEmpty()) {
// define and add initiator to Subject - note that this may add
// a second principal (of type PrincipalImpl) for initiator.
String initiator = ((Principal)principalSet.iterator().next()).
getName();
SecurityContext newSC = new SecurityContext(initiator,subject);
SecurityContext.setCurrent(newSC);
}
}
return rvalue;