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

Change default oidc-login port 8000 to avoid browser cache conflict #1113

Open
robinovitch61 opened this issue Aug 3, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@robinovitch61
Copy link

Describe the issue

kubectl oidc-login get-token -h | grep listen-address
      --listen-address strings                          [authcode] Address to bind to the local server. If multiple addresses are set, it will try binding in order (default [127.0.0.1:8000,127.0.0.1:18000])

Since default is 127.0.0.1:8000, this could (and did for me) collide with my browser's cache. I had recently run this command:

docker run --platform linux/amd64 --publish 8000:8080 ghcr.io/mermaid-js/mermaid-live-editor

and my browser cached the mermaid editor rather than hitting the webserver for login. I'd request the default be changed to something other than 8000 to avoid future occurrences for others.

To reproduce

  • run kubectl oidc-login get-token --force-refresh --oidc-issuer-url=...
  • have browser open, but http://localhost:8000 is cached as something else, so oidc web server never hit and console hangs

Your environment

  • OS: macOS
  • kubelogin version: e.g.v1.28.0
  • kubectl version: e.g. v1.29.5
@robinovitch61 robinovitch61 added the bug Something isn't working label Aug 3, 2024
@porty
Copy link

porty commented Aug 29, 2024

There might be a different issue at play - binding to / listening on 127.0.0.1:8000 can succeed even if something else has taken :8000 (i.e. a wildcard IP, which includes IPv6) - this is totally fine, but there is inconsistency with the bind IP of 127.0.0.1 and opening the browser to localhost which can be a different IP address (possibly depending on OS or ordering in /etc/hosts) - a fix would be to open a browser on 127.0.0.1:$PORT instead of localhost:$PORT.

I worked around the issue by changing localhost:8000 in my browser (which was some other Docker-based app) to 127.0.0.1:8000 (and again after the redirect back)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants