Uploaded image for project: 'XML-RPC'
  1. XML-RPC
  2. XMLRPC-102

Basic username and password don't get sent to the Servlet

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.0rc1
    • Fix Version/s: None
    • Component/s: Source
    • Labels:
      None
    • Environment:
      Tested issue on Ubutu Linux Dapper Drake x86 and OS X 10.4.7 on a MacBook Pro

      Description

      Username and password authentication are not working with the WebServer class. An example is to extend PropertyHandlerMapping.AuthenticationHandler and implement (here is just an example) the following method:

      public boolean isAuthorized(XmlRpcRequest pRequest)
      {
      if (pRequest.getConfig() instanceof RequestData)

      { RequestData data = (RequestData) pRequest.getConfig(); System.out.println("username = "+data.getBasicUserName()); System.out.println("password = "+data.getBasicPassword()); }

      }

      This class is then instantiated and set as the authentication handler in the WebServer's PropertyHandlerMapping when the WebServer is created and started. Then, on the client side, I set the username and password in the configuration as seen below:

      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
      config.setServerUrl("http://127.0.0.1:8080/xmlrpc");
      config.setBasicUserName("adst-test");
      config.setBasicPassword("adst-test#@!");
      XmlRpcClient client = new XmlRpcClient();
      client.setConfig(config);
      Object[] params = new Object[]

      {new Integer(1), new HashMap()}

      ;
      Map result = (Map) client.execute("AssignmentService.getAssignees", params);

      The remote method call executes successfully, however, the System.out statements always reveals the following on the server:

      username = null
      password = null

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jochen@apache.org Jochen Wiedmann
                Reporter:
                dpederson Dave Pederson
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: