Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@tableau/mcp-server",
"description": "Helping agents see and understand data.",
"version": "2.6.3",
"version": "2.6.4",
"repository": {
"type": "git",
"url": "git+https://github.com/tableau/tableau-mcp.git"
Expand Down
7 changes: 4 additions & 3 deletions src/server/oauth/authMiddleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ export function authMiddleware(accessTokenValidator: AccessTokenValidator): Requ
...(shouldCheckApiScopes ? requiredApiScopes : []),
];
const scopeParam = `scope="${formatScopes(requiredScopesForChallenge)}"`;
const wwwAuthenticate = `Bearer realm="MCP", error="insufficient_scope", error_description="Missing required scopes", resource_metadata="${resourceMetadataUrl}", ${scopeParam}`;
const errorDescription = `Missing required scopes: ${formatScopes(missingScopes)}`;
const wwwAuthenticate = `Bearer realm="MCP", error="insufficient_scope", error_description="${errorDescription}", resource_metadata="${resourceMetadataUrl}", ${scopeParam}`;

if (req.method === 'GET' && req.headers.accept?.includes('text/event-stream')) {
res.writeHead(403, {
Expand All @@ -141,15 +142,15 @@ export function authMiddleware(accessTokenValidator: AccessTokenValidator): Requ
});
res.write('event: error\n');
res.write(
'data: {"error": "insufficient_scope", "error_description": "Missing required scopes"}\n\n',
`data: ${JSON.stringify({ error: 'insufficient_scope', error_description: errorDescription })}\n\n`,
Comment thread
stephendeoca marked this conversation as resolved.
);
res.end();
return;
}

res.status(403).header('WWW-Authenticate', wwwAuthenticate).json({
error: 'insufficient_scope',
error_description: 'Missing required scopes',
error_description: errorDescription,
});
return;
}
Expand Down
Loading