Use issuer URL in device auth prompt link
Summary
When using device-code login with a custom issuer (--experimental_issuer), Codex correctly uses that issuer for the auth flow β but the terminal prompt still told users to open the default OpenAI device URL (https://auth.openai.com/codex/device). Thatβs confusing and can send users to the wrong domain (especially for enterprise/staging issuers). This PR updates the prompt (and related URLs) to consistently use the configured issuer. π―
π§ What changed
- π Device auth prompt link now uses the configured issuer (instead of a hard-coded OpenAI URL)
- π§ Redirect callback URL is derived from the same issuer for consistency
- π§Ό Minor cleanup: normalize the issuer base URL once and reuse it (avoids formatting quirks like trailing
/)
π§ͺ Repro + Before/After
βΆοΈ Command
codex login --device-auth --experimental_issuer https://auth.example.com
β Before (wrong link shown)
1. Open this link in your browser and sign in to your account
https://auth.openai.com/codex/device
β After (correct link shown)
1. Open this link in your browser and sign in to your account
https://auth.example.com/codex/device
Full example output (same as before, but with the correct URL):
Welcome to Codex [v0.72.0]
OpenAI's command-line coding agent
Follow these steps to sign in with ChatGPT using device code authorization:
1. Open this link in your browser and sign in to your account
https://auth.example.com/codex/device
2. Enter this one-time code (expires in 15 minutes)
BUT6-0M8K4
Device codes are a common phishing target. Never share this code.
β Test plan
-
π¦
codex login --device-auth(default issuer): output remains unchanged -
π©
codex login --device-auth --experimental_issuer https://auth.example.com:- prompt link points to the issuer β
- callback URL is derived from the same issuer β
- no double slashes / mismatched domains β
I have read the CLA Document and I hereby sign the CLA
All contributors have signed the CLA βοΈ β
Posted by the CLA Assistant Lite bot.
@codex review
Codex Review: Didn't find any major issues. Bravo.
βΉοΈ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with π.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".