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

Credential plugin mode & Resource owner password credentials grant flow #167

Closed
KKlapper opened this issue Oct 21, 2019 · 5 comments
Closed
Labels
enhancement New feature or request
Projects
Milestone

Comments

@KKlapper
Copy link

Credential plugin mode & Resource owner password credentials grant flow

Hello everyone,
the credential plugin mode for kubelogin is very nice. We plan to provide a skeleton of kubeconfig to all K8S OIDC users, but without defining --username in the kubeconfig.

We like OIDC K8S users to run "kubectl get pods" and then the resource owner password credentials grant flow should be triggered (instead the browser based flow)

Is there a possibility to trigger the resource owner password credentials grant flow with an option explicitly? Without defining --username, the normal browser based flow will be triggered. Setting --username (without) a user causes an error.

Thanks

@int128 int128 added the enhancement New feature or request label Oct 22, 2019
@int128
Copy link
Owner

int128 commented Oct 22, 2019

Thank you for your contribution. It is possible to add a feature to show the user prompt for the resource owner password credentials flow, like:

users:
- name: keycloak
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      command: kubectl
      args:
      - oidc-login
      - get-token
      - --oidc-issuer-url=https://keycloak.example.com/auth/realms/YOUR_REALM
      - --oidc-client-id=YOUR_CLIENT_ID
      - --oidc-client-secret=YOUR_CLIENT_SECRET
      - --oidc-type=password
% kubectl get pods
Username: foo
Password: 

Does this meet your issue?

@int128 int128 added this to To do in @int128 Oct 25, 2019
@KKlapper
Copy link
Author

I tried the new flag, but it seems it's not supported on my side. I get an error "error: unknown flag: --oidc-type". Are there any specific kubectl or kubelogin version requirements?

@int128
Copy link
Owner

int128 commented Oct 30, 2019

This feature is not implemented yet. I would like to hear your intention. I guess that "without defining --username" means showing a user prompt. Is it okay?

@KKlapper
Copy link
Author

Got it. Yes, this would work!

@int128
Copy link
Owner

int128 commented Nov 1, 2019

I just released v1.15.0 with this feature.

@int128 int128 closed this as completed Nov 1, 2019
@int128 automation moved this from To do to Done Nov 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
@int128
  
Done
Development

No branches or pull requests

2 participants