code: public String getUserName(Subject subject) {
  		// Subject subject = null;
  		try {
  			// subject = WSSubject.getRunAsSubject();
  			WSCredential wsCred = getWSCredential(subject);
  			if (wsCred == null) {
  				wsCred = getPrivateWSCredential(subject);
  			}
  			return wsCred != null ? wsCred.getSecurityName() : null;
  		} catch (Exception e) {
  			// ffdc
  			return null;
  		}
  	}
docs: get the username from the WSSubject
  
  @return the user name, UNAUTHENTICATED, or null if something went wrong.