This commit is contained in:
Olivier Chafik 2025-06-18 11:23:09 +01:00
commit bf72f87788
No known key found for this signature in database
2 changed files with 9 additions and 20 deletions

View file

@ -51,12 +51,7 @@ export function requireBearerAuth({ verifier, requiredScopes = [], resourceMetad
throw new InvalidTokenError("Invalid Authorization header format, expected 'Bearer TOKEN'");
}
let protocolVersion = req.headers["mcp-protocol-version"] ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;
if (Array.isArray(protocolVersion)) {
protocolVersion = protocolVersion[protocolVersion.length - 1];
}
const authInfo = await verifier.verifyAccessToken(token, protocolVersion);
const authInfo = await verifier.verifyAccessToken(token);
// Check if token has the required scopes (if any)
if (requiredScopes.length > 0) {

View file

@ -80,5 +80,5 @@ export interface OAuthTokenVerifier {
/**
* Verifies an access token and returns information about it.
*/
verifyAccessToken(token: string, protocolVersion: string): Promise<AuthInfo>;
verifyAccessToken(token: string): Promise<AuthInfo>;
}