final Principal[] mappedPrincipals = this.mapUsers(principals);
if (this.isTrusted(principals, host, messagedirection)) {
final AssertedPrincipalInfo ap = new AssertedPrincipalInfo(mappedPrincipals[0].getName(), pAssrtValues, id, true);
final AssertedCredentials creds = new AssertedCredentials(realmName,
mappedPrincipals[0].getName(), ap);
Principal p = (Principal) AppservAccessController.doPrivileged(new PrivilegedAction() {
public java.lang.Object run() {
try {
LoginContextDriver.login(creds);
SecurityContext secCtx = SecurityContext.getCurrent();
secCtx.getSubject().getPrivateCredentials().add(ap);
return new WebPrincipal(creds.getUserName(), null, secCtx);
} catch (LoginException ex) {
securityLogger.log(Level.SEVERE, "P-Asserted Authentication failed", ex);
throw new SecurityException("P-Asserted Authentication failed");
}
}