auth.json not updated after switching channel - cc-switch
Quick fix
Codex authentication mechanism refactor causes switching to fail. Check auth.json path and configuration per the official authentication retention guide.
Symptom
Section titled “Symptom”切换渠道之后,auth.json完全没变After switching channels, auth.json does not change at all
Recent Codex versions significantly refactored the authentication mechanism, causing cc-switch to fail to correctly update `auth.json` when switching providers. Specifically, after switching, the API key in `C:\Users\Administrator\.codex\auth.json` remains unchanged. The system still uses the old provider's key to validate the new provider's API address, causing requests to fail. Maintainers have confirmed this issue and stated an urgent update will be released. For Claude Code multi-OAuth account switching, the root cause is that the `oauthAccount` field in `~/.claude.json` is not correctly replaced. The Claude Code CLI reads this field at runtime to determine the current account, and residual old account information prevents the switch from taking effect. Additionally, Issue #7090 raised a further feature request: in scenarios where the Codex Desktop login identity and model inference quota belong to different OAuth accounts, the current switching logic cannot meet the split requirement. This is an unimplemented feature, not a bug.
Read the official authentication retention guide to understand the authentication mechanism changes when switching Codex.
Verify that the Codex configuration file path in cc-switch is correct and points to the actual `auth.json` location.
For Claude Code multi-OAuth account switching, manually check whether the `oauthAccount` field in `~/.claude.json` is correctly replaced after switching.
If switching is ineffective, try manually deleting the `oauthAccount` field in `~/.claude.json` and then run `claude auth login` again.
Use an incognito browser window to log in to different accounts, bypassing automatic reuse of old sessions.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 4 real issues
- What if the API key in auth.json doesn't change after switching providers?
- This is a known issue caused by the Codex authentication mechanism refactor. Maintainers have confirmed an urgent update will be released. As a workaround, manually check whether the `auth.json` path configuration is correct, or manually edit `auth.json`.
- After switching between multiple Claude Code OAuth accounts, claude auth status still shows the old account?
- The root cause is that the `oauthAccount` field in `~/.claude.json` is not correctly replaced by cc-switch. Try manually deleting that field and running `claude auth login` again, or use an incognito browser window to log in to different accounts.
- Can I keep account A's login and plugin, but use account B's quota for model requests?
- This is the Split OAuth feature request raised in Issue #7090, which is not yet implemented. The current switching logic uses the same OAuth for both App identity, plugin identity, and model quota. Splitting is not supported at this time.
- When will this bug be fixed?
- A maintainer replied in Issue #6782: "Codex recently refactored the authentication mechanism significantly. ccs will release an urgent update in the next couple of days to fix these issues." However, as of some users' feedback, it remained unfixed.
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.