Skip to content

Commit f64f6ec

Browse files
committed
chore: disable credential_subject_issuance check
1 parent b04fbda commit f64f6ec

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

packages/client/lib/AuthorizationCodeClient.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ export const createAuthorizationRequestUrl = async ({
224224
...(credentialOffer?.issuerState && {
225225
issuer_state: credentialOffer.issuerState
226226
}),
227-
scope: authorizationRequest.scope
227+
scope: authorizationRequest.scope ?? 'openid'
228228
}
229229

230230
if (credentialOffer?.issuerState) {
@@ -237,12 +237,11 @@ export const createAuthorizationRequestUrl = async ({
237237
} else if (parEndpoint && parMode !== PARMode.NEVER) {
238238
logger.debug(`USING PAR with endpoint ${parEndpoint}`)
239239

240-
const parResponse = await formPost<PushedAuthorizationResponse>(
241-
parEndpoint,
242-
convertJsonToURI(queryObj, {
243-
mode: JsonURIMode.X_FORM_WWW_URLENCODED,
244-
uriTypeProperties: ['client_id', 'request_uri', 'redirect_uri', 'scope', 'authorization_details', 'issuer_state', 'state']
245-
}),
240+
const parBody = convertJsonToURI(queryObj, {
241+
mode: JsonURIMode.X_FORM_WWW_URLENCODED,
242+
uriTypeProperties: ['client_id', 'request_uri', 'redirect_uri', 'scope', 'authorization_details', 'issuer_state', 'state']
243+
})
244+
const parResponse = await formPost<PushedAuthorizationResponse>(parEndpoint, parBody,
246245
{ contentType: 'application/x-www-form-urlencoded', accept: 'application/json' }
247246
)
248247
if (parResponse.errorBody || !parResponse.successBody) {
@@ -331,6 +330,10 @@ const handleLocations = (
331330
} else {
332331
authorizationDetails.locations = [endpointMetadata.issuer]
333332
}
333+
334+
if (Array.isArray(authorizationDetails.locations)) {
335+
authorizationDetails.locations = [...new Set(authorizationDetails.locations)]
336+
}
334337
}
335338
return authorizationDetails
336339
}

packages/client/lib/CredentialRequestClient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,12 @@ export class CredentialRequestClient {
259259
}
260260
response.access_token = requestToken
261261

262-
if ((uniformRequest.credential_subject_issuance && response.successBody) || response.successBody?.credential_subject_issuance) {
262+
/* TODO SSISDK-85
263+
if ((uniformRequest.credential_subject_issuance && response.successBody) || response.successBody?.credential_subject_issuance) {
263264
if (JSON.stringify(uniformRequest.credential_subject_issuance) !== JSON.stringify(response.successBody?.credential_subject_issuance)) {
264265
throw Error('Subject signing was requested, but issuer did not provide the options in its response')
265266
}
266-
}
267+
}*/
267268
logger.debug(`Credential endpoint ${credentialEndpoint} response:\r\n${JSON.stringify(response, null, 2)}`)
268269

269270
return {

0 commit comments

Comments
 (0)