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())); } else {