Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cached credentials are not checked when in legacy mode #5

Closed
danmx opened this issue Apr 1, 2020 · 1 comment · Fixed by #6
Closed

Cached credentials are not checked when in legacy mode #5

danmx opened this issue Apr 1, 2020 · 1 comment · Fixed by #6
Labels
bug Something isn't working

Comments

@danmx
Copy link
Contributor

danmx commented Apr 1, 2020

After following kube config the conversion script I have updated kubeconfig:

user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - get-token
      - --environment
      - AzurePublicCloud
      - --server-id
      - xxx
      - --client-id
      - xxx
      - --tenant-id
      - xxx
      - --legacy
      command: kubelogin
      env: null

After running a kubectl command and confirming my identity I have credentials stored in ~/.kube/cache/kubelogin/azure.json.
When I tried to run another kubectl command and it asked me to confirm my identity again.

I tried to not use --legacy and authenticate again and I got from k8s api server (obviously non-legacy type of credentials is not accepted):

error: You must be logged in to the server (the server has asked for the client to provide credentials)

When I tried to switch back to --legacy and still got the same error message.
The error disappeared when I cleared the cache and reauthenticated but I was back to having to authenticate every kubectl execution.

@weinong weinong added the bug Something isn't working label Apr 2, 2020
@weinong
Copy link
Contributor

weinong commented Apr 2, 2020

thanks for reporting!

@weinong weinong linked a pull request Apr 2, 2020 that will close this issue
@weinong weinong closed this as completed in #6 Apr 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants