[Feature]: Configure device-code-only Codex authentication
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- authentication, backend, frontend
Research direction
Start with gui/src/components/use-add-codex-account-oauth.ts, where startOAuth() runs on reauthAccountId without the device option, then check the backend src/codex/auth-api/login-flow.ts, which already accepts device: true. Design the persistent Codex auth-method setting and decide where it is enforced. Done means a device-only opt-in starts the device flow directly for add and reauthenticate, with the default behavior unchanged and same-account checks kept.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 16h 51m
- Merged PRs (30d)
- 681
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lidge-jun/opencodex#8101 · 2 comments ·
Maintainers usually reply within 1 day
-
bug install
Difficulty 3/5 1-2 days Newbie friendliness 72/100
lidge-jun/opencodex#8095 · 2 comments ·
Maintainers usually reply within 1 day
-
bug install
Difficulty 4/5 3-5 days Newbie friendliness 30/100
lidge-jun/opencodex#8093 · 1 comment ·
Maintainers usually reply within 1 day
-
bug proxy tools
Difficulty 4/5 3-5 days Newbie friendliness 25/100
lidge-jun/opencodex#8089 · 2 comments ·
Maintainers usually reply within 1 day
-
account-pool provider provider-compatibility
Difficulty 4/5 3-5 days Newbie friendliness 22/100
lidge-jun/opencodex#8087 · 1 comment ·
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
mobile-app
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Open-Locker/Open-Locker#352 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
leanprover-community/lean4game#589 ·
Maintainers usually reply within 2 days
-
Add: CS Action BGOpencheck:passed streams:add
Difficulty 1/5 Under an hour Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
unocss/unocss#5421 · 1 comment ·
Maintainers usually reply within 1 day