Open dhorstmann opened 1 year ago
@dhorstmann were you able to resolve this issue?
@dhorstmann were you able to resolve this issue?
Nope.
I have forked this and added support to asking for OTP.
Just add this to your .kube/config
users:
- name: kubernetes-admin
user:
exec:
apiVersion: client.authentication.k8s.io/v1beta1
args:
- oidc-login
- get-token
- --oidc-issuer-url=https://keycloak/auth/realms/master
- --oidc-client-id=yourclientid
- --grant-type=password
command: kubectl
env: null
interactiveMode: IfAvailable
provideClusterInfo: false
and you will get something like this:
Just clone from my fork and build it if you want.
Describe the question
When setting
--username
in kubeconfig, there is no Browser opening keycloak for asking username and password, just asking in terminale directly. Thats very nice. When the user has mfa configured in keycloak, he has to login with otp. But then the login with theusername
option in kubeconfig does not work anymore (error see next line). Is there an option, so that the otp will be asked on bash?error: {"error":"invalid_grant","error_description":"Invalid user credentials"}
To reproduce
kubectl get pods
Your environment