File tree Expand file tree Collapse file tree 2 files changed +17
-3
lines changed
examples/servers/simple-auth/mcp_simple_auth
tests/server/fastmcp/auth Expand file tree Collapse file tree 2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -247,6 +247,20 @@ async def exchange_refresh_token(
247247 """Exchange refresh token"""
248248 raise NotImplementedError ("Not supported" )
249249
250+ async def exchange_token (
251+ self ,
252+ client : OAuthClientInformationFull ,
253+ subject_token : str ,
254+ subject_token_type : str ,
255+ actor_token : str | None ,
256+ actor_token_type : str | None ,
257+ scope : list [str ] | None ,
258+ audience : str | None ,
259+ resource : str | None ,
260+ ) -> OAuthToken :
261+ """Exchange an external token for an MCP access token."""
262+ raise NotImplementedError ("Token exchange is not supported" )
263+
250264 async def exchange_client_credentials (
251265 self , client : OAuthClientInformationFull , scopes : list [str ]
252266 ) -> OAuthToken :
@@ -260,7 +274,7 @@ async def exchange_client_credentials(
260274 )
261275 return OAuthToken (
262276 access_token = token ,
263- token_type = "bearer " ,
277+ token_type = "Bearer " ,
264278 expires_in = 3600 ,
265279 scope = " " .join (scopes ),
266280 )
Original file line number Diff line number Diff line change @@ -179,7 +179,7 @@ async def exchange_client_credentials(
179179 )
180180 return OAuthToken (
181181 access_token = access_token ,
182- token_type = "bearer " ,
182+ token_type = "Bearer " ,
183183 expires_in = 3600 ,
184184 scope = " " .join (scopes ),
185185 )
@@ -207,7 +207,7 @@ async def exchange_token(
207207 )
208208 return OAuthToken (
209209 access_token = access_token ,
210- token_type = "bearer " ,
210+ token_type = "Bearer " ,
211211 expires_in = 3600 ,
212212 scope = " " .join (scope or ["read" ]),
213213 )
You can’t perform that action at this time.
0 commit comments