Interview Prep/GitOps & Argo CD/Repos, Clusters, Projects & Permissions

SSO login fails with `failed to get token: oauth2: cannot fetch token: 401 Unauthorized` or `invalid_client`.

IntermediateTroubleshootingRepos, Clusters, Projects & Permissions
Answer

Likely causes → Wrong or rotated client secret, the secret referenced as $oidc.azure.clientSecret does not exist in argocd-secret, or the redirect URI registered at the IdP differs from https://argocd.example.com/auth/callback (or /api/dex/callback for Dex).

Diagnose → kubectl -n argocd logs deploy/argocd-server | grep -i oidc; confirm url: in argocd-cm is the public URL users hit.

Fix → Update the client secret in argocd-secret (or the external secret it references), fix url and the registered redirect URI, then restart argocd-server.

Prevent → Calendar the IdP secret expiry (Azure secrets expire), and sync the secret through External Secrets.

All GitOps & Argo CD questions Roadmap: Argo CD (GitOps)

More on Repos, Clusters, Projects & Permissions