@softeria/ms-365-mcp-server 0.85.1 → 0.85.2
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/dist/lib/microsoft-auth.js +7 -17
- package/dist/server.js +1 -3
- package/package.json +1 -1
|
@@ -54,17 +54,11 @@ async function exchangeCodeForToken(code, redirectUri, clientId, clientSecret, t
|
|
|
54
54
|
if (codeVerifier) {
|
|
55
55
|
params.append("code_verifier", codeVerifier);
|
|
56
56
|
}
|
|
57
|
-
const headers = {
|
|
58
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
59
|
-
};
|
|
60
|
-
try {
|
|
61
|
-
const redirectUrl = new URL(redirectUri);
|
|
62
|
-
headers["Origin"] = redirectUrl.origin;
|
|
63
|
-
} catch {
|
|
64
|
-
}
|
|
65
57
|
const response = await fetch(`${cloudEndpoints.authority}/${tenantId}/oauth2/v2.0/token`, {
|
|
66
58
|
method: "POST",
|
|
67
|
-
headers
|
|
59
|
+
headers: {
|
|
60
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
61
|
+
},
|
|
68
62
|
body: params
|
|
69
63
|
});
|
|
70
64
|
if (!response.ok) {
|
|
@@ -74,7 +68,7 @@ async function exchangeCodeForToken(code, redirectUri, clientId, clientSecret, t
|
|
|
74
68
|
}
|
|
75
69
|
return response.json();
|
|
76
70
|
}
|
|
77
|
-
async function refreshAccessToken(refreshToken, clientId, clientSecret, tenantId = "common", cloudType = "global"
|
|
71
|
+
async function refreshAccessToken(refreshToken, clientId, clientSecret, tenantId = "common", cloudType = "global") {
|
|
78
72
|
const cloudEndpoints = getCloudEndpoints(cloudType);
|
|
79
73
|
const params = new URLSearchParams({
|
|
80
74
|
grant_type: "refresh_token",
|
|
@@ -84,15 +78,11 @@ async function refreshAccessToken(refreshToken, clientId, clientSecret, tenantId
|
|
|
84
78
|
if (clientSecret) {
|
|
85
79
|
params.append("client_secret", clientSecret);
|
|
86
80
|
}
|
|
87
|
-
const headers = {
|
|
88
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
89
|
-
};
|
|
90
|
-
if (origin) {
|
|
91
|
-
headers["Origin"] = origin;
|
|
92
|
-
}
|
|
93
81
|
const response = await fetch(`${cloudEndpoints.authority}/${tenantId}/oauth2/v2.0/token`, {
|
|
94
82
|
method: "POST",
|
|
95
|
-
headers
|
|
83
|
+
headers: {
|
|
84
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
85
|
+
},
|
|
96
86
|
body: params
|
|
97
87
|
});
|
|
98
88
|
if (!response.ok) {
|
package/dist/server.js
CHANGED
|
@@ -351,14 +351,12 @@ class MicrosoftGraphServer {
|
|
|
351
351
|
} else {
|
|
352
352
|
logger.info("Refresh endpoint: Using public client without client_secret");
|
|
353
353
|
}
|
|
354
|
-
const origin = req.get("origin") || req.get("referer") || void 0;
|
|
355
354
|
const result = await refreshAccessToken(
|
|
356
355
|
body.refresh_token,
|
|
357
356
|
clientId,
|
|
358
357
|
clientSecret,
|
|
359
358
|
tenantId,
|
|
360
|
-
this.secrets.cloudType
|
|
361
|
-
origin
|
|
359
|
+
this.secrets.cloudType
|
|
362
360
|
);
|
|
363
361
|
res.json(result);
|
|
364
362
|
} else {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softeria/ms-365-mcp-server",
|
|
3
|
-
"version": "0.85.
|
|
3
|
+
"version": "0.85.2",
|
|
4
4
|
"description": " A Model Context Protocol (MCP) server for interacting with Microsoft 365 and Office services through the Graph API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|