Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 916582 - REST API - Omit of prefer header doesn't turn off session based authentication
REST API - Omit of prefer header doesn't turn off session based authentication
Status: CLOSED ERRATA
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-restapi (Show other bugs)
3.2.0
Unspecified Unspecified
unspecified Severity medium
: ---
: 3.2.0
Assigned To: Oved Ourfali
Elena
infra
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-28 06:49 EST by Elena
Modified: 2016-02-10 14:15 EST (History)
8 users (show)

See Also:
Fixed In Version: sf10
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-10 17:34:38 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
requests/responses data including headers (1.56 MB, text/plain)
2013-02-28 06:49 EST, Elena
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 12522 None None None Never
oVirt gerrit 12588 None None None Never
Red Hat Product Errata RHSA-2013:0888 normal SHIPPED_LIVE Moderate: Red Hat Enterprise Virtualization Manager 3.2 update 2013-06-10 20:55:41 EDT

  None (edit)
Description Elena 2013-02-28 06:49:36 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.
Comment 1 Michael Pasternak 2013-02-28 06:53:35 EST
please provide engine.log
Comment 3 Oved Ourfali 2013-02-28 07:12:07 EST
(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".
Comment 4 Michael Pasternak 2013-03-03 03:47:20 EST
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).
Comment 5 Elena 2013-03-13 13:41:46 EDT
Verified in sf10
Comment 6 Cheryn Tan 2013-04-03 02:52:46 EDT
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.
Comment 7 errata-xmlrpc 2013-06-10 17:34:38 EDT
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

Note You need to log in before you can comment on or make changes to this bug.