kubelogin icon indicating copy to clipboard operation
kubelogin copied to clipboard

Add `--oidc-request-header` flag

Open int128 opened this issue 5 months ago • 1 comments

Resolves https://github.com/int128/kubelogin/issues/1048. Resolves https://github.com/int128/kubelogin/pull/1323.

int128 avatar Jun 16 '25 10:06 int128

Confirmed that this works! Using --oidc-request-header=Origin=localhost and working with EntraID with PKCE

blairdrummond avatar Jun 18 '25 00:06 blairdrummond

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

kub3let avatar Sep 30 '25 13:09 kub3let