@openid4vc/openid4vp 0.3.0-alpha-20250713104548 → 0.3.0-alpha-20250713113151

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.mjs CHANGED
@@ -285,6 +285,7 @@ function getOpenid4vpClientId(options) {
285
285
  const original = {
286
286
  clientId: options.clientId
287
287
  };
288
+ const version = options.version ?? 100;
288
289
  if (isOpenid4vpResponseModeDcApi(options.responseMode)) {
289
290
  if (!options.clientId) {
290
291
  if (!options.origin) {
@@ -297,10 +298,7 @@ function getOpenid4vpClientId(options) {
297
298
  clientIdPrefix: "origin",
298
299
  effectiveClientIdPrefix: "origin",
299
300
  clientIdIdentifier: options.origin,
300
- // FIXME: draft 24 uses web-origin, draft 25+ uses origin
301
- // But it's not really possible to know which one to use as the
302
- // 'effective' client id. Defaulting to origin: since that's newer
303
- effectiveClientId: `origin:${options.origin}`,
301
+ effectiveClientId: version >= 25 ? `origin:${options.origin}` : `web-origin:${options.origin}`,
304
302
  original
305
303
  };
306
304
  }
@@ -1411,6 +1409,7 @@ async function resolveOpenid4vpAuthorizationRequest(options) {
1411
1409
  disableOriginValidation
1412
1410
  });
1413
1411
  }
1412
+ const version = parseAuthorizationRequestVersion(authorizationRequestPayload);
1414
1413
  let clientMetadata = authorizationRequestPayload.client_metadata;
1415
1414
  if (!isOpenid4vpAuthorizationRequestDcApi(authorizationRequestPayload) && !clientMetadata && authorizationRequestPayload.client_metadata_uri) {
1416
1415
  clientMetadata = await fetchClientMetadata({ clientMetadataUri: authorizationRequestPayload.client_metadata_uri });
@@ -1422,7 +1421,8 @@ async function resolveOpenid4vpAuthorizationRequest(options) {
1422
1421
  },
1423
1422
  jar,
1424
1423
  callbacks,
1425
- origin
1424
+ origin,
1425
+ version
1426
1426
  });
1427
1427
  let pex;
1428
1428
  let dcql;
@@ -1449,7 +1449,7 @@ async function resolveOpenid4vpAuthorizationRequest(options) {
1449
1449
  client: clientMeta,
1450
1450
  pex,
1451
1451
  dcql,
1452
- version: parseAuthorizationRequestVersion(authorizationRequestPayload)
1452
+ version
1453
1453
  };
1454
1454
  }
1455
1455
  function validateOpenId4vpAuthorizationRequestPayload(options) {