Skip to content

Unable to complete OAuth login for Codex extension when using github.dev / Codespaces (redirect to localhost fails) #6403

@BekishevYevgeniy

Description

@BekishevYevgeniy

What version of the VS Code extension are you using?

0.4.37

What subscription do you have?

ChatGPT Plus (Codex access enabled)

Which IDE are you using?

GitHub Codespaces (browser-based VS Code) at https://miniature-broccoli-7wp9vx6xq64hrv6r.github.dev/

What platform is your computer?

Running inside GitHub Codespaces (Linux container, VS Code Web) Local client OS: macOS

What issue are you seeing?

I am trying to sign in to the OpenAI Codex VS Code extension inside GitHub Codespaces (browser-based VS Code environment). The authorization flow starts, but the redirect URL always returns to:

http://localhost:1455/auth/callback?code=...&scope=openid+profile+email+offline_access

Since Codespaces is a remote cloud environment and does not expose localhost ports to my browser environment, the extension cannot complete the OAuth exchange and therefore I cannot log in or use Codex.

Expected behavior:
The extension should detect remote environments such as github.dev / Codespaces and use a web-based redirect URI (e.g. https://.app.github.dev/ or device_code grant) instead of localhost:1455.

Actual behavior:
OAuth redirect tries to reach local machine localhost, which is not accessible in a remote development environment. As a result, authentication never completes.

What I need:
Guidance on how to authenticate Codex inside github.dev / Codespaces. Is there an official supported redirect URI or alternative login flow (e.g. device code auth or manual API token provisioning)?

Environment:

  • GitHub Codespaces (browser VS Code)
  • Codex extension
  • Remote VS Code Web client
  • No access to localhost of the remote environment

What steps can reproduce the bug?

  1. Open any repository on GitHub.
  2. Press . to open the repository in github.dev (browser-based VS Code)
    or open it inside GitHub Codespaces.
  3. Install and enable the OpenAI Codex extension.
  4. Click "Sign in" in the Codex extension.
  5. The browser opens the OAuth login page and authentication appears to succeed.
  6. After confirming access, the redirect goes to:
    http://localhost:1455/auth/callback?code=...
  7. Since the environment is remote (github.dev / Codespaces), localhost is not accessible.
  8. The authorization never completes and the Codex extension remains unauthenticated.

What is the expected behavior?

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues related to authentication and accountsbugSomething isn't workingextensionIssues related to the VS Code extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions