janus-idp / backstage-showcase

Enterprise-ready Backstage distribution
https://showcase.janus-idp.io
Apache License 2.0
105 stars 141 forks source link

Config issue or bug ... using ArgoCD #1242

Open cmoulliard opened 2 months ago

cmoulliard commented 2 months ago

Issue

I created a proxy endpoint to access argocd when I launch backstage top of the main branch (commit: f996bf6) of this project: backstage-showcase but I cannot access argocd stuff

and see this message within the browser dev console:

XHR - http://localhost:7007/api/proxy/argocd/api/applications/quarkus-app-rhdh-1-bootstrap - 401 Unauthorized.

Do we have to configure something specifically ?

Here is how I configured it

proxy:
  skipInvalidProxies: true
  endpoints:
    '/argocd/api':
      # url to the api of your hosted argoCD instance
      target: https://openshift-gitops-server-openshift-gitops.apps.qshift.snowdrop.dev/api/v1/
      changeOrigin: true
      # this line is required if your hosted argoCD instance has self-signed certificate
      secure: false
      headers:
        Cookie:
          $env: "argocd.token=<ARGOCD_AUTH_TOKEN>"

argocd:
  baseUrl: https://openshift-gitops-server-openshift-gitops.apps.qshift.snowdrop.dev/
  username: admin
  password: XXXXXXXXXXXXXX
  appLocatorMethods:
    - type: config
      instances:
        - name: argocdQShift
          url: https://openshift-gitops-server-openshift-gitops.apps.qshift.snowdrop.dev/ 
karthikjeeyar commented 1 month ago

@cmoulliard Can you try passing the token key/value in the instances array ?

argocd:
  baseUrl: https://openshift-gitops-server-openshift-gitops.apps.qshift.snowdrop.dev/
  username: admin
  password: XXXXXXXXXXXXXX
  appLocatorMethods:
    - type: config
      instances:
        - name: argocdQShift
          url: https://openshift-gitops-server-openshift-gitops.apps.qshift.snowdrop.dev/ 
          token: <your-token>

Or the other option is to pass the username and password inside instances array like below

   argocd:
    appLocatorMethods:
      - type: 'config'
        instances:
          - name: main
            url: https://openshift-gitops-server-openshift-gitops.apps.qshift.snowdrop.dev/ 
            username: <username>
            password: <your-pwd>
cmoulliard commented 1 month ago

Can you try passing the token key/value in the instances array ?

I don't configure anymore the proxy and use only username/password which is working fine

argocd:
 appLocatorMethods:
   - type: 'config'
     instances:
       - name: main
         url: https://openshift-gitops-server-openshift-gitops.apps.qshift.snowdrop.dev/ 
         username: <username>
         password: <your-pwd>
karthikjeeyar commented 2 hours ago

@cmoulliard Can we close this issue if this working for you?