Skip to content

Using external secret adds empty oidc-scopes arg parameter even if scopes are not provided #4220

@mikeywuu

Description

@mikeywuu

Describe the bug

We switched our oidc secret configuration to the externalSecret. We specified only OIDC_CLIENT_ID, OIDC_CLIENT_SECRET and the OIDC_ISSUER_URL, omitting the OIDC_SCOPES variable. However, the Deployment template in the helm chart still adds the -oidc-scopes arg.

To Reproduce

Steps to reproduce the bug:

  1. Install the helm chart with these values:
config:
  oidc:
    secret:
      create: false
    externalSecret:
      enabled: true
      name: oidc
  1. Make sure to have a k8s secret with the above three mentioned variables set.
  2. Logout of your IDP, in our case Entra
  3. Try to login to headlamp via SignIn
  4. Receive this error from the IDP
Failed to exchange token: oauth2: "invalid_request" "AADSTS900144: The request body must contain the following parameter: 'code'. Trace ID: xxx Correlation ID: xxx Timestamp: 2025-11-28 15:10:09Z" "https://login.microsoftonline.com/error?code=900144"

Environment (please provide info about your environment):

Are you able to fix this issue?

Yes. We can add another if block to add the parameter only if it is actually set at this location:

- "-oidc-scopes=$(OIDC_SCOPES)"

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions