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

OIDC authentication is not handled gracefully in headlamp #2242

Open
O5ten opened this issue Aug 13, 2024 · 8 comments
Open

OIDC authentication is not handled gracefully in headlamp #2242

O5ten opened this issue Aug 13, 2024 · 8 comments
Labels
backend Issues related to the backend blocker Completely prevents the user from using the software. bug Something isn't working oidc Issue related to OIDC

Comments

@O5ten
Copy link

O5ten commented Aug 13, 2024

I'm having trouble connecting to a cluster that has oidc configured as authentication method. Competing products (openlens) is opening a browser window to (re)authenticate to the cluster when needed. headlamp is just asking me for a service account token.

image

This is a sample of my .kube/config

- name: oidc
  user:
    exec:
      apiVersion: client.authentication.k8s.io/v1beta1
      args:
      - oidc-login
      - get-token
      - --oidc-issuer-url=https://login.microsoftonline.com/<tenant>/v2.0
      - --oidc-client-id=<some-client-id>
      - --oidc-client-secret=<some-client-secret>
      command: kubectl
      interactiveMode: IfAvailable
      provideClusterInfo: false
@illume illume added bug Something isn't working blocker Completely prevents the user from using the software. labels Aug 14, 2024
@illume illume added backend Issues related to the backend oidc Issue related to OIDC labels Aug 14, 2024
@joaquimrocha
Copy link
Collaborator

Thank you @O5ten . We will look into this as we do want to support this use-case.

@mviswanathsai
Copy link

Hmm... so it seems to me like we need to lookout for OIDC configuration in the Kubeconfig file. If it is indeed present, we would need to adopt a different logical flow. Here is what I see:

  1. Allow the user to authenticate using OIDC, with a browser window/popup.
  2. Get a hold of the authentication token (JWT) from the provider and make use of it in the backend communication with the API server.
  3. If the token expires, handle that logic as well: re-authenticate and repeat.

But I see many areas where we need deeper discussions. Maybe a design proposal is in order? @joaquimrocha

@O5ten
Copy link
Author

O5ten commented Feb 3, 2025

For what it's worth on the competition analysis side. The fact that the browser opens every once in awhile as lens refreshes its token is among the most annoying things with it. If i keep it on it has opened multiple windows for me during demos and other situations. If there is a way to perform this in the background then that would be absolutely magical.

It's even worse when you have multiple clusters to worry about.

@mviswanathsai
Copy link

Not entirely sure about the security side of things. But technically, we should be able to store the OIDC credentials and handle the authentication behind the scenes.
But again, not sure what that entails.

@mviswanathsai
Copy link

mviswanathsai commented Feb 3, 2025

Just to clarify, are you using Headlamp from outside the cluster? asking because it does seem like there is some documentation of the expected behavior for in-cluster setups: https://headlamp.dev/docs/latest/installation/in-cluster/oidc/

@O5ten
Copy link
Author

O5ten commented Feb 3, 2025

I'm trying to use headlamp as a desktop app. Haven't attempted to use it in-cluster yet as we have many clusters.

@knrt10
Copy link
Contributor

knrt10 commented Feb 4, 2025

@O5ten can you please confirm which version of Headlamp are you using? We do have this issue fixed in the latest version. Can you also confirm you are using signin option as your authentication method? Thanks

@HValG
Copy link

HValG commented Feb 18, 2025

Hello, I face the same issue.

I am using desktop app version 0.28.1.

I have multiple clusters, some using oidc others not. When I launch the app I have a browser page to authent me (keycloak) but once I want to connect to the cluster I get this popup:

Image

Authentication on kubeconfig is working well on other tools so not the issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Issues related to the backend blocker Completely prevents the user from using the software. bug Something isn't working oidc Issue related to OIDC
Projects
Development

No branches or pull requests

6 participants