code: public void setCredentials(String userid, String password) {
          Map<String, String> data = new HashMap<String, String>();
          data.put("userid", userid);
          data.put("password", password);
          RemotingHeader header = new RemotingHeader(RemotingHeader.CREDENTIALS, true, data);
          headers.put(RemotingHeader.CREDENTIALS, header);
      }
docs: Send authentication data with each remoting request.
  
  @param userid
  User identifier
  @param password
  Password