Codex OAuth Automation Extension
Skill by ara.so — Daily 2026 Skills collection.
A Chrome extension that automates the full OpenAI OAuth registration/login flow including email verification, CPA callback handling, and multi-round batch execution. Supports DuckDuckGo, QQ Mail, 163 Mail, and Inbucket as verification code sources.
Installation
- Clone the repository:
-
Load in Chrome:
- Navigate to
chrome://extensions/ - Enable Developer mode (top right toggle)
- Click Load unpacked
- Select the project directory
- Navigate to
-
Open the side panel from the Chrome toolbar to configure and run.
Project Structure
Configuration (Side Panel Fields)
Storage Behavior
chrome.storage.session— runtime state (steps, OAuth link, email, password, callback URL, tab info). Cleared when browser closes.chrome.storage.local— persistent config (CPA URL, password, mail service, Inbucket settings). Survives browser restarts.
The 9-Step Workflow
Step 1: Get OAuth Link
Opens CPA panel → finds Codex OAuth card → clicks login → extracts authorization URL → saves to OAuth field.
Step 2: Open Signup
Opens the OAuth authorization link → locates and clicks Sign up / Register / 创建账户 button.
Step 3: Fill Email / Password
Fills registration form with email and password. Auto-generates strong password if field is blank. Actual password used is written back to the sidebar.
Step 4: Get Signup Code
Polls the configured mailbox for a 6-digit OTP. Handles Operation timed out errors by auto-clicking retry.
Email matching rules:
- Sender contains:
openai,noreply,verify,auth,duckduckgo,forward - Subject contains:
verify,verification,code,验证,confirm
Step 5: Fill Name / Birthday
Generates random name and birthday. Handles two page variants:
- Birthday mode: fills year/month/day
- Age mode: fills
input[name='age']directly
Step 6: Login via OAuth
Re-fetches latest CPA OAuth link, then logs in with the newly registered account.
Step 7: Get Login Code
Same as Step 4 but with login-specific keyword matching.
Step 8: Manual OAuth Confirm (Auto-attempts)
- Locates the "Continue/Authorize" button on the OAuth consent page
- Uses Chrome
debuggerAPI to dispatch input events for the click - Monitors
chrome.webNavigation.onBeforeNavigatefor localhost callback - Only accepts:
http(s)://localhost:<port>/auth/callback?code=...&state=... - Timeout: 120 seconds
Step 9: CPA Verify
- Validates callback URL has both
codeandstateparams - Submits callback to CPA panel
- Waits for exact
认证成功!status badge - Closes residual
http://localhost:1455/auth*tabs
Auto Mode
Click Auto in the sidebar to run all 9 steps sequentially for N rounds (set by the number input).
Resuming After Pause
When Auto is paused and you reopen the sidebar, two options appear:
- 重新开始 — Reset progress, start new round from Step 1
- 继续当前 — Treat completed/skipped steps as done, resume from first unhandled step
Key Code Patterns
Waiting for Elements (content/utils.js pattern)
Reading/Writing Session State (background.js pattern)
Sending Messages to Content Scripts
Inbucket Mailbox Polling (content/inbucket-mail.js pattern)
Chrome Debugger Click (content/signup-page.js pattern)
OAuth Callback Listener (background.js pattern)
Stop Signal Broadcasting
DuckDuckGo Email Auto-Fetch
Persistent Config (chrome.storage.local)
Troubleshooting
Step 8 timeout (120s exceeded)
- The OAuth consent page structure may have changed
- Manually click the "Continue" button and observe what URL the redirect hits
- Check the button selector in
content/signup-page.js
Step 4/7: OTP never arrives
- Verify the mail service tab is open and logged in before running
- For Inbucket: confirm
https://<host>/m/<mailbox>/is accessible - Check sender/subject filters — OpenAI sometimes changes sender addresses
- For QQ/163: ensure the webmail tab is the correct account
Duck email auto-fetch fails (retries 5x then pauses)
- DuckDuckGo extension must be installed and logged in
- The autofill settings page URL may have changed
- Fall back to manual email entry in the sidebar
CPA panel not detected (Step 1/9)
- Confirm your CPA URL matches
management.html#/oauthpath structure - The
content/vps-panel.jsselectors are hardcoded to a specific panel layout - Try running Step 1 manually to see console errors
"Operation timed out" on signup (Step 4)
- This is handled automatically — the script clicks the retry button and re-submits
- If it loops, the OpenAI signup endpoint may be rate-limiting your IP
Tab cleanup issues
- Old localhost tabs accumulate: Step 9 only cleans
http://localhost:1455/auth* - If your CPA uses a different port, update the cleanup filter in
background.js
Recommended Workflow
Note: Always test single-step flow before enabling Auto. The most fragile steps are Step 8 (OAuth consent click) and Step 4/7 (OTP timing). Use Inbucket for most reliable OTP delivery in automated runs.


