Bug 1483544 - Authentication error are not helpful - " The redirection URI for client is not registered "
Summary: Authentication error are not helpful - " The redirection URI for client is no...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: ovirt-engine
Classification: oVirt
Component: AAA
Version: 4.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
low
Target Milestone: ovirt-4.3.1
: ---
Assignee: Ravi Nori
QA Contact: Dana
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-08-21 11:28 UTC by Roy Golan
Modified: 2019-03-01 10:21 UTC (History)
8 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-03-01 10:21:29 UTC
oVirt Team: Infra
Embargoed:
aoconnor: ovirt-4.3+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
oVirt gerrit 97771 0 master MERGED aaa: Authentication error are not helpful 2020-02-12 01:47:03 UTC

Description Roy Golan 2017-08-21 11:28:05 UTC
Description of problem:
When using OST you get an engine on isolated network, that in order to make available you must tunnel. When tunnelling you end up with a URI with a odd port or hostname that will result an error while authenticating:

URL: https://localhost:9000/ovirt-engine

This displays this error:

" The redirection URI for client is not registered "


Redirection URI is something internal, which even few developers know off, and no one knows how to get around it, or make it work correctly.

I haven't thought of it deep enough but I have few questions:

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Greg Sheremeta 2017-11-19 19:47:32 UTC
I get the same thing just going to the IP, https://192.168.200.4/ovirt-engine/
It's a very obscure message.

Feel free to consult me for English suggestions, if you'd like.

Comment 2 Greg Sheremeta 2017-11-19 19:58:18 UTC
Workaround (posted by Ravi on ovirt devel list)

Create a new conf file /etc/ovirt-engine/engine.conf.d/99-sso.conf and add:
SSO_CALLBACK_PREFIX_CHECK=false

then
systemctl restart ovirt-engine

This will turn off the additional security check for the callback prefix.

Comment 3 Shirly Radco 2017-12-06 08:00:42 UTC
I tested this and it worked for me.
I think we should add it to the documentation.

Comment 4 Greg Sheremeta 2017-12-06 11:10:21 UTC
(In reply to Shirly Radco from comment #3)
> I tested this and it worked for me.
> I think we should add it to the documentation.

Agreed, and we should update the error message to something more useful.

Comment 5 Michael Burman 2017-12-26 07:21:27 UTC
Had the same issue when deployed HE with cockpit, got the same error when tried to log in to the engine and the work around suggested in comment#2 works for me as well.

Comment 6 Roy Golan 2018-01-05 08:50:05 UTC
(In reply to Greg Sheremeta from comment #2)
> Workaround (posted by Ravi on ovirt devel list)
> 
> Create a new conf file /etc/ovirt-engine/engine.conf.d/99-sso.conf and add:
> SSO_CALLBACK_PREFIX_CHECK=false
> 
> then
> systemctl restart ovirt-engine
> 
> This will turn off the additional security check for the callback prefix.

That workaround will reduce security and I guess this will be for developers and QE. Most users won't do it I guess.

I think we can suggest in the error which URL are registered? I know it is a bit against the 'security by obscurity', but I don't think it is harmful to expose it. Greg what do you think? can you suggest something?

Comment 7 Ravi Nori 2018-01-05 13:56:20 UTC
The callback prefix is a OAuth 2 security measure. It is unique for each client that is registered with SSO. Exposing the callback prefix would sacrifice the security of the entire system, it would be a security hole.

The reason I have not handled this yet is because from OpenID Connect and OAuth 2 point of view the message is perfectly valid.

Comment 8 Greg Sheremeta 2018-01-05 13:59:44 UTC
Agree with Ravi -- can't expose the URLs.

The message is valid to OAuth programmers, but it is completely obscure to normal human users :)

Feel free to consult me for English suggestions, if you'd like. This situation is probably worth a longer-than-usual error message.

Comment 9 Roy Golan 2018-01-11 07:16:02 UTC
(In reply to Greg Sheremeta from comment #8)
> Agree with Ravi -- can't expose the URLs.

The URL is public URL the system is reachable at. It is there in the link of CA certificate which the user can download from the link - there is nothing secret here. Unless there should be more information there I don't know of.

Anyhow some suggestions:
1. Suggest that the only valid URL is what listed in the CA (without the port)
2. if we support it - suggest in the error how to register this new URL? i.e to register the new redirect_uri (what we call internally callback_prefix I think)
3. Just say the URL being used to access the system is invalid and the system is registered under different URL.

> 
> The message is valid to OAuth programmers, but it is completely obscure to
> normal human users :)
> 
> Feel free to consult me for English suggestions, if you'd like. This
> situation is probably worth a longer-than-usual error message.

Comment 10 Greg Sheremeta 2018-01-12 22:22:54 UTC
re-thinking Comment 1

If I access an engine at https://192.168.200.4/ovirt-engine/  but it needs to be accessed via name, why can't it just redirect? what's the security hole there, of giving away a DNS name? (i don't know much about oauth)

Comment 11 michael.mcconachie 2018-01-13 03:44:25 UTC
Don't forget - if the client doesn't have proper fwd/reverse records, and/or the ip changed after the fact (eg: AIO installs do wonky stuff and can change bond0 by the host installer from the UI if the actual host install fails or doens't fully rx the postreceive hook after a success) 

If that host install fails, the host fallsback to the primary interface slave (in my case broke the bond, and disabled it but I could access the host on the slave0 target interface being set to DHCP) before it has a chance to sets the ovirtmgt adapter).

I had that issue tonight, and tested that adding the hostname to the loopback adapter line in /etc/hosts and/or fixing DNS addressed the accessibility issue from the UI.

Comment 12 michael.mcconachie 2018-01-13 03:52:21 UTC
(In reply to michael.mcconachie from comment #11)
> Don't forget - if the client doesn't have proper fwd/reverse records, and/or
> the ip changed after the fact (eg: AIO installs do wonky stuff and can
> change bond0 by the host installer from the UI if the actual host install
> fails or doens't fully rx the postreceive hook after a success) 
> 
> If that host install fails, the host fallsback to the primary interface
> slave (in my case broke the bond, and disabled it but I could access the
> host on the slave0 target interface being set to DHCP) before it has a
> chance to sets the ovirtmgt adapter).
> 
> I had that issue tonight, and tested that adding the hostname to the
> loopback adapter line in /etc/hosts and/or fixing DNS addressed the
> accessibility issue from the UI.

PS: I didn't mean to hijack the thread, being that you are discussing SSO and OATH  in general as it relates to the GUI error message.  Just wanted to point out that I had that message, and it was related to my OP which I hope can shed some evidence of an edge case as well.

Comment 15 Dana 2019-02-24 14:19:49 UTC
verified on 4.3.1

Comment 16 Sandro Bonazzola 2019-03-01 10:21:29 UTC
This bugzilla is included in oVirt 4.3.1 release, published on February 28th 2019.

Since the problem described in this bug report should be
resolved in oVirt 4.3.1 release, it has been closed with a resolution of CURRENT RELEASE.

If the solution does not work for you, please open a new bug report.


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