Skip to content

[feature] Browser OAuth (PKCE) SSO via /auth#2

Open
christopher-carroll-glean wants to merge 3 commits into
barkz:mainfrom
christopher-carroll-glean:feature/browser-oauth-sso-auth
Open

[feature] Browser OAuth (PKCE) SSO via /auth#2
christopher-carroll-glean wants to merge 3 commits into
barkz:mainfrom
christopher-carroll-glean:feature/browser-oauth-sso-auth

Conversation

@christopher-carroll-glean

Copy link
Copy Markdown

Summary

  • Problem: The CLI only supported Glean Client API access via pasted API tokens (/login). Many users want the same browser / company SSO experience as the Glean web app.
  • Solution: Add /auth login (OAuth 2.1 authorization code + PKCE): tokens live in ~/.gleancode/auth.json; Config.effective_api_token prefers OAuth and refreshes on demand so existing slash commands stay unchanged. Indexing remains on Glean-issued indexing tokens only. Default OAuth scopes omit AGENT where client registrations disallow it (override with oauth_scopes in config when allowed).
  • Docs / UX: docs/SSO_OAUTH.md, README First run shows SSO above token-based /login, Shell list includes /auth. .gitignore hardening for .env / auth.json; .github/pull_request_template.md for future PRs.

Test plan

  • python3 -m unittest discover -s tests -p 'test_*.py' -q (655 tests)
  • Optional reviewer smoke: /auth login --instance <host>, /auth status, /search in live mode

Notes

  • Opened from fork christopher-carroll-glean/glean-code-clibarkz/glean-code-cli main.

Made with Cursor

Let users sign in through Glean’s authorization server with the same SSO path
as the web app. Tokens live in ~/.gleancode/auth.json; Config.effective_api_token
prefers OAuth and refreshes on demand so existing Client API commands work
unchanged. Indexing remains on api/indexing tokens only.

Default OAuth scopes omit AGENT for compatibility with typical client registrations;
override with oauth_scopes in config when allowed.

Tests mock token_store in config/client header suites so machines with an
existing auth.json stay deterministic. Add .github/pull_request_template.md.
Reduce risk of accidentally committing .env or copied auth.json blobs.
List browser sign-in above token-based /login; link SSO doc and /auth in Shell.
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