@@ -461,16 +461,12 @@ def _get_token_endpoint(self) -> str:
461461 token_url = urljoin (auth_base_url , "/token" )
462462 return token_url
463463
464- < << << << HEAD :src / mcp / client / auth .py
465- token_data = {
466- "grant_type" : "authorization_code" ,
467- "code" : auth_code ,
468- "redirect_uri" : str (self .context .client_metadata .redirect_uris [0 ]),
469- "code_verifier" : code_verifier ,
470- }
471- == == == =
472464 async def _exchange_token_authorization_code (
473- self , auth_code : str , code_verifier : str , * , token_data : dict [str , Any ] | None = {}
465+ self ,
466+ auth_code : str ,
467+ code_verifier : str ,
468+ * ,
469+ token_data : dict [str , Any ] | None = None ,
474470 ) -> httpx .Request :
475471 """Build token exchange request for authorization_code flow."""
476472 if self .context .client_metadata .redirect_uris is None :
@@ -489,7 +485,6 @@ async def _exchange_token_authorization_code(
489485 "code_verifier" : code_verifier ,
490486 }
491487 )
492- >> >> >> > upstream / main :src / mcp / client / auth / oauth2 .py
493488
494489 # Only include resource param if conditions are met
495490 if self .context .should_include_resource_param (self .context .protocol_version ):
@@ -671,7 +666,6 @@ async def async_auth_flow(self, request: httpx.Request) -> AsyncGenerator[httpx.
671666 logger .exception ("OAuth flow error" )
672667 raise
673668
674- < << << << HEAD :src / mcp / client / auth .py
675669 # Retry with new tokens
676670 self ._add_auth_header (request )
677671 yield request
@@ -950,8 +944,3 @@ async def async_auth_flow(self, request: httpx.Request) -> AsyncGenerator[httpx.
950944 response = yield request
951945 if response .status_code == 401 :
952946 self ._current_tokens = None
953- == == == =
954- # Retry with new tokens
955- self ._add_auth_header (request )
956- yield request
957- >> >> >> > upstream / main :src / mcp / client / auth / oauth2 .py
0 commit comments