c0c0n3 / kitt4sme.live

On a mission to bring AI to the shop floor: https://kitt4sme.eu/
MIT License
1 stars 28 forks source link

Argo CD SSO fixes #230

Closed c0c0n3 closed 1 year ago

c0c0n3 commented 1 year ago

This PR hopefully puts an end to the Argo CD SSO saga. Here's how.

With these fixes in place, you can now log into Argo CD through Keycloak over HTTPs.

See also:

Note

Collab cloud certificate. Argo CD will call the configured issuer to retrieve OIDC config (/.well-known/openid-configuration) and exchange grant codes for proper auth tokens. If the issuer field is an HTTPs URL, Argo CD will try validating the server TLS cert. If the server cert was signed by a root or intermediate authority not known to Argo CD, validation will fail. By default, Argo CD looks for the CAs bundled with the Docker image. Unfortunately, recent images don't bundle the SSL.com intermediate authority that signed our Kitt4sme cert, which makes validation fail with this error message

Failed to query provider "https://kitt4sme.collab-cloud.eu/auth/realms/master": Get "https://kitt4sme.collab-cloud.eu/auth/realms/master/.well-known/openid-configuration": x509: certificate signed by unknown authority

Luckily, recent Argo CD versions let you add your OIDC provider's cert to the ones Argo CD trusts through the rootCA field. In our case this field contains the *.collab-cloud.eu cert, the same as the one we use for the Istio gateway.

c0c0n3 commented 1 year ago

Demo

  1. Browse to https://kitt4sme.collab-cloud.eu/argocd
  2. Click on the "Login via Keycloak" button
  3. Your browser should get redirected to the Keycloak login page.
  4. Enter your credentials in the login form and submit.
  5. Your browser should be redirected back to Argo CD and you should see the "apps" page.
RyanKelvinFord commented 1 year ago

Looks good will go over it one more time on Monday and then merge the PR