Skip to content

Commit 8bfbeca

Browse files
committed
cleanup
1 parent a96ad43 commit 8bfbeca

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

auth/external_oauth_provider.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import time
1313
from typing import Optional
1414

15-
from pydantic import AnyHttpUrl
1615
from starlette.routing import Route
1716
from fastmcp.server.auth.providers.google import GoogleProvider
1817
from fastmcp.server.auth import AccessToken
@@ -50,8 +49,8 @@ def __init__(
5049
# Store credentials as they're not exposed by parent class
5150
self._client_id = client_id
5251
self._client_secret = client_secret
53-
if self._resource_server_url:
54-
self.resource_server_url = AnyHttpUrl(self._resource_server_url)
52+
# Store as string - Pydantic validates it when passed to models
53+
self.resource_server_url = self._resource_server_url
5554

5655
async def verify_token(self, token: str) -> Optional[AccessToken]:
5756
"""
@@ -143,9 +142,10 @@ def get_routes(self, **kwargs) -> list[Route]:
143142
return []
144143

145144
# Create protected resource routes that point to Google as the authorization server
145+
# Pass strings directly - Pydantic validates them during model construction
146146
protected_routes = create_protected_resource_routes(
147147
resource_url=self.resource_server_url,
148-
authorization_servers=[AnyHttpUrl(GOOGLE_ISSUER_URL)],
148+
authorization_servers=[GOOGLE_ISSUER_URL],
149149
scopes_supported=self.required_scopes,
150150
resource_name="Google Workspace MCP",
151151
resource_documentation=None,

0 commit comments

Comments
 (0)