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
- Add invalid_client error type detection for deleted client registrations
- Add clearClientInfo() and clearAllAuthData() methods to OAuth provider
- Handle token exchange failures during finishAuth() defensively
- Clear all auth data when client registration becomes invalid
- Prevent infinite retry loops on unrecoverable auth states
- Provide clear error messages for client registration issues
Fixes scenario where client has stored tokens but server-side client
registration was deleted, causing infinite browser auth attempts.
When a MCP client has stored tokens and client registration info, but the server-side client registration has been deleted, the client enters an unrecoverable state where:
6
+
7
+
1. It has local tokens that fail to authenticate (401 Unauthorized)
8
+
2. It tries to re-auth using the stored client_id
9
+
3. Token exchange fails with "Token exchange failed: HTTP 401" because the client_id is no longer valid
10
+
4. The client keeps retrying and opening browsers repeatedly without ever recovering
11
+
12
+
## Solution
13
+
14
+
Made the authentication logic more defensive by:
15
+
16
+
### 1. Enhanced Error Classification
17
+
18
+
- Added new `invalid_client` error type to `AuthErrorType`
19
+
- Enhanced `classifyAuthError()` to detect when client registration is invalid:
0 commit comments