Codex VS Code extension returns 401 after enabling Advanced Account Security

Resolved 💬 1 comment Opened Aug 25, 2026 by shanefarris Closed Aug 25, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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?

  1. Use the Codex VS Code extension normally while authenticated.
  2. Enable OpenAI Advanced Account Security.
  3. Register a YubiKey and a passkey.
  4. Return to the Codex extension in VS Code.
  5. 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.

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 2 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #39696
  • #39685
  • #39581
  • #40611

Powered by Codex Action