Skip to content

Use PKCE authorization codes for CLI browser login - #78

Draft
barfle wants to merge 4 commits into
codex/gateway-runtime-publisherfrom
codex/native-pkce-login
Draft

barfle wants to merge 4 commits into
codex/gateway-runtime-publisherfrom
codex/native-pkce-login

Conversation

@barfle

@barfle barfle commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Browser and manual CLI SSO callbacks currently accept access/refresh tokens. Replace them with a one-use authorization code and client-generated state, bound to an S256 verifier retained only by the running CLI. Exchange at the stored HTTPS identity origin through an anonymous API client, so an existing account's access or refresh credentials cannot authorize or influence another account's login.

The listener binds a random private loopback path, checks Host and state, rejects token payloads/unknown fields/duplicates/replay, and finishes on a clean URL. Manual SSO accepts only the pending callback's code/state proof and hides pasted material. A changed API origin or failed/malformed exchange preserves the existing saved credentials. Browser password/MFA and SAML keep their existing account policies.

This draft stacks on runtime migration PR77 and requires backend PR3519 plus the frontend/mobile cutover. Hold merge/release until the combined clients are qualified on staging; published device-agent contracts are unchanged.

Validation: all 245 CLI tests pass with the required 100% coverage gate, including real localhost callbacks, PKCE binding, issuer substitution, anonymous exchange and preservation of existing credentials. Package/native build CI and real staging sessions remain required.

barfle and others added 3 commits November 7, 2026 09:40
)

* Separate CLI API recipients and publisher authentication lifecycle

* Bind CLI operations and atomic credential writes to their initiating session

* Use Typer error handling without an undeclared Click dependency

* Move macOS package verification off retired runner images

* Keep release byte-preservation checks strict around the reviewed runner change

---------

Co-authored-by: Elliot Mackenzie <emackenzie@Elliots-MacBook-Pro.local>
Co-authored-by: Elliot Mackenzie <emackenzie@Elliots-MacBook-Pro.local>
* Make account-wide CLI logout explicit

* Normalize coloured help output in logout contract test

This branch has not been deployed

No deployments
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.

1 participant