We are using Gangway/dex to authenticate to our ldap servers. I created a similar setup in aws and it worked perfectly.
Expected behavior (what you expected to happen)
Kubectl should be able to get resources with downloaded config.
Actual behavior (what actually happened)
We are able to login to gangway/dex and get a kubeconfig to download. Dex is clearly getting ldap groups etc, but when you try to use the kubeconfig you get this error:
Kubectl commands result in the error:
error: You must be logged in to the server (Unauthorized)
Error Logs
Kubectl logs:
error: You must be logged in to the server (Unauthorized)
Dex error logs (In debug mode)
http: TLS handshake error from 100.x.x.x:x: local error: tls: bad record MAC
http: TLS handshake error from 172.x.x.x:x: local error: tls: bad record MAC
API server error logs:
Unable to authenticate the request due to an error: [invalid bearer token, oidc: authenticator not initialized]
. . .
oidc authenticator: initializing plugin: Get https://172.x.x.x/.well-known/openid-configuration: Forbidden
Environment
On-prem ( created with kubespray)
Dex version: 2.28.0
Gangway version: 2.2.0 (custom fork)
Kubernetes version: 1.18.9
Installation type: Kubernetes manifest
Tested
Double-triple checked the certs and they all look good
Decoded my JWT token and it looks good
API server can reach the endpoint (I can curl it even with --insecure)
Summary
We are using Gangway/dex to authenticate to our ldap servers. I created a similar setup in aws and it worked perfectly.
Expected behavior (what you expected to happen)
Kubectl should be able to get resources with downloaded config.
Actual behavior (what actually happened)
We are able to login to gangway/dex and get a kubeconfig to download. Dex is clearly getting ldap groups etc, but when you try to use the kubeconfig you get this error:
Kubectl commands result in the error:
Error Logs
Kubectl logs:
Dex error logs (In debug mode)
API server error logs:
Environment
Tested
Manifests
Apiserver configuration: