Bug 1520689 - SSO utilizes hostname instead of masterPublicURL
Summary: SSO utilizes hostname instead of masterPublicURL
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: apiserver-auth
Version: 3.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Matt Rogers
QA Contact: Chuan Yu
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-12-04 23:41 UTC by Magnus Glantz
Modified: 2018-01-16 10:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-01-16 10:16:20 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
master-config from cluster (6.18 KB, text/plain)
2017-12-04 23:41 UTC, Magnus Glantz
no flags Details

Description Magnus Glantz 2017-12-04 23:41:45 UTC
Created attachment 1362863 [details]
master-config from cluster

Description of problem:

Having setup OCP 3.7, SSO utilizes the hostname of the master instead of masterPublicURL. If an external load balancer pointed at my masterPublicURL, SSO does not work.

Version-Release number of selected component (if applicable):
OCP 3.7 latest as of this writing.

How reproducible:
100%

Steps to Reproduce:
1. Install OCP 3.7 single master, set masterPublicURL to external load balancer which forwards traffic to master. 
2. Goto Kibana or something which uses SSO. Login, and see how you got redirected to your masters hostname and not masterPublicURL. If you change the hostname to the correct one, things works.

Actual results:
Redirect for SSO goes to your masters hostname and not masterPublicURL.

Expected results:
Redirect for SSO to masterPublicURL

Additional info:

Comment 3 Simo Sorce 2017-12-05 13:49:35 UTC
Does it work if you start the master passing the public url with --public-master flag ?

Comment 4 Matt Rogers 2017-12-05 16:54:21 UTC
Is there a localized reproducer for this, i.e. demonstrable in some way with 'oc cluster up'? I tried passing --public-hostname='localmaster' to 'oc cluster up' with 'localmaster' being an extra /etc/hosts entry. Then I tried a jenkins login, which redirected me to the 'localmaster' address. 

Do you see any difference with a Jenkins login vs. Kibana?

Comment 5 Magnus Glantz 2017-12-05 23:09:06 UTC
Hey guys, I don't have a localized reproducer I'm afraid.
I'll check regarding Jenkins tomorrow. If we can sync this somehow, I can install a cluster and provide you with SSH/root/cluster-admin access. Only issue is that I can't really keep the cluster up more than 2 days (due to cost). Would that work? I just need your public SSH keys to set it up. E-mail me if it works for you and let me know when you need the cluster up.

Comment 6 Magnus Glantz 2017-12-05 23:10:31 UTC
Should this be a real issue, it would be very troublesome, as it would mean that SSO wouldn't work properly for people with load balancer infront of their masters (including all HA and most cloud installs)

Comment 7 Matt Rogers 2017-12-14 20:57:26 UTC
Hi Magnus, were you able to note any difference with Jenkins? I sent an email about syncing up with your reproducer but had not heard back. In the meanwhile I have a few questions about the setup that may give us more clues.

In your cluster does Kibana use oauth-proxy? If so, oauth-proxy checks the master at /.well-known/oauth-authorization-server in order to discover the oauth endpoints. I checked the behavior of setting masterPublicURL and it propagated to this discovery information like I would expect. If you check your master for /.well-known/oauth-authorization-server when it's not working do you see the the wrong URL? Do you have the config for the Kibana deployment that we can look at (to verify oauth-proxy container arguments if any)?

Comment 8 Matt Rogers 2018-01-11 13:15:32 UTC
Closing this for now.. Please reopen if you run into the issue again or can provide some additional info.

Comment 9 Magnus Glantz 2018-01-16 09:54:25 UTC
Sorry for the delay. No, actually, Jenkins is OK.
It's just Kibana which redirects in a faulty manner.. that is weird.
I've e-mail login credentials to the cluster.

Comment 10 Magnus Glantz 2018-01-16 10:16:20 UTC
I have identified something wrong with fluentd (pod failures). Not sure what it is at this point, but that means it's not auth related. I'm closing this bug.


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