Why argocd login --sso fails behind an identity provider
Engineers often sign in to the Argo CD web UI through single sign-on without trouble, then find that argocd login --sso fails or stalls. The web UI and the CLI use different OAuth flows. The browser flow uses the server's own client registration, while the CLI needs its own client in the identity provider, a redirect to a localhost address on the engineer's workstation, and, if you enable it, PKCE (Proof Key for Code Exchange). Most CLI failures come from one of these pieces being missing or registered with the wrong redirect URI, so the platform team's first task is to confirm which client the CLI is supposed to use before changing anything on the server.
The server side changed in Argo CD 3.1. Before that release, the CLI completed the authorization code exchange itself. From 3.1 the Argo CD server handles the OIDC authorization code flow, and when PKCE is enabled the /auth/callback endpoint must be added to the client's redirect URIs. A team upgrading from 3.0 can therefore see a working CLI login break after the upgrade if the identity provider still lists only the old callback. Check the redirect URI list in your provider as part of the upgrade, not after the first engineer reports a failure. The Argo CD 3.0 to 3.1 upgrade notes describe this change.
You need this topic when the web UI works but CLI login does not, when you plan to enforce PKCE, or when you are moving between Argo CD 3.0 and 3.1 or later. If engineers already use a workaround such as a local admin account or a copied token, treat that as a risk to close, since the admin user should be used only for initial setup. Before you start, confirm with your identity provider whether it supports PKCE for the client type you plan to use, because enablePKCEAuthentication defaults to false and requires provider support. Also confirm which Argo CD version you run, since the callback requirements depend on it.
Which PKCE and callback settings fit your environment
Enable PKCE only when your identity provider supports it for the client you register. The enablePKCEAuthentication key in oidc.config defaults to false, so PKCE stays off until you set it. Turning it on against a provider that does not support PKCE will fail at login, and the error often looks like a generic token exchange problem rather than a PKCE problem.
- Confirm support first: Check your provider's documentation for PKCE on the specific client type you use, such as a public client for the CLI.
- Set the key explicitly: Add
enablePKCEAuthentication: trueunderoidc.configonly after support is confirmed, and document the change. - Register the callback when PKCE is on: From Argo CD 3.1 onward, the
/auth/callbackendpoint must be added to the client's redirect URIs when PKCE is enabled. - Keep the client type consistent: Changing a client from confidential to public, or the reverse, can break the secret handling your existing setup expects.
- Plan for the provider's own rules: Some providers restrict localhost redirect URIs or require exact string matches, so test the CLI callback separately.
Ask your identity team to confirm PKCE support in writing for the exact client you will use before changing any Argo CD setting.
The redirect URI you register depends on which Argo CD version handles the OIDC authorization code flow. The 3.0 to 3.1 upgrade notes state that from 3.1 the server itself handles that flow, and that with PKCE enabled the /auth/callback endpoint must be added to the client's redirect URIs. On earlier releases, the callback path your client expects is different, so a configuration copied from a newer guide can break an older deployment.
- Identify your running version: Confirm the exact version of the Argo CD server and CLI in use before choosing redirect URIs, since the CLI and server may be upgraded at different times.
- Review the 3.0 to 3.1 notes: Read the upgrade guidance for the flow change before the server moves past 3.0.
- Add the new callback before the upgrade: Register the
/auth/callbackURI on the client ahead of the cutover so logins do not fail mid-change. - Keep old URIs during transition: Retaining the previous redirect URI until all users and automation have moved avoids a hard break.
- Remove stale URIs afterward: Once the upgrade is verified, remove redirect URIs that no longer serve a purpose.
After any upgrade, test a fresh argocd login --sso from a clean terminal to confirm the callback path works.
Some teams use one OIDC client for the web UI and the CLI, while others register a separate client for the CLI with its own localhost callback. A shared client is simpler to administer, but it mixes redirect URIs and token settings for two different login experiences. A separate CLI client isolates the localhost callback and PKCE settings, which matters when the web UI uses a confidential client with a secret.
- Shared client: Fewer objects to manage, but every redirect URI for both surfaces lives in one place, and a change for the CLI can affect web sign-in.
- Separate CLI client: Keeps the localhost callback and PKCE choice isolated, and lets you rotate or restrict the CLI client without touching the UI.
- Consistent group claims: Whichever layout you choose, confirm that both clients return the same groups claim, or users will see different permissions by surface.
- Localhost callback handling: Register the local callback the CLI uses, and confirm your provider accepts it for that client type.
- Audit ownership: Record which team owns each client so changes are reviewed together.
Before choosing, ask your identity administrator whether separate clients are allowed under your provider's governance rules.
Configuration keys and when each one fits
This table lists the oidc.config settings that shape argocd login --sso, from PKCE and the CLI client to logout and the server-side callback. Read each row as a decision: the 'when to use' column says when the setting applies, and the trade-off column names what to confirm with your identity provider before changing it.
| Option | What it controls | When to use it | Trade-off to confirm |
|---|---|---|---|
| enablePKCEAuthentication | Turns on PKCE (Proof Key for Code Exchange) for the OIDC login flow. It defaults to false. | Use it when your identity provider supports PKCE and you want the CLI and UI flows to avoid relying on a client secret for the code exchange. | Confirm that your identity provider supports PKCE for this client type. Enabling it without support breaks login. |
| CLI client ID and redirect URI | The separate client registered for the argocd CLI, with a localhost callback that receives the login response on the engineer's machine. | Use a dedicated CLI client when the CLI needs its own redirect URI and token settings apart from the web UI client. | Confirm the localhost callback port and path your identity provider accepts, since a mismatch produces redirect errors. |
| /auth/callback redirect URI | The server-side endpoint that completes the authorization code flow from Argo CD 3.1 when PKCE is enabled. | Add it to the client's redirect URIs on any 3.1 or later install that uses PKCE. | Confirm the exact external URL of your Argo CD server, because the registered URI must match it character for character. |
| logoutURL with {{token}} | Sends the ID token to the identity provider's logout endpoint when a user logs out of Argo CD. | Use it when the identity provider requires an ID token hint to end the session cleanly. | Confirm the provider's logout endpoint accepts an ID token hint and that the placeholder is substituted as your provider expects. |
| logoutURL with {{logoutRedirectURL}} | Passes the URL the user should land on after the identity provider ends the session. | Use it when users should return to a specific page after logout, such as the Argo CD login screen. | Confirm that the redirect URL is registered as an allowed logout URI in the identity provider. |
| Omitting logoutURL | Leaves logout local to Argo CD, so the identity provider session may remain active. | Acceptable for lab environments or where a shared session policy already governs sign-out. | Users may stay signed in at the identity provider after leaving Argo CD, which matters on shared workstations. |
Set up CLI single sign-on step by step
This sequence takes you from a confirmed Argo CD version to a working argocd login --sso from a clean workstation, with a check at each stage so a failure is traced to one layer: the identity provider, the OIDC settings, the server callback or the logout path.
Confirm the Argo CD version and upgrade path
Confirm which Argo CD minor version is running on the server, because the callback requirements differ between releases. Check the version with the CLI and the running server deployment, and note whether the instance is on a patch line that still receives fixes. Teams on 3.1 or later must add the server-side callback in a later step, while earlier versions do not, so the version decides which steps apply. Done when you have a written version number, the minor line it belongs to, and the upgrade notes you will follow if the version needs to change first.
Register the CLI client and localhost callback
In your identity provider, create a separate client for the CLI, distinct from the web UI client, and register the localhost redirect URI that the argocd CLI uses to receive the login response. Keep the CLI client public, since a desktop tool cannot hold a client secret safely. Ask your identity provider administrator to confirm the redirect URI matches what the CLI sends, including the port and path, because a mismatch is the most common cause of redirect errors. Done when the provider lists the CLI client with its client ID and an exact localhost callback entry, and you have recorded both values.
Set oidc.config and enable PKCE
Edit the argocd-cm ConfigMap so oidc.config points at your issuer and includes the CLI client ID, then set enablePKCEAuthentication to true. PKCE defaults to false, and it needs support from the identity provider, so confirm that your provider accepts PKCE for public clients before you enable it. Apply the change and restart the API server if your installation requires it. Done when the ConfigMap reflects the new keys and the web UI login still works, which shows the issuer and client settings are valid before the CLI is tested.
Add the server-side callback for version 3.1 or later
From Argo CD 3.1, the server handles the OIDC authorization code flow itself. With PKCE enabled, add the /auth/callback endpoint of your Argo CD URL to the client's redirect URIs at the identity provider, alongside the existing web UI entries. Leave the localhost entry in place for the CLI. Ask the identity provider administrator to confirm that both URIs are saved on the correct client. Done when the provider lists the server callback and the CLI callback side by side, and a browser sign-in to the web UI completes without an error page.
Configure logout URLs
Set the logoutURL key in oidc.config if you want sign-out to end the session at the identity provider as well as in Argo CD. The value can include the {{token}} and {{logoutRedirectURL}} placeholders, which Argo CD fills in at logout. Build the URL from your provider's documented end-session endpoint, and confirm the post-logout redirect URI is registered there. Done when signing out of the web UI returns you to the provider's logout page and then to the Argo CD login page without an error.
Test argocd login --sso from a clean workstation
Test on a workstation that has never logged in to this Argo CD instance, with no cached configuration in the Argo CD CLI config directory and no active browser session at the identity provider. Run argocd login with the --sso flag against your server address, complete the browser sign-in, and then run a read-only command such as listing applications to confirm the token works. Done when the login completes, the CLI reports the logged-in user, and a read-only command succeeds, which shows the whole chain from provider to server to CLI is working.
Diagnose redirect errors by layer
If the test fails, check the layer that produced the error before changing settings. A redirect mismatch points to the registered URIs at the identity provider, a PKCE rejection points to provider support or the enablePKCEAuthentication setting, and a failure after a successful browser sign-in on 3.1 or later often points to a missing server callback. Change one setting at a time and rerun the clean test. Done when the clean workstation test passes again and you have recorded which setting caused the failure so the same fix is applied to other environments.
Fixing the redirect errors teams hit most
What causes a redirect URI mismatch when running argocd login --sso?
A redirect URI mismatch means the callback address the CLI or Argo CD sends to your identity provider is not registered exactly as sent on the client application. Compare the redirect URI in the failing browser step with the list on the client in your provider, character by character, including scheme, host, port and trailing slash. Check the CLI client separately from the web client, since each needs its own registration. Argo CD's CLI uses a localhost callback, so the port in the provider must match the port the CLI listens on. Your provider's sign-in log usually names the redirect URI it received, which is the fastest way to see the difference. Confirm the exact expected values against the user management guide and your provider's documentation before editing the client.
Why does SSO login fail after upgrading Argo CD to 3.1?
The most likely cause is that the /auth/callback endpoint is missing from the client's redirect URIs. From Argo CD 3.1, the server handles the OIDC authorization code flow itself, and with PKCE enabled the callback must be registered on the identity provider client. Check the redirect URI list on both the web and CLI clients after the upgrade, and add the /auth/callback path on your Argo CD hostname where it is absent. Review the 3.0 to 3.1 upgrade notes before the change so you know which flow your installation uses. Test with a non-administrator account after the change, because a failure that appears only for new sign-ins usually points back to the registered redirect URIs.
What happens when PKCE is enabled but the identity provider does not support it?
The login flow fails because the provider cannot validate the code challenge that Argo CD sends, so the sign-in does not complete. PKCE is turned on with enablePKCEAuthentication in oidc.config, it defaults to false, and it depends on identity provider support. Before enabling it, confirm in your provider's documentation that the client type and configuration accept PKCE with the authorization code flow. If you are unsure, set the key back to false, restore the previous working login, and then test PKCE in a non-production Argo CD instance. Record the setting and the provider version in your change record so the next upgrade does not change the behavior unexpectedly.
Why does logging out of Argo CD send users to an unexpected page?
The logout redirect is controlled by the logoutURL setting in oidc.config, so an unexpected page usually means that value is wrong or missing its placeholders. The setting accepts {{token}} and {{logoutRedirectURL}} placeholders, which Argo CD fills in at logout. Compare your configured URL with your provider's documented end-session or logout endpoint, and check that the post-logout redirect address is also registered on the provider client. Test a logout in a private browser window, then a logout from the CLI session, since they can take different paths. Confirm the endpoint format with your provider, because a logout URL that is accepted in one tenant can be rejected in another.
How do I fix localhost port conflicts when the CLI login fails on a laptop?
A localhost port conflict happens when another process already listens on the port the CLI needs for its callback, so the browser redirect cannot reach the CLI. Engineers can check which process holds the port with the operating system's network tools, then stop it or retry after closing the conflicting application. The more durable fix is to align the callback port with what your identity provider allows for the CLI client, since a port that is not registered will fail on the provider side even when it is free. Ask your identity team whether the CLI client accepts localhost with a varying port, because provider behavior differs. Document the agreed port in the onboarding guide so every engineer's laptop behaves the same way.
Who should own fixing CLI SSO redirect errors in our environment?
The work sits across two teams: the platform team that controls Argo CD configuration and the identity team that controls the client registrations on your provider. The platform team owns oidc.config, the server hostname and the logout settings, while the identity team owns redirect URIs, client types and the PKCE capability of the provider. Agree on a single change record that lists both sides, so an edit to one does not silently break the other. If your organization does not have clear ownership of the CLI client, assign it before the next Argo CD upgrade. DeployOpen can plan and document this integration as part of a fixed-scope engagement, with the written scope defining which of these items are included.
Can our own team fix these errors without outside help?
Many teams can fix these errors in-house because the checks are specific and visible in the configuration and the provider console. The work is mainly reading redirect URIs, testing sign-in paths, and making small changes to oidc.config and client settings. The effort rises when several identity providers, a custom authorization server or a regulated change process are involved, because each change needs testing and evidence. Your internal team should have access to both the Argo CD admin configuration and the identity provider administration, and a non-production instance to test changes first. If those access paths or test environments are not available, a scoped engagement can cover the diagnosis and the fix together.
Security considerations for the CLI login path
The CLI login path adds a public client, tokens stored on laptops and a callback listener to an otherwise server-side sign-in. The cards below cover the controls that keep that path narrow, from how the client and redirect URIs are configured to how credentials are handled after login.
Token handling on workstations
After argocd login --sso completes, the CLI stores a JWT on the engineer's machine. That token grants whatever the user's RBAC role allows, so it is effectively a credential. Ask who owns the workstation policy, whether tokens are cleared at logout, and whether shared or unmanaged laptops are allowed to reach the Argo CD server at all.
PKCE for the public client
The CLI cannot hold a client secret, so it is a public client. With PKCE enabled through enablePKCEAuthentication in oidc.config, the login exchange is bound to a value only the CLI knows, which blocks an intercepted authorization code from being redeemed. Confirm your identity provider supports PKCE for this client before turning it on, because the setting defaults to false.
Minimal redirect URIs
Register only the redirect URIs the login flow actually uses. The CLI client needs its localhost callback, and once the server handles the authorization code flow from Argo CD 3.1, the /auth/callback endpoint is also required when PKCE is enabled. Avoid wildcard hosts or extra callback paths, since each extra URI is a place where a crafted redirect could land.
JWT-only API authentication
Argo CD authenticates API requests only with JSON Web Tokens, so every CLI session and automation call depends on token validity. Review token lifetime and revocation with your identity team, and confirm that no fallback path such as a shared password accepts API calls. Traffic between Argo CD components is also encrypted with TLS, which should be verified in your deployment rather than assumed.
Redaction of credentials in logs
Argo CD redacts cluster, Git and OAuth2 credentials from API responses and logs. That protection covers Argo CD's own output, not your terminal history, shell scripts or CI logs that echo a token. Check that wrapper scripts do not print the login response, and that log shipping to your SIEM does not capture command output from engineers' sessions.
Disabling the admin user
The built-in admin account is meant for initial setup only. Once SSO works and at least one administrator can sign in through the identity provider, set admin.enabled to false and confirm that a break-glass path exists outside the normal login. Record who holds that path, because disabling admin without a tested alternative can lock out the whole team.
What CLI SSO work costs and what it needs from your team
How much effort does Argo CD CLI SSO setup usually take?
The effort is mostly configuration and testing, not new software, because the CLI reuses the identity provider you already run for the web UI. The work covers creating a client for the CLI, setting PKCE and redirect URIs, testing login from a workstation and a CI-adjacent host, and confirming logout behaves. Effort rises when the identity provider needs custom claims, when several providers are involved, or when the Argo CD version requires the server-side callback. Ask any partner to break the estimate into identity provider changes, Argo CD configuration changes and test rounds, so you can see which part your own team can absorb.
How long does it take to test CLI SSO before rollout?
Testing duration depends on how many user groups, browsers, operating systems and networks you need to cover, and on how quickly your identity team can change client settings. A reasonable plan tests a few named users on each supported workstation, then a wider pilot group, before the change reaches everyone. Confirm with your identity team how long their change process takes for client edits, because that step often sets the pace more than the Argo CD side does.
What do we need from the identity team for CLI SSO?
The identity team owns the client that the CLI uses, so they need to provide the work below before the Argo CD side can be tested:
- A dedicated CLI client, with its client ID and the localhost callback allowed
- PKCE support enabled on that client, if your provider requires it for public clients
- Redirect URIs that include the Argo CD server callback path when PKCE is used on Argo CD 3.1 or later
- A logout redirect target that the provider accepts
Ask them to confirm these settings in writing, because the exact menu names differ by provider.
What does the platform team need to provide for CLI SSO?
The platform team edits the Argo CD configuration and runs the tests on the cluster. That means setting enablePKCEAuthentication and the logout URL in oidc.config, confirming the Argo CD version and its callback behavior, checking that the web UI still signs in, and recording the working login command for engineers. They also need access to the Argo CD server logs during testing, because redirect errors are easiest to diagnose there. Plan for the change to be reviewed through your normal change process.
Can our own team set up Argo CD CLI SSO without a partner?
Yes, a team with someone who administers the identity provider and someone who manages the Argo CD configuration can usually complete this themselves, since the steps are documented in the official user management guide. A partner adds value when the team lacks an identity administrator, when the provider is unusual, or when the work must be done within a fixed timeline with written test evidence. Decide based on who has the access and the time, and confirm that your identity administrators can make the client changes without a long approval cycle.
What drives the cost of CLI SSO work up?
The main cost drivers are the number of identity providers, the number of Argo CD instances that share one identity configuration, the presence of custom claims or group mappings that need separate testing, and the number of approval steps your change process requires. Redirect errors that come from proxies, certificates or network paths also add time, because they require coordination with the network team. Work that is already documented and uses a single provider usually costs less to validate than a mixed environment.
What should we ask for in a fixed-scope quote for CLI SSO?
Ask for a written scope that lists the Argo CD version and instances covered, the identity provider and client settings to be configured, the PKCE and callback settings, the logout behavior to be verified, the test cases and who runs them, and the handover documents. Also ask which tasks the identity team performs, which the platform team performs, and which are the partner's responsibility. Confirm what is one-time work and what recurs, such as checks after each Argo CD upgrade, and whether ongoing support is handled through a separate retainer.
How DeployOpen scopes and delivers Argo CD CLI SSO
DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside the client's own infrastructure, and Argo CD CLI single sign-on is handled the same way. We agree the identity provider setup, PKCE settings, callback configuration and logout behavior in writing before any change is made to your Argo CD installation.
How we scope
- Confirm which identity provider, Argo CD version and install method the CLI login must work with before work starts.
- Record whether PKCE is required, which client IDs the CLI and web UI will use, and which redirect URIs your provider must accept.
- Agree the written scope, deliverables and timeline in advance, since most engagements are fixed-scope.
How we build
- Configure oidc.config, the CLI client and localhost callback, and PKCE settings in a staging Argo CD before touching production.
- Add the server-side /auth/callback redirect URI where the target version uses the server-handled authorization code flow.
- Test argocd login --sso from workstations on each supported operating system, then check logout URLs and common redirect errors.
How we hand over
- Deliver a configuration record covering client settings, redirect URIs, PKCE values and logout URL templates with their reasons.
- Document a troubleshooting runbook for redirect mismatches, expired sessions and identity provider changes.
- Walk your platform and security team through the login flow and the checks to repeat after each Argo CD upgrade.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers when your Argo CD version or identity provider changes.
- Re-verify CLI login after each patch or minor release, since the project supports only the three most recent minor versions with patches.
- Ask any provider for a quote based on the written scope, including what is one-time setup and what recurs under a retainer.

