extContext.setSubject((Subject) attr); } else { attr = request.getAttribute(PRINCIPAL_KEY);
log.info("{} External authentication succeeded for Principal: {}", getLogPrefix(), extContext.getPrincipal()); extContext.setSubject(new Subject(false, Collections.singleton(extContext.getPrincipal()), Collections.emptySet(), Collections.emptySet())); } else if (extContext.getPrincipalName() != null) { log.info("{} External authentication succeeded for user: {}", getLogPrefix(), extContext.getPrincipalName()); extContext.setSubject(new Subject(false, Collections.singleton(new UsernamePrincipal(extContext.getPrincipalName())), Collections.emptySet(), Collections.emptySet()));