Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 916582

Summary: REST API - Omit of prefer header doesn't turn off session based authentication
Product: Red Hat Enterprise Virtualization Manager Reporter: Elena <edolinin>
Component: ovirt-engine-restapiAssignee: Oved Ourfali <oourfali>
Status: CLOSED ERRATA QA Contact: Elena <edolinin>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 3.2.0CC: acathrow, dyasny, iheim, mpastern, oramraz, Rhev-m-bugs, srevivo, ykaul
Target Milestone: ---Keywords: Regression
Target Release: 3.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: sf10 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-06-10 21:34:38 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
requests/responses data including headers none

Description Elena 2013-02-28 11:49:36 UTC
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 11:53:35 UTC
please provide engine.log

Comment 3 Oved Ourfali 2013-02-28 12:12:07 UTC
(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 08:47:20 UTC
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 17:41:46 UTC
Verified in sf10

Comment 6 Cheryn Tan 2013-04-03 06:52:46 UTC
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 21:34:38 UTC
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