@sassoftware/sas-score-mcp-serverjs 1.1.2 → 1.1.3
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.js +2 -2
- package/package.json +1 -1
- package/src/oauthHandlers/authorize.js +7 -2
package/cli.js
CHANGED
|
@@ -266,12 +266,12 @@ let authFlow = process.env.AUTHFLOW;
|
|
|
266
266
|
let mcpHost = process.env.MCPHOST;
|
|
267
267
|
|
|
268
268
|
if (authFlow === 'oauth' || authFlow === 'oauthclient') {
|
|
269
|
-
authFlow = 'bearer';
|
|
270
269
|
authExternal = (authFlow === 'oauthclient') ? true : false;
|
|
270
|
+
authFlow = 'bearer';
|
|
271
271
|
} else if (authFlow === 'bearer') {
|
|
272
272
|
authExternal = true; // in bearer token flow we assume the token is generated externally and passed in via env variable or token file, so we set authExternal to true to indicate that
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
let autoLogon = process.env.AUTOLOGON != null ? process.env.AUTOLOGON.toUpperCase() : "FALSE";
|
|
275
275
|
const appEnvBase = {
|
|
276
276
|
version: version,
|
|
277
277
|
mcpType: mcpType,
|
package/package.json
CHANGED
|
@@ -8,12 +8,17 @@ import baseUrl from "./baseUrl.js";
|
|
|
8
8
|
function authorize(req, res, appContext, pkceStore, codeStore) {
|
|
9
9
|
const { response_type, redirect_uri, state, scope } = req.query;
|
|
10
10
|
console.error("===============================================================");
|
|
11
|
+
console.error("[NOTE] query parameters:", { response_type, redirect_uri, state, scope });
|
|
12
|
+
let callbackUri = appContext.mcpHost + '/callback';
|
|
13
|
+
console.error("[Note] Constructed callbackUri:", callbackUri);
|
|
14
|
+
console.error("[Note] appContext.AUTHEXTERNAL:", appContext.AUTHEXTERNAL);
|
|
11
15
|
if (appContext.AUTHEXTERNAL === true) {
|
|
12
16
|
console.error('*************************************************************');
|
|
13
17
|
console.error("[Error] Received request for /authorize endpoint with external authorization expected");
|
|
14
18
|
console.error('*************************************************************');
|
|
19
|
+
callbackUri = redirect_uri;
|
|
15
20
|
}
|
|
16
|
-
|
|
21
|
+
|
|
17
22
|
if (response_type !== "code") {
|
|
18
23
|
return res.status(400).json({ error: "unsupported_response_type" });
|
|
19
24
|
}
|
|
@@ -27,7 +32,7 @@ function authorize(req, res, appContext, pkceStore, codeStore) {
|
|
|
27
32
|
|
|
28
33
|
pkceStore.set(ourState, { codeVerifier, clientRedirectUri: redirect_uri, clientState: state, codeChallenge });
|
|
29
34
|
|
|
30
|
-
|
|
35
|
+
|
|
31
36
|
console.error("[Note] callbackUri:", callbackUri);
|
|
32
37
|
let urlConfig = {
|
|
33
38
|
response_type: "code",
|