Skip to content

Commit 193cdeb

Browse files
authored
Merge pull request #213 from Sphereon-Opensource/fix/SSISDK-85_credential_subject_issuance
chore: fixes for credential_subject_issuance
2 parents 76f93d2 + e43cc1f commit 193cdeb

3 files changed

Lines changed: 16 additions & 3 deletions

File tree

packages/client/lib/CredentialRequestClient.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,12 +267,11 @@ export class CredentialRequestClient {
267267
}
268268
response.access_token = requestToken
269269

270-
/* TODO SSISDK-85
271-
if ((uniformRequest.credential_subject_issuance && response.successBody) || response.successBody?.credential_subject_issuance) {
270+
if ((uniformRequest.credential_subject_issuance && response.successBody) || response.successBody?.credential_subject_issuance) {
272271
if (JSON.stringify(uniformRequest.credential_subject_issuance) !== JSON.stringify(response.successBody?.credential_subject_issuance)) {
273272
throw Error('Subject signing was requested, but issuer did not provide the options in its response')
274273
}
275-
}*/
274+
}
276275
logger.debug(`Credential endpoint ${credentialEndpoint} response:\r\n${JSON.stringify(response, null, 2)}`)
277276

278277
return {

packages/client/lib/MetadataClientV1_0_15.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export class MetadataClientV1_0_15 {
5555
let credential_endpoint: string | undefined
5656
let nonce_endpoint: string | undefined
5757
let deferred_credential_endpoint: string | undefined
58+
let notification_endpoint: string | undefined
5859
let authorization_endpoint: string | undefined
5960
let authorization_challenge_endpoint: string | undefined
6061
let authorizationServerType: AuthorizationServerType = 'OID4VCI'
@@ -66,6 +67,7 @@ export class MetadataClientV1_0_15 {
6667
credential_endpoint = credentialIssuerMetadata.credential_endpoint
6768
nonce_endpoint = credentialIssuerMetadata.nonce_endpoint
6869
deferred_credential_endpoint = credentialIssuerMetadata.deferred_credential_endpoint
70+
notification_endpoint = credentialIssuerMetadata.notification_endpoint
6971
if (credentialIssuerMetadata.token_endpoint) {
7072
token_endpoint = credentialIssuerMetadata.token_endpoint
7173
}
@@ -140,6 +142,15 @@ export class MetadataClientV1_0_15 {
140142
deferred_credential_endpoint = authMetadata.deferred_credential_endpoint
141143
}
142144
}
145+
if (authMetadata.notification_endpoint) {
146+
if (notification_endpoint && authMetadata.notification_endpoint !== notification_endpoint) {
147+
logger.debug(
148+
`Credential issuer has a different notification_endpoint (${notification_endpoint}) from the Authorization Server (${authMetadata.notification_endpoint}). Will use the issuer value`,
149+
)
150+
} else {
151+
notification_endpoint = authMetadata.notification_endpoint
152+
}
153+
}
143154
}
144155

145156
if (!authorization_endpoint) {
@@ -182,6 +193,7 @@ export class MetadataClientV1_0_15 {
182193
display: ci.display ?? [],
183194
...(nonce_endpoint && { nonce_endpoint }),
184195
...(deferred_credential_endpoint && { deferred_credential_endpoint }),
196+
...(notification_endpoint && { notification_endpoint }),
185197
}
186198

187199
logger.debug(`Issuer ${issuer} token endpoint ${token_endpoint}, credential endpoint ${credential_endpoint}`)
@@ -192,6 +204,7 @@ export class MetadataClientV1_0_15 {
192204
token_endpoint,
193205
credential_endpoint,
194206
authorization_challenge_endpoint,
207+
notification_endpoint,
195208
authorizationServerType,
196209
credentialIssuerMetadata: v15CredentialIssuerMetadata,
197210
authorizationServerMetadata: authMetadata,

packages/oid4vci-common/lib/types/ServerMetadata.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ export interface EndpointMetadata {
148148
token_endpoint: string
149149
credential_endpoint: string
150150
deferred_credential_endpoint?: string
151+
notification_endpoint?: string
151152
authorization_server?: string
152153
authorization_endpoint?: string // Can be undefined in pre-auth flow
153154
authorization_challenge_endpoint?: string

0 commit comments

Comments
 (0)