kubelogin
kubelogin copied to clipboard
Add `--oidc-request-header` flag
Resolves https://github.com/int128/kubelogin/issues/1048. Resolves https://github.com/int128/kubelogin/pull/1323.
Confirmed that this works! Using --oidc-request-header=Origin=localhost and working with EntraID with PKCE
Using kubectl oidc-login setup generates a wrong example command e.g. it renders --exec-arg="--oidc-request-header=[Origin=http://localhost:8000]" instead of --exec-arg="--oidc-request-header=Origin=http://localhost:8000" which works.
using the generated header with brackets gives the following error:
k get nodes
error: get-token: authentication error: oidc error: oidc discovery error: Get "https://login.microsoftonline.com/xxx/v2.0/.well-known/openid-configuration": net/http: invalid header field name "[Origin"
Unable to connect to the server: getting credentials: exec: executable kubectl failed with exit code 1