Skip to content

[Feature]: Configure device-code-only Codex authentication #8082

Closed

Description

@nordz0r

Area

Authentication and account pool

What are you trying to accomplish?

Operate a headless OpenCodex hub in Kubernetes using only the ChatGPT/Codex device-code login flow, including when reauthenticating an existing pool account from the dashboard. An operator should be able to complete the login on another device without first starting a localhost callback flow.

What prevents this today?

The dashboard reauthentication modal automatically starts browser OAuth: gui/src/components/use-add-codex-account-oauth.ts calls startOAuth() when reauthAccountId is set, without the device option. The same hook sends device: true only for an explicit device selection. In a remote hub this immediately creates an unwanted browser login attempt, and a subsequent device attempt can encounter a login-already-in-progress conflict. The reported dashboard showed that conflict; its precise cause has not been established. The existing open-browser preference is not a device-flow preference.

What should OpenCodex do?

Provide an explicit, persistent Codex authentication method setting that can select device-code-only operation. When enabled, dashboard add and reauthentication actions should start the device flow directly, without automatically starting a browser callback flow. Make the setting apply consistently to relevant Codex login entry points, and make its enforcement and scope clear to the operator. Preserve existing behavior by default for installations that do not opt in. Device authorization remains OAuth; this request is about the authorization flow, not removing OAuth or changing other providers.

Example usage or interface

For example, an operator enables a Codex authentication setting in the dashboard or configuration and chooses device-only. Clicking Reauthenticate on a pool account immediately displays the verification URL and short device code; no localhost callback login is started. The exact setting name and interface are implementation choices. The device login must retain the existing same-account identity checks for reauthentication.

Alternatives or workarounds

The existing dashboard device-flow choice and the ocx account login openai --id <account-id> --reauth --device CLI option can start a device login explicitly, but the reauthentication modal first starts browser OAuth automatically. Issue #3366 introduced device authorization support; it did not request a persistent device-only policy. Issue #3898 concerns the separate native main account reauthentication path, not a default or restriction for Codex login methods.

Additional context

The affected installation is a remote single-replica Kubernetes hub. The backend already accepts device: true in src/codex/auth-api/login-flow.ts, so this request is for selection and optional enforcement of the existing flow rather than a new OAuth implementation.

Checks

  • I searched existing issues and documentation.
  • This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
  • I removed secrets and personal data.

Activity

  1. github-actions commented on Nov 1, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  2. added
    enhancement
    account-pool
    on Nov 1, 2026
  3. shu-chen-dot-ca commented on Nov 9, 2026

    @shu-chen-dot-ca
    Contributor

    I'm taking this one on.

  4. added a commit that references this issue on Nov 18, 2026
    6ee397c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolenhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions