Codex VS Code extension returns 401 after enabling Advanced Account Security
What version of the IDE extension are you using?
26.818.61809
What subscription do you have?
Pro
Which IDE are you using?
VS Code
What platform is your computer?
Microsoft Windows NT 10.0.19045.0 x64
What issue are you seeing?
After enabling OpenAI Advanced Account Security and registering a YubiKey plus a passkey, the official Codex VS Code extension stopped working. The extension reports that the access token cannot be refreshed because the refresh token was revoked.
The Codex CLI can authenticate successfully using the browser login flow, but the VS Code extension continues returning HTTP 401 Unauthorized errors.
<img width="680" height="48" alt="Image" src="https://github.com/user-attachments/assets/d21f7d1b-4aae-4554-b023-94e362e91b78" />
What steps can reproduce the bug?
- Use the Codex VS Code extension normally while authenticated.
- Enable OpenAI Advanced Account Security.
- Register a YubiKey and a passkey.
- Return to the Codex extension in VS Code.
- Submit a prompt.
What is the expected behavior?
After completing a new authentication flow following the Advanced Account Security change, the Codex VS Code extension should receive and store valid authentication credentials and resume working normally.
Actual behavior
The Codex chat panel reports:
Your access token could not be refreshed because your refresh token was revoked. Please log out and sign back in.
The Codex VS Code logs also show HTTP 401 Unauthorized / unauthenticated errors.
Logging in again does not resolve the problem.
Additional information
- Completely restarted VS Code.
- Ran codex logout.
- Ran codex login.
- Successfully completed the browser authentication flow using the YubiKey.
- Codex CLI reported that authentication was successful.
- Tested the Codex CLI independently and confirmed that it can communicate with Codex.
- Deleted %USERPROFILE%\.codex\auth.json.
- Authenticated again and generated a new authentication state.
- Checked Windows Credential Manager for OpenAI/Codex credentials.
- Uninstalled and reinstalled the official Codex VS Code extension.
- Restarted VS Code after reinstalling.
- The extension still returns HTTP 401 errors.
The problem began immediately after enabling Advanced Account Security. Codex in VS Code worked normally before that change.
The Codex CLI is able to authenticate successfully, which suggests that the OpenAI account itself and the browser authentication flow are working. The issue appears specific to authentication or token refresh handling in the VS Code extension after Advanced Account Security is enabled.
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action