title: Openshift authentication to ArgoCD via Helm charts
body: <p>While configuring the OAuth login of ArgoCD via Openshift, I'm encountering an issue: the serviceaccount <em>argocd-dex-server</em> creates a secret once generated, this secret contains a token which the configMap <em>argocd-cm</em> needs for the SSO configuration.
  I need to render the value of the token into the <em>values.yaml</em> file in order to implement the authentication via Helm charts.</p>
  <p><strong>values.yaml</strong></p>
  <pre><code>  ## ArgoCD config
    ## reference https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/argocd-cm.yaml
    configEnabled: true
      dex.config: |
        connectors:
          - type: openshift
            id: openshift
            name: OpenShift
            config:
              issuer: my_issue
              clientID: system:serviceaccount:argocd:argocd-dex-server
              clientSecret: ?
              redirectURI: my_uri
              insecureCA: true
  </code></pre>
  <p>The clientSecret field must be filled in with the result of the command:</p>
  <pre><code>oc serviceaccounts get-token argocd-dex-server
  </code></pre>
  <p>Apparently the serviceaccount <em>argocd-dex-server</em> must use its own auto-generated secret, I've tried to bind it to an Helm-generated one but it doesn't get used.</p>
  <p>Without the token, the authentication fails:</p>
  <pre><code>Failed to authenticate: oidc: failed to get token: oauth2: cannot fetch token: 400 Bad Request
  </code></pre>