Skip to content

Add the auth get-token command for kubeconfigs naming the Rancher user - #698

Open
pmatseykanets wants to merge 1 commit into
rancher:mainfrom
pmatseykanets:cli-auth-get-token
Open

pmatseykanets wants to merge 1 commit into
rancher:mainfrom
pmatseykanets:cli-auth-get-token

Conversation

@pmatseykanets

@pmatseykanets pmatseykanets commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Issue: rancher/rancher#57716

Problem

Rancher is adding a kubeconfig form whose exec entry runs rancher auth get-token --server <url> --cluster <id> --user-id <user id> --auth-provider <provider>. The CLI had no auth get-token command, and kubectl failed on every such kubeconfig. The --auth-provider value Rancher writes is the provider's name, such as local, which the CLI matched only against provider types.

Solution

Added rancher auth get-token. It signs in and caches the credential the same way as rancher token, with the user id in the cache key in place of the kubeconfig entry name, and it offers no default at the username prompt. --cluster is optional; without it the token is not scoped to a cluster. --auth-provider takes a provider's name or type, and a name wins over another provider's type. The user id is not verified. rancher token is unchanged.

Rancher is adding a kubeconfig form whose exec entry runs `rancher auth
get-token --server <url> --cluster <id> --user-id <user id>
--auth-provider <provider>`. The CLI had no `auth get-token` command,
and kubectl failed on every such kubeconfig. The `--auth-provider`
value Rancher writes is the provider's name, such as `local`, which the
CLI matched only against provider types.

Added `rancher auth get-token`. It signs in and caches the credential
the same way as `rancher token`, with the user id in the cache key in
place of the kubeconfig entry name, and it offers no default at the
username prompt. `--cluster` is optional; without it the token is not
scoped to a cluster. `--auth-provider` takes a provider's name or type,
and a name wins over another provider's type. The user id is not
verified. `rancher token` is unchanged.
@pmatseykanets pmatseykanets self-assigned this Oct 5, 2026
@pmatseykanets
pmatseykanets requested a review from a team as a code owner October 5, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant