Support device-code login for config servers (#62079)

## Why

`codex login --device-auth` still used browser authorization when config server sign-in was required, preventing the selected device-code flow from being used there.

## What changed

- Use device authorization for config server sign-in when `--device-auth` is selected, display the verification URL and code, and report a missing `config_server.oauth.device_authorization_url` explicitly.
- Include the configured OAuth `resource` in device authorization and token polling requests.
- Reserve sign-in per credential across Codex processes, reuse saved grants, and release the reservation when sign-in completes or is canceled.
- Report config server sign-in failures with guidance specific to `config_server.oauth` and the credential store.

## Testing

Add or extend tests for the device-code prompt, config server failure messages, OAuth resource parameters, policy reload after credential replacement, and rejection of concurrent sign-in with retry after cancellation.

GitOrigin-RevId: 013176d0e10128c347dd072b818e22b5038a2791
This commit is contained in:
vishnu-oai
2026-11-17 16:42:48 +00:00
committed by copyberry
parent 378364e784
commit 2df29476ae
11 changed files with 310 additions and 69 deletions
@@ -323,6 +323,7 @@ pub(super) async fn run_main_inner(
.bootstrap_config
.config_layer_stack
.requirements_toml(),
codex_cloud_config::ConfigServerLoginMethod::Browser,
)
.await?;
}