0

Kubeconfig file is containing an access token that acts as a bearer token. It also contains an expiry date. Is there a way to delete/stop this access token from being used so that even if the kubeconfig file has the token, it will prompt for a new login?

Below is the kubeconfig file structure used:

apiVersion: v1
clusters:
- cluster:
    insecure-skip-tls-verify: <value>
    server: <server_details>
  name: <name>
contexts:
- context:
    cluster: <name>
    user: <user>
  name: <name>
current-context: <context>
kind: Config
preferences: {}
users:
- name: <name>
  user:
    auth-provider:
      config:
        access-token: <token>
        apiserver-id: <id>
        client-id: <id>
        config-mode: ""
        environment: AzurePublicCloud
        expires-in: ""
        expires-on: ""
        refresh-token: <token>
        tenant-id: <id>
      name: azure
Sneha Dominic
  • 368
  • 2
  • 14
  • Check this thread it nay help you : https://stackoverflow.com/questions/61684152/kubectl-password-prompt-doesnt-allow-input-acts-like-enter-was-pressed-right – RahulKumarShaw May 25 '22 at 12:25

1 Answers1

0

You can get the prompt for new login (username and password) by missconfigured the .kube/config file

There are a lot of possibilities for authentication in Kubernetes. All of them have some advantages and disadvantages. Please take a look on below links:

The prompt for username and password can appear when .kube/config file is misconfigured.Included one of the possible reason is.

You just need to mentioned the wrong username here

users:

  • name: user: auth-provider:

example

Editing .kube/config and changing:

user: minikube

to:

user: not-minikube

Will lead to:

$ kubectl  get pods
Please enter Username: minikube
Please enter Password: 

You can also refer this thread which has discussed regarding the simmilar issue.

RahulKumarShaw
  • 4,192
  • 2
  • 5
  • 11
  • This doesn't really solve the problem. I'd be interested on WHAT actually to do to fix this - not what **not** to do... – Igor May 19 '23 at 14:19