@bostonuniversity/shibboleth-sp 1.0.3 → 1.0.4

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/cjs/index.js CHANGED
@@ -69788,7 +69788,7 @@ var getHost = (request) => {
69788
69788
  const headers = Headers(request);
69789
69789
  return headers.get("host");
69790
69790
  } catch (e) {
69791
- console.log(`ERROR: Unable to determine host from request: ${JSON.stringify(request, null, 2)}`);
69791
+ console.log(`ERROR: Unable to determine host from request with headers: ${Object.keys(request.headers).join(", ")}`);
69792
69792
  }
69793
69793
  return null;
69794
69794
  };
@@ -69845,7 +69845,7 @@ var handler = async (originRequest, config) => {
69845
69845
  let response;
69846
69846
  const qsparms = querystring ? new URLSearchParams(querystring) : null;
69847
69847
  console.log(`uri: ${uri}`);
69848
- console.log(`querystring: ${querystring}`);
69848
+ console.log(`querystring parameters: ${qsparms ? [...qsparms.keys()].join(", ") : ""}`);
69849
69849
  const { LOGIN, LOGOUT, ASSERT, METADATA, FAVICON } = AUTH_PATHS;
69850
69850
  const getAppLoginUrl = () => {
69851
69851
  const relay_state = encodeURIComponent(relayDomain + uri + (querystring ? `?${querystring}` : ""));
@@ -69892,13 +69892,12 @@ var handler = async (originRequest, config) => {
69892
69892
  break;
69893
69893
  case ASSERT:
69894
69894
  const result2 = await samlTools.sendAssert(originRequest);
69895
- const message = `Authentication successful. result: ${JSON.stringify(result2, null, 2)}`;
69896
69895
  var { samlAssertResponse, relayState } = result2;
69897
69896
  relayState = decodeURIComponent(relayState || relayDomain);
69898
69897
  if (!samlAssertResponse) break;
69899
- debugPrint(message);
69900
- console.log(`relayState: ${relayState}`);
69898
+ debugPrint("Authentication successful.");
69901
69899
  const redirectUrl = new URL(relayState);
69900
+ console.log(`relayState: ${redirectUrl.origin}${redirectUrl.pathname}`);
69902
69901
  redirectUrl.searchParams.append("after_auth", "true");
69903
69902
  response = {
69904
69903
  status: "302",
@@ -69911,7 +69910,7 @@ var handler = async (originRequest, config) => {
69911
69910
  sub: samlAssertResponse.user.name_id,
69912
69911
  user: samlAssertResponse.user.attributes
69913
69912
  };
69914
- console.log(`Setting JWT: ${JSON.stringify(cookieValue, null, 2)}`);
69913
+ console.log(`Setting JWT with attributes: ${Object.keys(cookieValue.user || {}).join(", ")}`);
69915
69914
  jwtTools.setCookieInResponse(response, cookieValue);
69916
69915
  break;
69917
69916
  case METADATA:
@@ -69950,7 +69949,7 @@ var handler = async (originRequest, config) => {
69950
69949
  const { key, value } = customHeaders[i];
69951
69950
  addHeader(response, key, encodeURIComponent(value));
69952
69951
  }
69953
- console.log(`Valid JWT found - passing through to origin: ${JSON.stringify(response, null, 2)}`);
69952
+ console.log(`Valid JWT found - passing through to origin with headers: ${Object.keys(response.headers).join(", ")}`);
69954
69953
  } else if (afterAuth.toLocaleLowerCase() === "true") {
69955
69954
  response = {
69956
69955
  status: "500",
@@ -69960,7 +69959,7 @@ var handler = async (originRequest, config) => {
69960
69959
  "content-type": [{ key: "Content-Type", value: "text/plain" }]
69961
69960
  }
69962
69961
  };
69963
- console.log(`No valid JWT found after authentication: ${JSON.stringify(response, null, 2)}`);
69962
+ console.log(`No valid JWT found after authentication - responding ${response.status}`);
69964
69963
  } else if (appAuthorization) {
69965
69964
  response = originRequest;
69966
69965
  addHeader(response, "authenticated", "false");
@@ -69980,7 +69979,7 @@ var handler = async (originRequest, config) => {
69980
69979
  location: [{ key: "Location", value: getAppLoginUrl() }]
69981
69980
  }
69982
69981
  };
69983
- console.log(`No valid JWT found - redirecting: ${JSON.stringify(response, null, 2)}`);
69982
+ console.log(`No valid JWT found - redirecting to ${LOGIN}`);
69984
69983
  }
69985
69984
  break;
69986
69985
  }