You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
🤖 feat: add Anthropic OAuth authentication for Claude Pro/Max subscription
Implements OAuth 2.0 + PKCE flow for authenticating with Claude Pro/Max accounts.
This allows users to use their subscription for API calls instead of per-token billing.
Key changes:
- src/node/services/anthropicOAuth.ts: OAuth module with PKCE flow
- startOAuthFlow(): Generate auth URL and PKCE verifier
- exchangeCodeForTokens(): Exchange authorization code for tokens
- refreshAccessToken(): Automatic token refresh
- createOAuthFetch(): Fetch wrapper that adds OAuth auth headers
- src/node/config.ts: OAuth credential storage
- loadAnthropicOAuthCredentials()
- saveAnthropicOAuthCredentials()
- clearAnthropicOAuthCredentials()
- Stored in ~/.mux/oauth.json
- src/node/services/aiService.ts: OAuth integration
- OAuth takes priority over API key when configured
- Automatic token refresh on expiry
- Logs when using OAuth authentication
- IPC API for frontend integration:
- oauth.anthropic.start(mode): Start OAuth flow
- oauth.anthropic.exchange(code, verifier): Complete flow
- oauth.anthropic.status(): Check authentication status
- oauth.anthropic.logout(): Clear credentials
Based on the OAuth flow used by Claude Code CLI and OpenCode.
_Generated with mux_
0 commit comments