title: How to login to RQM using REST API?
body: <p>I'm trying to communicate with IBM Rational Quality Manager server using its <a href="https://sleroyblog.wordpress.com/2013/04/09/querying-rqm-40-through-oslc-and-rest-api/" rel="nofollow">REST API</a>. I'm using RESTClient browser plugin, and while the browser is logged in, everything works as expected. For the record, my requests look like</p>
  
  <pre><code>https://server/qm/service/com.ibm.rqm.integration.service.IIntegrationService/resources/project/testscript/urn:com.ibm.rqm:testscript:42
  </code></pre>
  
  <p>However, if I wait long enough for RQM to logout, REST API says I need to login back to proceed (see below). I'm pretty sure this is possible to do via the API itself, because RQM ships with <a href="http://www-01.ibm.com/support/docview.wss?uid=swg21679142" rel="nofollow">RQMUrlUtility</a> which accepts username and password and runs basically the same REST requests I'm using:</p>
  
  <pre><code>java -jar RQMUrlUtility.jar -command GET -user JazzUserID -password JazzPassword -filepath pathtoFile -url REST_URL
  </code></pre>
  
  <p>So far, I have found <a href="https://jazz.net/forum/questions/105596/rqm-rest-api-for-creating-test-case?redirect=%2Fforum%2Fquestions%2F105596%2Frqm-rest-api-for-creating-test-case" rel="nofollow">this topic</a> explaining how to login using HTTP basic authentication. Following this advice, I have added <code>Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=</code> (not my real password) to the request, but RQM still fails to login. I have also tried setting <code>User-Agent</code> to a bogus value, as well as sending the value from <code>JSESSIONID</code> in <code>X-Jazz-CSRF-Prevent</code> header as described <a href="https://sleroyblog.wordpress.com/2013/04/09/querying-rqm-40-through-oslc-and-rest-api/#PutPostSection" rel="nofollow">here</a>, but regardless of all these headers being present or not, I get the same response:</p>
  
  <pre><code>Status Code: 200 OK
  Cache-Control: no-cache="set-cookie, set-cookie2"
  Connection: Keep-Alive
  Content-Encoding: gzip
  Content-Language: en-US
  Content-Type: text/html; charset=UTF-8
  Date: Tue, 26 Jan 2016 15:48:02 GMT
  Expires: Thu, 01 Dec 1994 16:00:00 GMT
  Keep-Alive: timeout=10, max=100
  Set-Cookie: JazzFormAuth=Form; Path=/qm; Secure
  x-com-ibm-team-scenario=ac55f959-c738-4ef0-854d-6e37648edcba%3Bname%3DInitial+Page+Load%3Bextras%3D%2Fqm%2Fauth%2Fauthrequired%2C1453823282026; Path=/
  Transfer-Encoding: chunked
  X-Powered-By: Servlet/3.0
  X-com-ibm-team-repository-web-auth-msg: authrequired
  </code></pre>
  
  <p>Can anyone with experience with RQM API tell me what's wrong? Or perhaps I'm missing something basic, common to most RESP APIs out there?</p>