Repository navigation
Kubectl not bale to use dex generated refresh token #2518
Unanswered
ansh-lehri
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I am having a OIDC setup for authorization to kubernetes GKE cluster. I have kube-oidc-proxy in front of my GKE cluster, which I use as reverse proxy to have group based authentication.
For OIDC provider, I am using dex with GOOGLE as IDP and dex-authenticator (inplace of gangway.)
I’m using a wildcard certificate issued for “*.xyz.in” . using this wildcard, I have created a DNS record named dex.xyz.in for https request.
Everything works fine initially. i am able to access dex service (dex.xyz.in) using dex-authenticator, it generates suitable kubeconfig file with server flag pointing to kube-oidc-proxy service of LB type, in certificate-authority-data, I use ca.crt value of *.xyz.in as i will be using this same TLS everywhere. i have used this TLS in dex configmap as well and have applied trusted_ca_root config in dex-authenticator with value same as that in kubeconfig.
When i run kubectl commands untill id-token gets expiry, everything works fine. But as soon as id-token get expired, kubect get pods (one example) gives:
Unable to connect to the server: Get “https://dex.xyz.in:32000/.well-known/openid-configuration”: x509: certificate signed by unknown authority
This is happening only when refresh-token must be used to get new id-token. Not able to understand why this is happening as i am able to access this URL over chrome and also curl request
curl --request POST --data ‘client_id=dex-auth&client_secret=&refresh_token=&grant_type=refresh_token’ https://dex.xyz.in:32000/token works propely and returns appropriate results but kubectl is not able to work with this.
I encountered similar error with dex-authenticator when I was not giving trusted_root_ca field in its configurations. But once I entered that filed, dex-authenticator worked fine.
My kubectl version:
My dex conigmap:
dex-authenticator configmap:
In kube-oidc-proxy, i am using secrets file to give values such as
Kindly point out error, been trying to debug this for a long time now.
All reactions