Red Hat Bugzilla – Bug 916582
REST API - Omit of prefer header doesn't turn off session based authentication
Last modified: 2016-02-10 14:15:09 EST
Created attachment 703883 [details] requests/responses data including headers When using header 'Prefer': 'persistent-auth' and not passing 'Authorization' header the REST API connection fails on authentication error after some time. Attached the requests/responses data from our basic test scenario. The Authorization header is sent at first request and all further requests use 'Prefer': 'persistent-auth', 'Cookie': 'JSESSIONID=...' headers only. Look for 'status': 401' string to see the first failure.
please provide engine.log
(In reply to comment #0) > Created attachment 703883 [details] > requests/responses data including headers > > When using header 'Prefer': 'persistent-auth' and not passing > 'Authorization' header the REST API connection fails on authentication error > after some time. > > Attached the requests/responses data from our basic test scenario. > The Authorization header is sent at first request and all further requests > use 'Prefer': 'persistent-auth', 'Cookie': 'JSESSIONID=...' headers only. > Look for 'status': 401' string to see the first failure. According to the file you attached, the first 401 failure is one without a "Prefer" header: ++++++REQUEST:++++++++ ===headers===: {'Correlation-Id': 301, 'Cookie': 'JSESSIONID=p++cHE+igVhUiFHlrzlYiq1N; Path=/api; Secure', 'Accept': 'application/xml'} The behavior in such a case should be the request succeeding, but the next request should fail (because not passing the Prefer header here is like saying you would like to close this session). However, a recent change to fix bug 876641, caused it to fail. So, this bug shouldn't block your tests... just make sure you pass the Prefer header on each and every request. I'm changing the title of the bug to: "After creating a REST session, request without the Prefer header return 401".
Elena, There is no issue with the persistent-auth (see Oved's comment 3), only issue we saw is that omit of prefer header doesn't disable the session based auth. as it should (therefore i'm lowering bug severity).
Verified in sf10
This bug is currently attached to errata RHEA-2013:14491. If this change is not to be documented in the text for this errata please either remove it from the errata, set the requires_doc_text flag to minus (-), or leave a "Doc Text" value of "--no tech note required" if you do not have permission to alter the flag. Otherwise to aid in the development of relevant and accurate release documentation, please fill out the "Doc Text" field above with these four (4) pieces of information: * Cause: What actions or circumstances cause this bug to present. * Consequence: What happens when the bug presents. * Fix: What was done to fix the bug. * Result: What now happens when the actions or circumstances above occur. (NB: this is not the same as 'the bug doesn't present anymore') Once filled out, please set the "Doc Type" field to the appropriate value for the type of change made and submit your edits to the bug. For further details on the Cause, Consequence, Fix, Result format please refer to: https://bugzilla.redhat.com/page.cgi?id=fields.html#cf_release_notes Thanks in advance.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2013-0888.html