From dc8f452d8d1de17d669629e8387c1a0070328024 Mon Sep 17 00:00:00 2001 From: Jesse Sanford <108698+jessesanford@users.noreply.github.com> Date: Fri, 27 Jun 2025 18:39:44 +0000 Subject: [PATCH] Fixes #123: allow usage of default_scope to be passed Signed-off-by: Jesse Sanford <108698+jessesanford@users.noreply.github.com> --- fastapi_mcp/auth/proxy.py | 2 ++ fastapi_mcp/server.py | 1 + 2 files changed, 3 insertions(+) diff --git a/fastapi_mcp/auth/proxy.py b/fastapi_mcp/auth/proxy.py index 06e7590..3cf3fa5 100644 --- a/fastapi_mcp/auth/proxy.py +++ b/fastapi_mcp/auth/proxy.py @@ -199,8 +199,10 @@ async def oauth_authorize_proxy( if not scope: logger.warning("Client didn't provide any scopes! Using default scopes.") scope = default_scope + logger.debug(f"Default scope: {scope}") scopes = scope.split() + logger.debug(f"Scopes passed: {scopes}") for required_scope in default_scope.split(): if required_scope not in scopes: scopes.append(required_scope) diff --git a/fastapi_mcp/server.py b/fastapi_mcp/server.py index f5c4fc6..4b33613 100644 --- a/fastapi_mcp/server.py +++ b/fastapi_mcp/server.py @@ -264,6 +264,7 @@ def _setup_auth_2025_03_26(self): client_id=self._auth_config.client_id, authorize_url=self._auth_config.authorize_url, audience=self._auth_config.audience, + default_scope=self._auth_config.default_scope, ) if self._auth_config.setup_fake_dynamic_registration: assert self._auth_config.client_secret is not None