Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWT Proxy auth procedure doesn't work for non root path #15430

Closed
mmorhun opened this issue Dec 9, 2019 · 2 comments
Closed

JWT Proxy auth procedure doesn't work for non root path #15430

mmorhun opened this issue Dec 9, 2019 · 2 comments
Assignees
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Milestone

Comments

@mmorhun
Copy link
Contributor

mmorhun commented Dec 9, 2019

Describe the bug

When open a secured by JWT Proxy route on non-root path which has cookiesAuthEnabled flag set to true, it fails with Error: Failed to authenticate: "Unknown error"
The error appears constantly, refresh doesn't help.

Che version

nightly

Steps to reproduce

  1. Create an endpoint for a workspace
  2. Start the workspace and get the endpoint route
  3. To the route add some path (to get something like https://routeilbfqo5h-che.192.168.99.106.nip.io/mini-browser/projects/angular-realworld-example-app/logo.png)
  4. Query obtained URL (note, this request should happen before a request with root path)
  5. Page with Error: Failed to authenticate: "Unknown error" message appears.

Expected behavior

Auth cookie is set and page redirected to the expected target.

Screenshots

auth-error

Environment

minishift v1.34.1+c2ff9cb
Che multiuser with TLS (self-signed certificate)

Installation method

chectl

Additional context

When firstly request root path of the route and then any non-root path everything works as expected (as auth cookie is set by first request).

JWT Proxy env
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_3100_TCP_ADDR=172.30.237.56
SERVER2BDSO1KW_NODEJS_SERVICE_HOST=172.30.108.35
CHE_HOST_SERVICE_HOST=172.30.75.123
SERVERG7DR3PLV_JWTPROXY_SERVICE_PORT_SERVER_4400=4400
CHE_HOST_PORT_8080_TCP_ADDR=172.30.75.123
KUBERNETES_SERVICE_PORT=443
PLUGIN_REGISTRY_PORT_8080_TCP_PORT=8080
KUBERNETES_PORT=tcp://172.30.0.1:443
SERVERG7DR3PLV_JWTPROXY_SERVICE_PORT_SERVER_4401=4401
PLUGIN_REGISTRY_PORT_8080_TCP_PROTO=tcp
SERVERG7DR3PLV_JWTPROXY_SERVICE_PORT_SERVER_4402=4402
CHE_HOST_PORT_8080_TCP_PORT=8080
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_3130_TCP_ADDR=172.30.237.56
DEVFILE_REGISTRY_SERVICE_PORT_HTTP=8080
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_3100_TCP_PORT=3100
HOSTNAME=workspace23pk0l9imdbdl6sd.che-jwtproxy-756545586b-5j2nt
CHE_HOST_PORT_8080_TCP_PROTO=tcp
SERVERQRNKXMN4_CHE_MACHINE_EXEC6UB_SERVICE_PORT_SERVER_4444=4444
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_3100_TCP_PROTO=tcp
SERVER2BDSO1KW_NODEJS_SERVICE_PORT_SERVER_3000=3000
PLUGIN_REGISTRY_SERVICE_PORT=8080
PLUGIN_REGISTRY_PORT=tcp://172.30.7.90:8080
SHLVL=2
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_3130_TCP_PORT=3130
HOME=/
SERVER2BDSO1KW_NODEJS_SERVICE_PORT=3000
CHE_HOST_PORT=tcp://172.30.75.123:8080
SERVER2BDSO1KW_NODEJS_PORT=tcp://172.30.108.35:3000
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_3130_TCP_PROTO=tcp
CHE_HOST_SERVICE_PORT=8080
PLUGIN_REGISTRY_PORT_8080_TCP=tcp://172.30.7.90:8080
DEVFILE_REGISTRY_PORT_8080_TCP_ADDR=172.30.206.94
DEVFILE_REGISTRY_SERVICE_HOST=172.30.206.94
SERVER0MJ4AI55_THEIA_IDEA5Z_SERVICE_HOST=172.30.237.56
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_3100_TCP=tcp://172.30.237.56:3100
CHE_HOST_PORT_8080_TCP=tcp://172.30.75.123:8080
DEVFILE_REGISTRY_PORT_8080_TCP_PORT=8080
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13131_TCP_ADDR=172.30.237.56
DEVFILE_REGISTRY_PORT_8080_TCP_PROTO=tcp
POSTGRES_SERVICE_PORT_POSTGRES=5432
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_3130_TCP=tcp://172.30.237.56:3130
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13132_TCP_ADDR=172.30.237.56
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13133_TCP_ADDR=172.30.237.56
DEVFILE_REGISTRY_PORT=tcp://172.30.206.94:8080
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13131_TCP_PORT=13131
DEVFILE_REGISTRY_SERVICE_PORT=8080
KEYCLOAK_SERVICE_PORT_HTTP=8080
TERM=xterm
SERVER0MJ4AI55_THEIA_IDEA5Z_SERVICE_PORT_SERVER_3100=3100
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13131_TCP_PROTO=tcp
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13132_TCP_PORT=13132
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT=tcp://172.30.237.56:3100
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13132_TCP_PROTO=tcp
KUBERNETES_PORT_443_TCP_ADDR=172.30.0.1
SERVER0MJ4AI55_THEIA_IDEA5Z_SERVICE_PORT=3100
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13133_TCP_PORT=13133
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13133_TCP_PROTO=tcp
POSTGRES_PORT_5432_TCP_ADDR=172.30.213.35
SERVER0MJ4AI55_THEIA_IDEA5Z_SERVICE_PORT_SERVER_3130=3130
SERVERG7DR3PLV_JWTPROXY_PORT_4400_TCP_ADDR=172.30.116.204
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
SERVERG7DR3PLV_JWTPROXY_PORT_4401_TCP_ADDR=172.30.116.204
KUBERNETES_PORT_443_TCP_PORT=443
DEVFILE_REGISTRY_PORT_8080_TCP=tcp://172.30.206.94:8080
SERVERG7DR3PLV_JWTPROXY_PORT_4402_TCP_ADDR=172.30.116.204
KUBERNETES_PORT_443_TCP_PROTO=tcp
POSTGRES_SERVICE_HOST=172.30.213.35
POSTGRES_PORT_5432_TCP_PORT=5432
KEYCLOAK_SERVICE_HOST=172.30.254.0
SERVERG7DR3PLV_JWTPROXY_PORT_4400_TCP_PORT=4400
KEYCLOAK_PORT_8080_TCP_ADDR=172.30.254.0
POSTGRES_PORT_5432_TCP_PROTO=tcp
SERVERG7DR3PLV_JWTPROXY_PORT_4400_TCP_PROTO=tcp
SERVERG7DR3PLV_JWTPROXY_PORT_4401_TCP_PORT=4401
SERVERQRNKXMN4_CHE_MACHINE_EXEC6UB_PORT_4444_TCP_ADDR=172.30.189.148
SERVERQRNKXMN4_CHE_MACHINE_EXEC6UB_SERVICE_HOST=172.30.189.148
XDG_CONFIG_HOME=/config/
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13131_TCP=tcp://172.30.237.56:13131
SERVERG7DR3PLV_JWTPROXY_PORT_4401_TCP_PROTO=tcp
SERVER2BDSO1KW_NODEJS_PORT_3000_TCP_ADDR=172.30.108.35
SERVERG7DR3PLV_JWTPROXY_PORT_4402_TCP_PORT=4402
SERVERG7DR3PLV_JWTPROXY_PORT_4402_TCP_PROTO=tcp
KEYCLOAK_PORT_8080_TCP_PORT=8080
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13132_TCP=tcp://172.30.237.56:13132
SERVERQRNKXMN4_CHE_MACHINE_EXEC6UB_PORT_4444_TCP_PORT=4444
KEYCLOAK_PORT_8080_TCP_PROTO=tcp
SERVER0MJ4AI55_THEIA_IDEA5Z_PORT_13133_TCP=tcp://172.30.237.56:13133
SERVERG7DR3PLV_JWTPROXY_SERVICE_HOST=172.30.116.204
SERVERQRNKXMN4_CHE_MACHINE_EXEC6UB_PORT_4444_TCP_PROTO=tcp
SERVER2BDSO1KW_NODEJS_PORT_3000_TCP_PORT=3000
PLUGIN_REGISTRY_SERVICE_PORT_HTTP=8080
POSTGRES_PORT=tcp://172.30.213.35:5432
SERVER2BDSO1KW_NODEJS_PORT_3000_TCP_PROTO=tcp
POSTGRES_SERVICE_PORT=5432
KEYCLOAK_PORT=tcp://172.30.254.0:8080
KUBERNETES_PORT_443_TCP=tcp://172.30.0.1:443
KEYCLOAK_SERVICE_PORT=8080
KUBERNETES_SERVICE_PORT_HTTPS=443
SERVERQRNKXMN4_CHE_MACHINE_EXEC6UB_PORT=tcp://172.30.189.148:4444
SERVER0MJ4AI55_THEIA_IDEA5Z_SERVICE_PORT_SERVER_13131=13131
CHE_HOST_SERVICE_PORT_HTTP=8080
SERVERQRNKXMN4_CHE_MACHINE_EXEC6UB_SERVICE_PORT=4444
SERVERG7DR3PLV_JWTPROXY_PORT_4400_TCP=tcp://172.30.116.204:4400
POSTGRES_PORT_5432_TCP=tcp://172.30.213.35:5432
SERVER0MJ4AI55_THEIA_IDEA5Z_SERVICE_PORT_SERVER_13132=13132
KUBERNETES_SERVICE_HOST=172.30.0.1
PWD=/
SERVER0MJ4AI55_THEIA_IDEA5Z_SERVICE_PORT_SERVER_13133=13133
SERVERG7DR3PLV_JWTPROXY_PORT_4401_TCP=tcp://172.30.116.204:4401
SERVERG7DR3PLV_JWTPROXY_PORT_4402_TCP=tcp://172.30.116.204:4402
KEYCLOAK_PORT_8080_TCP=tcp://172.30.254.0:8080
SERVERG7DR3PLV_JWTPROXY_SERVICE_PORT=4400
SERVERG7DR3PLV_JWTPROXY_PORT=tcp://172.30.116.204:4400
PLUGIN_REGISTRY_PORT_8080_TCP_ADDR=172.30.7.90
SERVERQRNKXMN4_CHE_MACHINE_EXEC6UB_PORT_4444_TCP=tcp://172.30.189.148:4444
PLUGIN_REGISTRY_SERVICE_HOST=172.30.7.90
SERVER2BDSO1KW_NODEJS_PORT_3000_TCP=tcp://172.30.108.35:3000
@mmorhun mmorhun added kind/bug Outline of a bug - must adhere to the bug report template. team/platform labels Dec 9, 2019
@ibuziuk ibuziuk added the severity/P1 Has a major impact to usage or development of the system. label Dec 9, 2019
@skabashnyuk skabashnyuk added this to the Backlog - Platform milestone Dec 10, 2019
@AndrienkoAleksandr
Copy link
Contributor

AndrienkoAleksandr commented Dec 17, 2019

Faced with the similar issue #15497 Cloud shell serve frontend using /some-route/static subpath....

@mshaposhnik
Copy link
Contributor

Fixed in #15530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Outline of a bug - must adhere to the bug report template. severity/P1 Has a major impact to usage or development of the system.
Projects
None yet
Development

No branches or pull requests

5 participants