@lifeaitools/clauth 1.5.21 → 1.5.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/serve.js +7 -2
- package/package.json +1 -1
package/cli/commands/serve.js
CHANGED
|
@@ -2894,12 +2894,17 @@ function createServer(initPassword, whitelist, port, tunnelHostnameInit = null,
|
|
|
2894
2894
|
|
|
2895
2895
|
// ── OAuth Discovery (RFC 9728 + RFC 8414) ──────────────
|
|
2896
2896
|
// claude.ai probes these for ALL remote MCP connections.
|
|
2897
|
-
// resource MUST match the connector URL configured in claude.ai
|
|
2897
|
+
// resource MUST match the connector URL configured in claude.ai.
|
|
2898
|
+
// /.well-known/oauth-protected-resource/gws → resource=/gws
|
|
2899
|
+
// /.well-known/oauth-protected-resource/sse → resource=/sse
|
|
2900
|
+
// /.well-known/oauth-protected-resource → resource=/sse (default)
|
|
2898
2901
|
if (reqPath.startsWith("/.well-known/oauth-protected-resource")) {
|
|
2899
2902
|
const base = oauthBase();
|
|
2903
|
+
const suffix = reqPath.replace("/.well-known/oauth-protected-resource", "").replace(/^\//, "");
|
|
2904
|
+
const resourcePath = suffix && ["/gws", "/clauth", "/mcp", "/sse"].includes("/" + suffix) ? "/" + suffix : "/sse";
|
|
2900
2905
|
res.writeHead(200, { "Content-Type": "application/json", ...CORS });
|
|
2901
2906
|
return res.end(JSON.stringify({
|
|
2902
|
-
resource: `${base}
|
|
2907
|
+
resource: `${base}${resourcePath}`,
|
|
2903
2908
|
authorization_servers: [base],
|
|
2904
2909
|
scopes_supported: ["mcp:tools"],
|
|
2905
2910
|
bearer_methods_supported: ["header"],
|