Skip to content

Conversation

@abrar71
Copy link

@abrar71 abrar71 commented Dec 11, 2025

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 ✅

@abrar71
Copy link
Author

abrar71 commented Dec 11, 2025

I have read the CLA Document and I hereby sign the CLA

@github-actions
Copy link
Contributor

github-actions bot commented Dec 11, 2025

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

github-actions bot added a commit that referenced this pull request Dec 11, 2025
@etraut-openai
Copy link
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Contributor

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".

@abrar71
Copy link
Author

abrar71 commented Jan 1, 2026

@etraut-openai Happy New Year, Could you please review and merge this small change. Thank you!

@etraut-openai
Copy link
Collaborator

@abrar71, Happy New Year to you too. Yes, this is in the queue. The developer who is most familiar with this code was busy with other higher-priority work prior to the holiday break. We'll get to it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants