@sphereon/oid4vci-client 0.20.1-next.3 → 0.20.1-next.8
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.cjs +18 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -482,6 +482,7 @@ var MetadataClientV1_0_15 = class _MetadataClientV1_0_15 {
|
|
|
482
482
|
let credential_endpoint;
|
|
483
483
|
let nonce_endpoint;
|
|
484
484
|
let deferred_credential_endpoint;
|
|
485
|
+
let notification_endpoint;
|
|
485
486
|
let authorization_endpoint;
|
|
486
487
|
let authorization_challenge_endpoint;
|
|
487
488
|
let authorizationServerType = "OID4VCI";
|
|
@@ -498,6 +499,7 @@ ${JSON.stringify(credentialIssuerMetadata)}`);
|
|
|
498
499
|
credential_endpoint = credentialIssuerMetadata.credential_endpoint;
|
|
499
500
|
nonce_endpoint = credentialIssuerMetadata.nonce_endpoint;
|
|
500
501
|
deferred_credential_endpoint = credentialIssuerMetadata.deferred_credential_endpoint;
|
|
502
|
+
notification_endpoint = credentialIssuerMetadata.notification_endpoint;
|
|
501
503
|
if (credentialIssuerMetadata.token_endpoint) {
|
|
502
504
|
token_endpoint = credentialIssuerMetadata.token_endpoint;
|
|
503
505
|
}
|
|
@@ -555,6 +557,13 @@ ${JSON.stringify(credentialIssuerMetadata)}`);
|
|
|
555
557
|
deferred_credential_endpoint = authMetadata.deferred_credential_endpoint;
|
|
556
558
|
}
|
|
557
559
|
}
|
|
560
|
+
if (authMetadata.notification_endpoint) {
|
|
561
|
+
if (notification_endpoint && authMetadata.notification_endpoint !== notification_endpoint) {
|
|
562
|
+
logger2.debug(`Credential issuer has a different notification_endpoint (${notification_endpoint}) from the Authorization Server (${authMetadata.notification_endpoint}). Will use the issuer value`);
|
|
563
|
+
} else {
|
|
564
|
+
notification_endpoint = authMetadata.notification_endpoint;
|
|
565
|
+
}
|
|
566
|
+
}
|
|
558
567
|
}
|
|
559
568
|
if (!authorization_endpoint) {
|
|
560
569
|
logger2.debug(`Issuer ${issuer} does not expose authorization_endpoint, so only pre-auth will be supported`);
|
|
@@ -591,6 +600,9 @@ ${JSON.stringify(credentialIssuerMetadata)}`);
|
|
|
591
600
|
},
|
|
592
601
|
...deferred_credential_endpoint && {
|
|
593
602
|
deferred_credential_endpoint
|
|
603
|
+
},
|
|
604
|
+
...notification_endpoint && {
|
|
605
|
+
notification_endpoint
|
|
594
606
|
}
|
|
595
607
|
};
|
|
596
608
|
logger2.debug(`Issuer ${issuer} token endpoint ${token_endpoint}, credential endpoint ${credential_endpoint}`);
|
|
@@ -599,6 +611,7 @@ ${JSON.stringify(credentialIssuerMetadata)}`);
|
|
|
599
611
|
token_endpoint,
|
|
600
612
|
credential_endpoint,
|
|
601
613
|
authorization_challenge_endpoint,
|
|
614
|
+
notification_endpoint,
|
|
602
615
|
authorizationServerType,
|
|
603
616
|
credentialIssuerMetadata: v15CredentialIssuerMetadata,
|
|
604
617
|
authorizationServerMetadata: authMetadata
|
|
@@ -1520,6 +1533,11 @@ var CredentialRequestClient = class {
|
|
|
1520
1533
|
});
|
|
1521
1534
|
}
|
|
1522
1535
|
response.access_token = requestToken;
|
|
1536
|
+
if (uniformRequest.credential_subject_issuance && response.successBody || response.successBody?.credential_subject_issuance) {
|
|
1537
|
+
if (JSON.stringify(uniformRequest.credential_subject_issuance) !== JSON.stringify(response.successBody?.credential_subject_issuance)) {
|
|
1538
|
+
throw Error("Subject signing was requested, but issuer did not provide the options in its response");
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1523
1541
|
logger5.debug(`Credential endpoint ${credentialEndpoint} response:\r
|
|
1524
1542
|
${JSON.stringify(response, null, 2)}`);
|
|
1525
1543
|
return {
|