Skip to content

feat: migrate auth to standard OAuth 2.0 with keychain storage#52

Open
lohnim wants to merge 2 commits intomainfrom
chris/oauth
Open

feat: migrate auth to standard OAuth 2.0 with keychain storage#52
lohnim wants to merge 2 commits intomainfrom
chris/oauth

Conversation

@lohnim
Copy link
Copy Markdown
Collaborator

@lohnim lohnim commented Apr 8, 2026

Summary

  • Migrate from custom /login + /api/cli/token endpoints to standard OAuth 2.0 (/oauth/authorize + /oauth/token with PKCE + state for CSRF protection)
  • Store credentials in OS keychain via cross-keychain (macOS Keychain, Linux Secret Service, Windows Credential Manager, AES-256-GCM encrypted file fallback) instead of plaintext config.json
  • Backward compatible: legacy tokens in config.json still work until next login, then get cleaned up

Test plan

  • alchemy auth — full OAuth flow, verify token stored in keychain (security find-generic-password -s alchemy-cli)
  • alchemy auth status — shows storage backend and expiry
  • alchemy auth logout — clears keychain entry
  • alchemy auth login --force — revokes + re-authenticates
  • Run with ALCHEMY_AUTH_URL override for staging
  • Verify legacy config.json tokens still work (backward compat)

🤖 Generated with Claude Code

@lohnim lohnim requested a review from a team as a code owner April 8, 2026 21:45
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