@sphereon/oid4vci-client 0.19.1-feature.SSISDK.78.code.auth.flow.220 → 0.19.1-feature.SSISDK.78.code.auth.flow.224

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/index.js CHANGED
@@ -1148,7 +1148,7 @@ var createAuthorizationRequestUrl = /* @__PURE__ */ __name(async ({ pkce, endpoi
1148
1148
  ...credentialOffer?.issuerState && {
1149
1149
  issuer_state: credentialOffer.issuerState
1150
1150
  },
1151
- scope: authorizationRequest.scope
1151
+ scope: authorizationRequest.scope ?? "openid"
1152
1152
  };
1153
1153
  if (credentialOffer?.issuerState) {
1154
1154
  queryObj.state = credentialOffer?.issuerState;
@@ -1157,7 +1157,7 @@ var createAuthorizationRequestUrl = /* @__PURE__ */ __name(async ({ pkce, endpoi
1157
1157
  throw Error(`PAR mode is set to required by Authorization Server does not support PAR!`);
1158
1158
  } else if (parEndpoint && parMode !== PARMode.NEVER) {
1159
1159
  logger4.debug(`USING PAR with endpoint ${parEndpoint}`);
1160
- const parResponse = await formPost2(parEndpoint, convertJsonToURI2(queryObj, {
1160
+ const parBody = convertJsonToURI2(queryObj, {
1161
1161
  mode: JsonURIMode2.X_FORM_WWW_URLENCODED,
1162
1162
  uriTypeProperties: [
1163
1163
  "client_id",
@@ -1168,7 +1168,8 @@ var createAuthorizationRequestUrl = /* @__PURE__ */ __name(async ({ pkce, endpoi
1168
1168
  "issuer_state",
1169
1169
  "state"
1170
1170
  ]
1171
- }), {
1171
+ });
1172
+ const parResponse = await formPost2(parEndpoint, parBody, {
1172
1173
  contentType: "application/x-www-form-urlencoded",
1173
1174
  accept: "application/json"
1174
1175
  });
@@ -1247,6 +1248,11 @@ var handleLocations = /* @__PURE__ */ __name((endpointMetadata, authorizationDet
1247
1248
  endpointMetadata.issuer
1248
1249
  ];
1249
1250
  }
1251
+ if (Array.isArray(authorizationDetails.locations)) {
1252
+ authorizationDetails.locations = [
1253
+ ...new Set(authorizationDetails.locations)
1254
+ ];
1255
+ }
1250
1256
  }
1251
1257
  return authorizationDetails;
1252
1258
  }, "handleLocations");
@@ -1446,11 +1452,6 @@ var CredentialRequestClient = class {
1446
1452
  });
1447
1453
  }
1448
1454
  response.access_token = requestToken;
1449
- if (uniformRequest.credential_subject_issuance && response.successBody || response.successBody?.credential_subject_issuance) {
1450
- if (JSON.stringify(uniformRequest.credential_subject_issuance) !== JSON.stringify(response.successBody?.credential_subject_issuance)) {
1451
- throw Error("Subject signing was requested, but issuer did not provide the options in its response");
1452
- }
1453
- }
1454
1455
  logger5.debug(`Credential endpoint ${credentialEndpoint} response:\r
1455
1456
  ${JSON.stringify(response, null, 2)}`);
1456
1457
  return {