|
18 | 18 | import httpx |
19 | 19 | from pydantic import BaseModel, Field, ValidationError |
20 | 20 |
|
21 | | -from mcp.client.auth.exceptions import OAuthFlowError, OAuthRegistrationError, OAuthTokenError |
| 21 | +from mcp.client.auth.exceptions import OAuthFlowError, OAuthTokenError |
22 | 22 | from mcp.client.auth.utils import ( |
23 | 23 | build_oauth_authorization_server_metadata_discovery_urls, |
24 | 24 | build_protected_resource_metadata_discovery_urls, |
@@ -586,18 +586,9 @@ async def async_auth_flow(self, request: httpx.Request) -> AsyncGenerator[httpx. |
586 | 586 | self.context.get_authorization_base_url(self.context.server_url), |
587 | 587 | ) |
588 | 588 | registration_response = yield registration_request |
589 | | - try: |
590 | | - client_information = await handle_registration_response(registration_response) |
591 | | - self.context.client_info = client_information |
592 | | - await self.context.storage.set_client_info(client_information) |
593 | | - except OAuthRegistrationError: |
594 | | - # DCR failed — check for pre-registered client credentials |
595 | | - stored_client_info = await self.context.storage.get_client_info() |
596 | | - if stored_client_info: |
597 | | - logger.debug("DCR failed, using pre-registered client credentials") |
598 | | - self.context.client_info = stored_client_info |
599 | | - else: |
600 | | - raise |
| 589 | + client_information = await handle_registration_response(registration_response) |
| 590 | + self.context.client_info = client_information |
| 591 | + await self.context.storage.set_client_info(client_information) |
601 | 592 |
|
602 | 593 | # Step 5: Perform authorization and complete token exchange |
603 | 594 | token_response = yield await self._perform_authorization() |
|
0 commit comments