Closed Ramshield closed 2 years ago
Thanks for the report! We will try to look into and reproduce it; adding it to our next iteration discussion.
Thanks @antgamdia. We tried this in 3 stand-alone environments but resulting in the same thing.
@Ramshield I've just checked my local dev environment, which sets up ldap with dex, and it worked fine. You can try it out in a kind cluster (make cluster-kind && make deploy-dev
, the development user/password is kubeapps-operator-ldap@example.org/password as per the ldap config, see the development Makefile for more detail about what it sets up to compare to your own).
Note: for the situation you describe, where you see logs that the authentication was successful, but Kubeapps redirects you to the login page, this is nearly always because you successfully authenticated, but the token passed back to Kubeapps doesn't have access to view the cluster. You can follow the instructions for debugging OIDC issues to find the actual token and test the token itself.
Let us know if that helps.
Thanks @absoludity the kind
environment works for us. I applied the same [RBAC rules](https://github.com/vmware-tanzu/kubeapps/blob/main/site/content/docs/latest/reference/manifests/kubeapps-local-dev-users-rbac.yaml but still getting the redirect.
After applying the --oidc-x
settings to the manifest of kubeapi I am getting a bit better result.
However for our production environment we use Rancher. I don't want/can't set oidc for all the downstream clusters of rancher, and want to apply it to 1 specific cluster only. However Rancher doesn't work with manifests and Google isn't really of much help. Any advice you can give here, how to get this working in a Rancher environment?
OK, so to be clear, what I've understood from your last comment is that the issue is that your cluster is not configured to accept OIDC tokens for authentication, I think?
Sorry, I don't have any Rancher specific knowledge I can give here, but what I can recommend is that you follow the debugging instructions that I've linked to above, so that you can see the actual token being returned and then verify (via curl or otherwise) whether that token allows access to the cluster or not. I'm guessing it doesn't since you cluster isn't configured for oidc.
Once you have the token, you can try a few things (without involving Kubeapps) to see if you can somehow query the API server with the token received. For example, checking the rancher docs, I see the APIserver is most likely configured with a web-hook auth pointing at the rancher kube-api-auth service. I've not checked to see what that expects, but it could that the Rancher web hook i expecting the access_token
rather than the oidc id_token
.
We had a similar situation in the past with cloud providers in the past (eg. GKE, though they now also support oidc), where they would only accept the separate access_token. There's a chart option for Kubeapps which will use the access token instead, you can read about it at Example 3 at how to setup oidc for oauth2-proxy, in particular, note the --set frontend.proxypassAccessTokenAsBearer=true
being passed there. Again, I would not just jump in and test this with Kubeapps (or if you do, don't be disappointed if it doesn't work), but instead, find out how you can get the access token back during the auth exchange and test it with curl. If you then find it works, then we should be able to get it to work with Kubeapps.
If that doesn't work, another option might be to install https://pinniped.dev/ on this cluster, pinniped makes cluster auth safe and easy, and Kubeapps supports oidc via pinniped too (more info in our docs).
HTH!
For anyone who's wondering, since we use Rancher we figured out you can login with your cluster token. This is a perfect solution without using 3rd party software and works with LDAP integration.
Describe the bug Hi,
I connected OpenLDAP to Dex to KubeApps. But when I login it returns me to the login screen of Kubeapps. I get a authorization token and the logs says the login attempt is successful.
A GIF will be added shortly.
To Reproduce
values_dex.yaml
:values_kubeapps.yaml
:It's a normal OpenLDAP, and I tested it with the example app from Dex and authentication works.
Dex logs:
Kubeapps auth-proxy logs:
The only error I get from
kubeapps-internal-kubeappsapis-595fc49846-6rsbv
which doesn't say anything to me:Expected behavior Be able to login.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information): Windows/MacOS, Safari, Chrome
Additional context Kubeapps version: