spinnaker: [Gate]: Redirect URL after login is not correct if not terminating SSL at the server
Title
[Gate]: Redirect URL after login is not correct if not terminating SSL at the server
Cloud Provider
All?
Environment
AWS
Feature Area
Authentication - Google
Description
Related to #390
The above PR fixed one issue related to this, but there is one more area that is affected.
Backstory:
If terminating SSL at a Load Balancer (ELB), Gate was not sending back the correct /login URL. Using preEstablishedRedirectUri had no affect on the endpoint /auth/redirect would redirect to. Now that the /login endpoint is correct, once you’ve authenticated with Google, the /auth/redirect URL is incorrect. Refreshing the page will get you in, but the clean flow from Spinnaker -> Google -> Spinnaker is broken.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 26 (7 by maintainers)
Commits related to this issue
- fix(authn/oauth2): prevent oauth2 redirect loops During setup of spinnaker authentication with oauth2 a common hurdle is a redirect loop. For example: https://github.com/spinnaker/spinnaker/issues/... — committed to chris-h-phillips/gate by chris-h-phillips 2 years ago
- fix(authn/oauth2): prevent oauth2 redirect loops (#1517) During setup of spinnaker authentication with oauth2 a common hurdle is a redirect loop. For example: https://github.com/spinnaker/spinnaker... — committed to spinnaker/gate by chris-h-phillips 2 years ago
- Fix upstream conflict (#187) * fix(oauth): remove circular dependency on ExternalAuthTokenFilter bean in OAuth2SsoConfig when oauth2 is enabled (#1492) Previously in spring 2.2.5, if oauth2 is ena... — committed to OpsMx/gate by singh09iet 2 years ago
Hi! I’m a colleague of @vide . We found out how to fix this. This works for us:
The proxy has to set
X-Forwarded-Portheader, otherwise you should hardcode the original port.We figure this out reading Tomcat’s documentation, here.
Hi there,
attaching to this issue as it seems related. I was not able to configure gate/deck behind a reverse proxy terminating TLS and appending a custom URI; the redirection to login service happens correctly, but then the actual login POST does not include the additional URI path.
Spinnaker version: 1.16.0
Configuration bits:
Logs from the httpd reverse proxy when landing on authentication page:
The problem I see is that the
POST /loginshould have beenPOST /spinnaker-api/login. Any idea where this is handled or if it is configurable? Thanks for you helpI think that’s a good idea.
On Fri, Jan 18, 2019, 9:44 AM Ethan Rogers <notifications@github.com wrote:
For those who uses Spinnaker deployment via helm (or directly hal) with istio gateway in version < 1.1.0 :
There is problem with
X-Forwarded-Protowhen terminating SSL on ELB: https://github.com/istio/istio/issues/7964Workaround is bellow:
helm value.yaml file changes (or gate-local.yml file):
For the virtual file to expose gate externally - keep in mind that domains for gate and deck (dashboard) should be different:
There is an option to use istio filters to replace headers but I didn’t try this out.
For istio version >= 1.1.0 there is a possibility to remove and add the headers
I just installed Spinnaker 1.9.0 and found this issue is gone. Also tried 1.8.5 and the issue is still there.
Wondering what changes have merged into 1.9.0 but I am happy to see it is gone and will migrate to 1.9.0 version.
@vide I tried your approach, but it does not resolve my issue. do you mean put followings into ~/.hal/default/profiles/gate-local.yml and redeploy spinnaker?
my case is that SSL terminates at ingress controller (traefik) and I also tried nodePort (SSL terminates at deck and gate), the URL redirect always works for chrome, but does not work for firefox.