int128 / kubelogin

kubectl plugin for Kubernetes OpenID Connect authentication (kubectl oidc-login)
Apache License 2.0
1.73k stars 194 forks source link

Is it possible to specify browser command? #942

Open petr-buchin opened 1 year ago

petr-buchin commented 1 year ago

Describe the question

My company uses Okta as OIDC provider. I want to configure my WSL 2 Ubuntu distribution to use kubectl oidc-login. The thing is Okta must be opened in a specific work profile in Google Chrome browser. If I don't specify BROWSER env variable in users[].user.exec.env section in my kubeconfig file, the browser authentication flow is opened in my default browser, which is not Chrome. If I specify this variable in kubeconfig - browser is not opened at all. From what I saw in code, there is a BrowserOption struct with BrowserCommand field. Do I understand correctly that there is a way to specify this BrowserCommand?

Your environment

rothgar commented 6 months ago

This should work with --browser-command which you can specify as an option to get-token in your KUBECONFIG file.

leqduyvp commented 2 months ago

I specified a browser command like this in kubeconfig and it's worked

args:
...
- --browser-command=/mnt/c/Program Files/Google/Chrome/Application/chrome.exe