Uploaded image for project: 'Cactus'
  1. Cactus
  2. CACTUS-130

Cookies aren't included on the second HTTP connection to retrieve the test results

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.6.1
    • None
    • Framework
    • None
    • WebSphere 5.0.2, IHS web server, WSAD 5.1.1

    Description

      Our environment requires a cookie in order to authenticate to WebSphere (using a TrustedInterceptor and Custom Registry). I add the cookie to the WebRequest in the begin() method. This performs valid authentication on WebSphere and through J2EE security allows the testxxx() method to be executed.

      However, when the second HTTP connection is opened in order to retrieve the test results, authentication fails in WebSphere. I believe this is due to the fact that the cookie isn't present on the second request. Can you confirm this?

      Here is the code that is executed in the begin() method:

      private void authenticate(WebRequest request)
      throws ResourceException {

      String METHOD_NAME = "authenticate";
      String logmsg = "*** ENTER " + METHOD_NAME;
      log.logp(Level.INFO, CLASS_NAME, METHOD_NAME, logmsg);

      String authType = System.getProperty("unittest.auth.type");

      if (authType != null) {

      if (authType.equals("basic")) {
      // Authentication used for desktop testing - basic
      String userid = System.getProperty("unittest.userid");
      String password = System.getProperty("unittest.password");
      if (userid != null && password != null)

      { request.setAuthentication( new BasicAuthentication(userid, password)); }

      else

      { String msg = "unittest.userid or unittest.password System property NOT found for unitest.auth.type=basic"; throw new FordResourceException(msg); }

      } else if (authType.equals("cookie")) {
      // Authentication used for WAS deployed environment testing - cookie
      String cookie = System.getProperty("unittest.auth.cookie");
      String domain =
      System.getProperty("unittest.domain");
      if (cookie != null)

      { request.addCookie(domain, "Auth-Cookie", cookie); }

      else

      { String msg = "unittest.auth.cookie System property NOT found for unitest.auth.type=cookie"; throw new FordResourceException(msg); }

      } else

      { StringBuffer msg = new StringBuffer(); msg.append("Invalid value ["); msg.append(authType); msg.append("] found for System property unittest.auth.type"); throw new FordResourceException(msg.toString()); }

      }

      logmsg = "*** EXIT " + METHOD_NAME;
      log.logp(Level.INFO, CLASS_NAME, METHOD_NAME, logmsg);
      }

      Attachments

        1. cactus_stacktrace.txt
          4 kB
          Julie Burnard

        Activity

          People

            Unassigned Unassigned
            jburnard Julie Burnard
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: