Bug 1346256

Summary: two times authentication are required when connecting to vm by ovirt uri
Product: Red Hat Enterprise Linux 7 Reporter: Xiaodai Wang <xiaodwan>
Component: libgovirtAssignee: Christophe Fergeau <cfergeau>
Status: CLOSED ERRATA QA Contact: SPICE QE bug list <spice-qe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.3CC: cfergeau, dblechte, juzhou, mxie, mzhan, rbalakri, rduda, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: libgovirt-0.3.3-3.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1346261 (view as bug list) Environment:
Last Closed: 2016-11-04 01:21:39 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1346261    

Description Xiaodai Wang 2016-06-14 11:27:30 UTC
Description of problem:
two times authentication are required when connecting to vm by ovirt uri

Version-Release number of selected component (if applicable):
libgovirt-0.3.3-2.el7.x86_64
virt-viewer-2.0-8.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a running vm in ovirt 3.6.
2. Got the ca file from ovirt 3.6.
$ wget http://rhevm3.6-hp-dl360eg8-03/ca.crt
3. Connect the vm by remote-viewer with ovirt uri.
$ remote-viewer --ovirt-ca-file=ca.crt ovirt://rhevm3.6-hp-dl360eg8-03/$your_vm
4. An authentication dialog pops up, then type correct username and password and click OK.

Actual results:
an authentication dialog pops up again.

Expected results:
The second authentication is not necessary.

Additional info:
1) when the second authentication dialog pops up, click cancel button to cancel it directly, foreign menu can display correctly.
2) when the second authentication dialog pops up, type wrong password, then click OK, after authentication failed then click cancel button to cancel it, foreign menu can't display correctly.

Comment 1 Christophe Fergeau 2016-06-14 11:40:28 UTC
This is a regression introduced by the sso-token support patches, namely https://git.gnome.org/browse/libgovirt/commit/?id=d3683c20e62d889e187406b3fa3fe75e00df228d

The whole commit can probably be reverted without any bad side-effect for now. More work seems to be needed for proper RHEV 4.0 support anyway.

Comment 2 Christophe Fergeau 2016-06-14 11:48:49 UTC
The same issue is present in the zstream build made for bug #1344633

Comment 3 Christophe Fergeau 2016-06-14 12:03:37 UTC
(In reply to Christophe Fergeau from comment #1)

> The whole commit can probably be reverted without any bad side-effect for
> now. More work seems to be needed for proper RHEV 4.0 support anyway.

@@ -815,6 +812,7 @@ static void ovirt_proxy_set_sso_token(OvirtProxy *proxy, const char *sso_token)
     g_free(proxy->priv->sso_token);
     proxy->priv->sso_token = g_strdup(sso_token);

+    ovirt_proxy_add_header(proxy, "Prefer", NULL);
     header_value = g_strdup_printf("Bearer %s", sso_token);
     ovirt_proxy_add_header(proxy, "Authorization", header_value);
     g_free(header_value);


would probably be nice to have if the commit is reverted.

Comment 4 Christophe Fergeau 2016-06-14 13:28:21 UTC
https://git.gnome.org/browse/libgovirt/commit/?id=821c4c96edaeca300146137067533f86d6e0b065 upstream commit which should fix acceptably this problem. More work is needed in libgovirt upstream for persistent auth against rhev 4.0. The current way should work, but the recommended way is oAuth2 (I think).

Comment 6 Christophe Fergeau 2016-06-14 15:37:29 UTC
qa_ack+ was lost when I moved this bug, can I get it back?

Comment 7 tingting zheng 2016-06-15 03:11:47 UTC
(In reply to Christophe Fergeau from comment #1)
> This is a regression introduced by the sso-token support patches, namely
> https://git.gnome.org/browse/libgovirt/commit/
> ?id=d3683c20e62d889e187406b3fa3fe75e00df228d
> 
> The whole commit can probably be reverted without any bad side-effect for
> now. More work seems to be needed for proper RHEV 4.0 support anyway.

Does the commit affect zstream virt-viewer bug 1344635? If so,it needs a new build,thanks.

Comment 8 Christophe Fergeau 2016-06-15 08:09:07 UTC
(In reply to tingting zheng from comment #7)
> (In reply to Christophe Fergeau from comment #1)
> > This is a regression introduced by the sso-token support patches, namely
> > https://git.gnome.org/browse/libgovirt/commit/
> > ?id=d3683c20e62d889e187406b3fa3fe75e00df228d
> > 
> > The whole commit can probably be reverted without any bad side-effect for
> > now. More work seems to be needed for proper RHEV 4.0 support anyway.
> 
> Does the commit affect zstream virt-viewer bug 1344635? If so,it needs a new
> build,thanks.

Already done, https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=499139

Comment 12 errata-xmlrpc 2016-11-04 01:21:39 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.

https://rhn.redhat.com/errata/RHBA-2016-2229.html