code: @Override
      public void setCredential(Subject subject) throws CredentialException {
          Set<WSPrincipal> principals = subject.getPrincipals(WSPrincipal.class);
          if (principals.isEmpty()) {
              return;
          }
          if (principals.size() != 1) {
              throw new CredentialException("Too many WSPrincipals in the subject");
          }
          WSPrincipal principal = principals.iterator().next();
          CredentialsService cs = credentialsServiceRef.getService();
          String unauthenticatedUserid = cs.getUnauthenticatedUserid();
          if (principal.getName() != null && unauthenticatedUserid != null &&
              principal.getName().equals(unauthenticatedUserid)) {
              return;
          }
          setSsoTokenCredential(subject, principal.getAccessId());
      }
docs: {@inheritDoc}