SignetSubject loggedInUser = signet.getSubjectByIdentifier(username);
SignetSubject loggedInUser = signet.getSubjectByUsage(SignetSources.SIGNET_USAGE_LOGIN, username);
  public ActionForward   execute    (ActionMapping       mapping,     ActionForm          form,     HttpServletRequest  request,     HttpServletResponse response)  throws Exception  {    // Setup message array in case there are errors    ArrayList messages = new ArrayList();    // Confirm message resources loaded    MessageResources resources = getResources(request);    if (resources==null)    {      messages.add(Constants.ERROR_MESSAGES_NOT_LOADED);    }    // If there were errors, forward to our failure page    if (messages.size()>0)    {      request.setAttribute(Constants.ERROR_KEY,messages);      return findFailure(mapping);    }    HttpSession session = request.getSession();    Signet signet = (Signet)(session.getAttribute("signet"));        if (signet == null)    {      return (mapping.findForward("notInitialized"));    }        String username      = request.getParameter(Constants.DEMO_USERNAME_HTTPPARAMNAME);    String password      = request.getParameter(Constants.DEMO_PASSWORD_HTTPPARAMNAME);        // This simple demo-authentication system uses one password for all    // users. If it's not right, there's no need to go further.    if (!(Constants.DEMO_PASSWORD.equals(password)))    {      return (mapping.findForward("failure"));    }        // Let's look up the username. If it exists, we've got our user.    //    Set userMatches = signet.getSubjectSources().getPrivilegedSubjectsByDisplayId(//    		Signet.DEFAULT_SUBJECT_TYPE_ID, username);//    //    if (userMatches.size() != 1)//    {//        messages.add//      ("Found " //          + userMatches.size()//          + " matches for logged-in user with display-ID '"//          + request.getRemoteUser()//          + "'. We don't know what to do with any number other than one.");//      messages.add("All matches:");//      Iterator userMatchesIterator = userMatches.iterator();//      while (userMatchesIterator.hasNext())//      {//        messages.add//        (((PrivilegedSubject)(userMatchesIterator.next())).toString());//      }//      request.setAttribute(Constants.ERROR_KEY, messages);//      //      return findFailure(mapping);//    }        SignetSubject loggedInUser = signet.getSubjectByIdentifier(username);	if (null == loggedInUser)		return (findFailure(mapping));//    Iterator pSubjectsIterator = userMatches.iterator();//    while (pSubjectsIterator.hasNext())//    {//      loggedInUser = (PrivilegedSubject)(pSubjectsIterator.next());//    }    session.setAttribute(Constants.LOGGEDINUSER_ATTRNAME, loggedInUser);        // Forward to our success page, which is the Signet main page.    return findSuccess(mapping);  }