Skip to content

Commit 2bc3292

Browse files
authored
fix: align token verifier audience with OAuth server response
The OAuth server returns `aud` including the `/mcp` path, while the token verifier previously expected only the base URL. This mismatch caused introspection failures under `--oauth-strict`. Updated the verifier configuration to use the correct audience to ensure successful token introspection.
1 parent d2d3c74 commit 2bc3292

File tree

1 file changed

+1
-1
lines changed
  • examples/servers/simple-auth/mcp_simple_auth

1 file changed

+1
-1
lines changed

examples/servers/simple-auth/mcp_simple_auth/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def create_resource_server(settings: ResourceServerSettings) -> FastMCP:
6363
# Create token verifier for introspection with RFC 8707 resource validation
6464
token_verifier = IntrospectionTokenVerifier(
6565
introspection_endpoint=settings.auth_server_introspection_endpoint,
66-
server_url=str(settings.server_url),
66+
server_url=f"{str(settings.server_url).rstrip('/')}/mcp",
6767
validate_resource=settings.oauth_strict, # Only validate when --oauth-strict is set
6868
)
6969

0 commit comments

Comments
 (0)