@credo-ts/openid4vc 0.6.0-pr-2195-20250226092707 → 0.6.0-pr-2209-20250321171013

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.
Files changed (99) hide show
  1. package/build/openid4vc-holder/OpenId4VcHolderApi.d.ts +14 -119
  2. package/build/openid4vc-holder/OpenId4VcHolderApi.js +9 -24
  3. package/build/openid4vc-holder/OpenId4VcHolderApi.js.map +1 -1
  4. package/build/openid4vc-holder/OpenId4VcHolderModule.js +1 -1
  5. package/build/openid4vc-holder/OpenId4VcHolderModule.js.map +1 -1
  6. package/build/openid4vc-holder/OpenId4VciHolderService.d.ts +8 -7
  7. package/build/openid4vc-holder/OpenId4VciHolderService.js +21 -19
  8. package/build/openid4vc-holder/OpenId4VciHolderService.js.map +1 -1
  9. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.d.ts +4 -4
  10. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js +2 -2
  11. package/build/openid4vc-holder/OpenId4VciHolderServiceOptions.js.map +1 -1
  12. package/build/openid4vc-holder/OpenId4vcSiopHolderService.d.ts +15 -116
  13. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js +233 -239
  14. package/build/openid4vc-holder/OpenId4vcSiopHolderService.js.map +1 -1
  15. package/build/openid4vc-holder/OpenId4vcSiopHolderServiceOptions.d.ts +9 -25
  16. package/build/openid4vc-issuer/OpenId4VcIssuerApi.d.ts +44 -194
  17. package/build/openid4vc-issuer/OpenId4VcIssuerEvents.d.ts +1 -1
  18. package/build/openid4vc-issuer/OpenId4VcIssuerModule.d.ts +1 -1
  19. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js +1 -1
  20. package/build/openid4vc-issuer/OpenId4VcIssuerModule.js.map +1 -1
  21. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.d.ts +8 -8
  22. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js +10 -2
  23. package/build/openid4vc-issuer/OpenId4VcIssuerModuleConfig.js.map +1 -1
  24. package/build/openid4vc-issuer/OpenId4VcIssuerService.d.ts +48 -198
  25. package/build/openid4vc-issuer/OpenId4VcIssuerService.js +27 -39
  26. package/build/openid4vc-issuer/OpenId4VcIssuerService.js.map +1 -1
  27. package/build/openid4vc-issuer/OpenId4VcIssuerServiceOptions.d.ts +6 -11
  28. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.d.ts +2 -2
  29. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js +1 -0
  30. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRecord.js.map +1 -1
  31. package/build/openid4vc-issuer/repository/OpenId4VcIssuanceSessionRepository.d.ts +1 -1
  32. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.d.ts +1 -1
  33. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js +3 -3
  34. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRecord.js.map +1 -1
  35. package/build/openid4vc-issuer/repository/OpenId4VcIssuerRepository.d.ts +1 -1
  36. package/build/openid4vc-issuer/router/accessTokenEndpoint.d.ts +2 -2
  37. package/build/openid4vc-issuer/router/accessTokenEndpoint.js +1 -1
  38. package/build/openid4vc-issuer/router/accessTokenEndpoint.js.map +1 -1
  39. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js +1 -1
  40. package/build/openid4vc-issuer/router/authorizationChallengeEndpoint.js.map +1 -1
  41. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js +1 -1
  42. package/build/openid4vc-issuer/router/authorizationServerMetadataEndpoint.js.map +1 -1
  43. package/build/openid4vc-issuer/router/credentialEndpoint.d.ts +1 -1
  44. package/build/openid4vc-issuer/router/credentialEndpoint.js +3 -3
  45. package/build/openid4vc-issuer/router/credentialEndpoint.js.map +1 -1
  46. package/build/openid4vc-issuer/router/credentialOfferEndpoint.d.ts +1 -1
  47. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js +1 -1
  48. package/build/openid4vc-issuer/router/issuerMetadataEndpoint.js.map +1 -1
  49. package/build/openid4vc-issuer/router/jwksEndpoint.d.ts +1 -1
  50. package/build/openid4vc-issuer/router/nonceEndpoint.d.ts +1 -1
  51. package/build/openid4vc-issuer/util/txCode.d.ts +1 -1
  52. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.d.ts +12 -20
  53. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js +325 -571
  54. package/build/openid4vc-verifier/OpenId4VcSiopVerifierService.js.map +1 -1
  55. package/build/openid4vc-verifier/OpenId4VcSiopVerifierServiceOptions.d.ts +20 -36
  56. package/build/openid4vc-verifier/OpenId4VcVerifierApi.d.ts +2 -2
  57. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js +2 -2
  58. package/build/openid4vc-verifier/OpenId4VcVerifierApi.js.map +1 -1
  59. package/build/openid4vc-verifier/OpenId4VcVerifierEvents.d.ts +1 -1
  60. package/build/openid4vc-verifier/OpenId4VcVerifierModule.d.ts +1 -1
  61. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js +4 -1
  62. package/build/openid4vc-verifier/OpenId4VcVerifierModule.js.map +1 -1
  63. package/build/openid4vc-verifier/OpenId4VcVerifierModuleConfig.d.ts +2 -2
  64. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.d.ts +49 -0
  65. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js +230 -0
  66. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartyEventEmitter.js.map +1 -0
  67. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.d.ts +19 -0
  68. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js +144 -0
  69. package/build/openid4vc-verifier/repository/OpenId4VcRelyingPartySessionManager.js.map +1 -0
  70. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.d.ts +11 -20
  71. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js +7 -18
  72. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRecord.js.map +1 -1
  73. package/build/openid4vc-verifier/repository/OpenId4VcVerificationSessionRepository.d.ts +1 -1
  74. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRecord.d.ts +1 -1
  75. package/build/openid4vc-verifier/repository/OpenId4VcVerifierRepository.d.ts +1 -1
  76. package/build/openid4vc-verifier/router/authorizationEndpoint.js +103 -5
  77. package/build/openid4vc-verifier/router/authorizationEndpoint.js.map +1 -1
  78. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js +16 -3
  79. package/build/openid4vc-verifier/router/authorizationRequestEndpoint.js.map +1 -1
  80. package/build/shared/callbacks.d.ts +6 -14
  81. package/build/shared/callbacks.js +14 -102
  82. package/build/shared/callbacks.js.map +1 -1
  83. package/build/shared/issuerMetadataUtils.d.ts +144 -102
  84. package/build/shared/models/OpenId4VcJwtIssuer.d.ts +3 -2
  85. package/build/shared/models/index.d.ts +10 -10
  86. package/build/shared/models/index.js +5 -5
  87. package/build/shared/models/index.js.map +1 -1
  88. package/build/shared/router/context.d.ts +3 -3
  89. package/build/shared/router/context.js +4 -4
  90. package/build/shared/router/context.js.map +1 -1
  91. package/build/shared/router/express.js +1 -2
  92. package/build/shared/router/express.js.map +1 -1
  93. package/build/shared/transform.d.ts +5 -0
  94. package/build/shared/transform.js +69 -0
  95. package/build/shared/transform.js.map +1 -0
  96. package/build/shared/utils.d.ts +8 -6
  97. package/build/shared/utils.js +105 -34
  98. package/build/shared/utils.js.map +1 -1
  99. package/package.json +8 -6
@@ -11,296 +11,290 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.OpenId4VcSiopHolderService = void 0;
13
13
  const core_1 = require("@credo-ts/core");
14
- const openid4vp_1 = require("@openid4vc/openid4vp");
15
- const callbacks_1 = require("../shared/callbacks");
14
+ const did_auth_siop_1 = require("@sphereon/did-auth-siop");
15
+ const transform_1 = require("../shared/transform");
16
+ const utils_1 = require("../shared/utils");
16
17
  let OpenId4VcSiopHolderService = class OpenId4VcSiopHolderService {
17
- constructor(presentationExchangeService, dcqlService) {
18
+ constructor(presentationExchangeService) {
18
19
  this.presentationExchangeService = presentationExchangeService;
19
- this.dcqlService = dcqlService;
20
20
  }
21
- getOpenid4vpClient(agentContext, trustedCertificates) {
22
- const callbacks = (0, callbacks_1.getOid4vcCallbacks)(agentContext, trustedCertificates);
23
- return new openid4vp_1.Openid4vpClient({ callbacks });
24
- }
25
- async handlePresentationExchangeRequest(agentContext, _presentationDefinition, transactionData) {
26
- const presentationDefinition = _presentationDefinition;
27
- this.presentationExchangeService.validatePresentationDefinition(presentationDefinition);
28
- const presentationExchange = {
29
- definition: presentationDefinition,
30
- credentialsForRequest: await this.presentationExchangeService.getCredentialsForRequest(agentContext, presentationDefinition),
31
- };
32
- let credentialsForTransactionData = undefined;
33
- // for each transaction data entry, get all submission entries that can be used to sign the respective transaction
34
- if (transactionData) {
35
- credentialsForTransactionData = [];
36
- for (const transactionDataEntry of transactionData) {
37
- for (const requirement of presentationExchange.credentialsForRequest.requirements) {
38
- const recordSet = new Set();
39
- const filtered = requirement.submissionEntry.filter((submission) => transactionDataEntry.credential_ids.includes(submission.inputDescriptorId));
40
- for (const submission of filtered) {
41
- for (const credential of submission.verifiableCredentials) {
42
- recordSet.add(credential);
43
- }
44
- }
45
- if (recordSet.size === 0) {
46
- continue;
47
- }
48
- credentialsForTransactionData.push({
49
- transactionDataEntry,
50
- submissionEntry: { ...filtered[0], verifiableCredentials: Array.from(recordSet) },
51
- });
52
- }
53
- }
54
- }
55
- return { pex: { ...presentationExchange, transactionData: credentialsForTransactionData } };
56
- }
57
- async handleDcqlRequest(agentContext, dcql, transactionData) {
58
- const dcqlQuery = this.dcqlService.validateDcqlQuery(dcql);
59
- const dcqlQueryResult = await this.dcqlService.getCredentialsForRequest(agentContext, dcqlQuery);
60
- let credentialsForTransactionData = undefined;
61
- // for each transaction data entry, get all submission entries that can be used to sign the respective transaction
62
- if (transactionData) {
63
- credentialsForTransactionData = [];
64
- for (const transactionDataEntry of transactionData) {
65
- const result = transactionDataEntry.credential_ids
66
- .map((credentialId) => {
67
- const match = dcqlQueryResult.credential_matches[credentialId];
68
- if (!match.success)
69
- return undefined;
70
- return {
71
- transactionDataEntry,
72
- dcql: {
73
- record: match.record,
74
- credentialQueryId: match.input_credential_index,
75
- claimSetId: match.claim_set_index,
76
- },
77
- };
78
- })
79
- .filter((r) => r !== undefined);
80
- credentialsForTransactionData.push(...result);
81
- }
82
- }
83
- return { dcql: { queryResult: dcqlQueryResult, transactionData: credentialsForTransactionData } };
84
- }
85
- async resolveAuthorizationRequest(agentContext,
86
- /**
87
- * Can be:
88
- * - JWT
89
- * - URI containing request or request_uri param
90
- * - Request payload
91
- */
92
- request, options) {
93
- const openid4vpClient = this.getOpenid4vpClient(agentContext, options?.trustedCertificates);
94
- const { params } = openid4vpClient.parseOpenid4vpAuthorizationRequestPayload({ authorizationRequest: request });
95
- const verifiedAuthRequest = await openid4vpClient.resolveOpenId4vpAuthorizationRequest({
96
- request: params,
97
- origin: options?.origin,
98
- });
99
- const { client, pex, transactionData, dcql } = verifiedAuthRequest;
100
- if (client.scheme !== 'x509_san_dns' &&
101
- client.scheme !== 'x509_san_uri' &&
102
- client.scheme !== 'did' &&
103
- client.scheme !== 'web-origin') {
104
- throw new core_1.CredoError(`Client scheme '${client.scheme}' is not supported`);
21
+ async resolveAuthorizationRequest(agentContext, requestJwtOrUri, trustedCertificates) {
22
+ const openidProvider = await this.getOpenIdProvider(agentContext, trustedCertificates);
23
+ // parsing happens automatically in verifyAuthorizationRequest
24
+ const verifiedAuthorizationRequest = await openidProvider.verifyAuthorizationRequest(requestJwtOrUri);
25
+ agentContext.config.logger.debug(`verified SIOP Authorization Request for issuer '${verifiedAuthorizationRequest.issuer}'`);
26
+ agentContext.config.logger.debug(`requestJwtOrUri '${requestJwtOrUri}'`);
27
+ if (verifiedAuthorizationRequest.presentationDefinitions &&
28
+ verifiedAuthorizationRequest.presentationDefinitions.length > 1) {
29
+ throw new core_1.CredoError('Only a single presentation definition is supported.');
105
30
  }
106
- const { pex: pexResult } = pex?.presentation_definition
107
- ? await this.handlePresentationExchangeRequest(agentContext, pex.presentation_definition, transactionData)
108
- : { pex: undefined };
109
- const { dcql: dcqlResult } = dcql?.query
110
- ? await this.handleDcqlRequest(agentContext, dcql.query, transactionData)
111
- : { dcql: undefined };
112
- agentContext.config.logger.debug(`verified Authorization Request`);
113
- agentContext.config.logger.debug(`request '${request}'`);
31
+ const presentationDefinition = verifiedAuthorizationRequest.presentationDefinitions?.[0]?.definition;
114
32
  return {
115
- authorizationRequest: verifiedAuthRequest,
116
- presentationExchange: pexResult,
117
- dcql: dcqlResult,
118
- origin: options?.origin,
33
+ authorizationRequest: verifiedAuthorizationRequest,
34
+ // Parameters related to DIF Presentation Exchange
35
+ presentationExchange: presentationDefinition
36
+ ? {
37
+ definition: presentationDefinition,
38
+ credentialsForRequest: await this.presentationExchangeService.getCredentialsForRequest(agentContext, presentationDefinition),
39
+ }
40
+ : undefined,
119
41
  };
120
42
  }
121
- async getCredentialQueryIdsToSignTransactionData(dcql, transactionData) {
122
- // check if all credentials are present for the transaction data
123
- // This needs a deep integration into pex and out pex requirements
124
- const dcqlCredentialQueryIds = [];
125
- for (const tdEntry of transactionData) {
126
- // find a inputDescriptor in the credential_ids which is present in the response
127
- // and use it to sign of the transaction
128
- const dcqlCredentialForRequest = tdEntry.credential_ids.find((credentialId) => dcql.credentials[credentialId]);
129
- if (!dcqlCredentialForRequest) {
130
- throw new core_1.CredoError('Cannot create authorization response. No credentials found for signing transaction data.');
131
- }
132
- dcqlCredentialQueryIds.push(dcqlCredentialForRequest);
133
- }
134
- return dcqlCredentialQueryIds;
135
- }
136
- async getInputDescriptorsToSignTransactionData(presentationExchange, transactionData) {
137
- // check if all credentials are present for the transaction data
138
- // This needs a deep integration into pex and out pex requirements
139
- const inputDescriptorsToSignTransactionData = [];
140
- for (const tdEntry of transactionData) {
141
- // find a inputDescriptor in the credential_ids which is present in the response
142
- // and use it to sign of the transaction
143
- const inputDescriptorForCredential = tdEntry.credential_ids.find((credentialId) => presentationExchange.credentials[credentialId]);
144
- if (!inputDescriptorForCredential) {
145
- throw new core_1.CredoError('Cannot create authorization response. No credentials found for signing transaction data.');
146
- }
147
- inputDescriptorsToSignTransactionData.push(inputDescriptorForCredential);
148
- }
149
- return inputDescriptorsToSignTransactionData;
150
- }
151
43
  async acceptAuthorizationRequest(agentContext, options) {
152
- const { authorizationRequest, presentationExchange, dcql } = options;
44
+ const { authorizationRequest, presentationExchange } = options;
45
+ let openIdTokenIssuer = options.openIdTokenIssuer;
46
+ let presentationExchangeOptions = undefined;
47
+ const wantsIdToken = await authorizationRequest.authorizationRequest.containsResponseType(did_auth_siop_1.ResponseType.ID_TOKEN);
153
48
  const authorizationResponseNonce = await agentContext.wallet.generateNonce();
154
- const nonce = authorizationRequest.payload.nonce;
155
- const clientId = authorizationRequest.client.originalValue;
156
- let openid4vpOptions;
157
- if ((0, openid4vp_1.isOpenid4vpAuthorizationRequestDcApi)(authorizationRequest.payload)) {
158
- if (!options.origin) {
159
- throw new core_1.CredoError('Missing required parameter `origin` parameter for accepting openid4vp dc api requests.');
160
- }
161
- openid4vpOptions = { type: 'openId4VpDcApi', clientId, origin: options.origin, verifierGeneratedNonce: nonce };
162
- }
163
- else {
164
- const responseUri = authorizationRequest.payload.response_uri ?? authorizationRequest.payload.redirect_uri;
165
- if (!responseUri) {
166
- throw new core_1.CredoError('Missing required parameter `response_uri` or `redirect_uri` in the authorization request.');
167
- }
168
- openid4vpOptions = {
169
- type: 'openId4Vp',
170
- mdocGeneratedNonce: authorizationResponseNonce,
171
- responseUri,
172
- clientId,
173
- verifierGeneratedNonce: nonce,
174
- };
175
- }
176
- let vpToken;
177
- let presentationSubmission = undefined;
178
49
  // Handle presentation exchange part
179
- if (authorizationRequest.pex || presentationExchange) {
50
+ if (authorizationRequest.presentationDefinitions && authorizationRequest.presentationDefinitions.length > 0) {
180
51
  if (!presentationExchange) {
181
52
  throw new core_1.CredoError('Authorization request included presentation definition. `presentationExchange` MUST be supplied to accept authorization requests.');
182
53
  }
183
- if (!authorizationRequest.pex) {
184
- throw new core_1.CredoError('`presentationExchange` was supplied, but no presentation definition was found in the presentation request.');
54
+ const nonce = await authorizationRequest.authorizationRequest.getMergedProperty('nonce');
55
+ if (!nonce) {
56
+ throw new core_1.CredoError("Unable to extract 'nonce' from authorization request");
57
+ }
58
+ const clientId = await authorizationRequest.authorizationRequest.getMergedProperty('client_id');
59
+ if (!clientId) {
60
+ throw new core_1.CredoError("Unable to extract 'client_id' from authorization request");
185
61
  }
186
- const { presentationSubmission: _presentationSubmission, encodedVerifiablePresentations } = await this.presentationExchangeService.createPresentation(agentContext, {
62
+ const responseUri = (await authorizationRequest.authorizationRequest.getMergedProperty('response_uri')) ??
63
+ (await authorizationRequest.authorizationRequest.getMergedProperty('redirect_uri'));
64
+ if (!responseUri) {
65
+ throw new core_1.CredoError("Unable to extract 'response_uri' from authorization request");
66
+ }
67
+ const { verifiablePresentations, presentationSubmission } = await this.presentationExchangeService.createPresentation(agentContext, {
187
68
  credentialsForInputDescriptor: presentationExchange.credentials,
188
- transactionDataAuthorization: authorizationRequest.transactionData
189
- ? {
190
- credentials: await this.getInputDescriptorsToSignTransactionData(presentationExchange, authorizationRequest.transactionData),
191
- transactionData: authorizationRequest.transactionData,
192
- }
193
- : undefined,
194
- presentationDefinition: authorizationRequest.pex
195
- .presentation_definition,
69
+ presentationDefinition: authorizationRequest.presentationDefinitions[0].definition,
196
70
  challenge: nonce,
197
71
  domain: clientId,
198
72
  presentationSubmissionLocation: core_1.DifPresentationExchangeSubmissionLocation.EXTERNAL,
199
- openid4vp: openid4vpOptions,
73
+ openid4vp: {
74
+ mdocGeneratedNonce: authorizationResponseNonce,
75
+ responseUri,
76
+ },
200
77
  });
201
- vpToken =
202
- encodedVerifiablePresentations.length === 1 && _presentationSubmission?.descriptor_map[0]?.path === '$'
203
- ? encodedVerifiablePresentations[0]
204
- : encodedVerifiablePresentations;
205
- presentationSubmission = _presentationSubmission;
206
- }
207
- else if (authorizationRequest.dcql || dcql) {
208
- if (!authorizationRequest.dcql) {
209
- throw new core_1.CredoError('`dcql` was supplied, but no dcql request was found in the presentation request.');
210
- }
211
- if (!dcql) {
212
- throw new core_1.CredoError('Authorization request included dcql request. `dcql` MUST be supplied to accept authorization requests.');
78
+ presentationExchangeOptions = {
79
+ verifiablePresentations: verifiablePresentations.map((vp) => (0, transform_1.getSphereonVerifiablePresentation)(vp)),
80
+ presentationSubmission,
81
+ vpTokenLocation: did_auth_siop_1.VPTokenLocation.AUTHORIZATION_RESPONSE,
82
+ };
83
+ if (wantsIdToken && !openIdTokenIssuer) {
84
+ openIdTokenIssuer = this.getOpenIdTokenIssuerFromVerifiablePresentation(verifiablePresentations[0]);
213
85
  }
214
- const { encodedDcqlPresentation } = await this.dcqlService.createPresentation(agentContext, {
215
- credentialQueryToCredential: dcql.credentials,
216
- transactionDataAuthorization: authorizationRequest.transactionData
217
- ? {
218
- credentials: await this.getCredentialQueryIdsToSignTransactionData(dcql, authorizationRequest.transactionData),
219
- transactionData: authorizationRequest.transactionData,
220
- }
221
- : undefined,
222
- challenge: nonce,
223
- domain: clientId,
224
- openid4vp: openid4vpOptions,
225
- });
226
- vpToken = encodedDcqlPresentation;
227
86
  }
228
- else {
229
- throw new core_1.CredoError('Either pex or dcql must be provided');
87
+ else if (options.presentationExchange) {
88
+ throw new core_1.CredoError('`presentationExchange` was supplied, but no presentation definition was found in the presentation request.');
230
89
  }
231
- const openid4vpClient = this.getOpenid4vpClient(agentContext);
232
- const response = await openid4vpClient.createOpenid4vpAuthorizationResponse({
233
- requestParams: authorizationRequest.payload,
234
- responseParams: {
235
- vp_token: vpToken,
236
- presentation_submission: presentationSubmission,
237
- },
238
- jarm: authorizationRequest.payload.response_mode && (0, openid4vp_1.isJarmResponseMode)(authorizationRequest.payload.response_mode)
239
- ? {
240
- encryption: { nonce: authorizationResponseNonce },
241
- serverMetadata: {
242
- authorization_signing_alg_values_supported: ['RS256'],
90
+ if (wantsIdToken) {
91
+ if (!openIdTokenIssuer) {
92
+ throw new core_1.CredoError('Unable to create authorization response. openIdTokenIssuer MUST be supplied when no presentation is active and the ResponseType includes id_token.');
93
+ }
94
+ this.assertValidTokenIssuer(authorizationRequest, openIdTokenIssuer);
95
+ }
96
+ const jwtIssuer = wantsIdToken && openIdTokenIssuer
97
+ ? await (0, utils_1.openIdTokenIssuerToJwtIssuer)(agentContext, openIdTokenIssuer)
98
+ : undefined;
99
+ const openidProvider = await this.getOpenIdProvider(agentContext);
100
+ const authorizationResponseWithCorrelationId = await openidProvider.createAuthorizationResponse(authorizationRequest, {
101
+ jwtIssuer,
102
+ presentationExchange: presentationExchangeOptions,
103
+ // https://openid.net/specs/openid-connect-self-issued-v2-1_0.html#name-aud-of-a-request-object
104
+ audience: authorizationRequest.authorizationRequestPayload.client_id,
105
+ });
106
+ const getCreateJarmResponseCallback = (authorizationResponseNonce) => {
107
+ return async (opts) => {
108
+ const { authorizationResponsePayload, requestObjectPayload } = opts;
109
+ const jwk = await did_auth_siop_1.OP.extractEncJwksFromClientMetadata(requestObjectPayload.client_metadata);
110
+ if (!jwk.kty) {
111
+ throw new core_1.CredoError('Missing kty in jwk.');
112
+ }
113
+ const validatedMetadata = did_auth_siop_1.OP.validateJarmMetadata({
114
+ client_metadata: requestObjectPayload.client_metadata,
115
+ server_metadata: {
243
116
  authorization_encryption_alg_values_supported: ['ECDH-ES'],
244
- authorization_encryption_enc_values_supported: ['A128GCM', 'A256GCM', 'A128CBC-HS256'],
117
+ authorization_encryption_enc_values_supported: ['A256GCM', 'A128CBC-HS256'],
245
118
  },
119
+ });
120
+ if (validatedMetadata.type !== 'encrypted') {
121
+ throw new core_1.CredoError('Only encrypted JARM responses are supported.');
246
122
  }
247
- : undefined,
248
- });
249
- const authorizationResponsePayload = response.responseParams;
250
- const authorizationResponse = response.jarm?.responseJwt
251
- ? { response: response.jarm.responseJwt }
252
- : authorizationResponsePayload;
253
- // TODO: we should include more typing here that the user
254
- // still needs to submit the resposne. or as we discussed, split
255
- // this method up in create and submit
256
- if ((0, openid4vp_1.isOpenid4vpAuthorizationRequestDcApi)(authorizationRequest.payload)) {
257
- return {
258
- ok: true,
259
- authorizationResponse,
260
- authorizationResponsePayload,
123
+ // Extract nonce from the request, we use this as the `apv`
124
+ const nonce = authorizationRequest.payload?.nonce;
125
+ if (!nonce || typeof nonce !== 'string') {
126
+ throw new core_1.CredoError('Missing nonce in authorization request payload');
127
+ }
128
+ const jwe = await this.encryptJarmResponse(agentContext, {
129
+ jwkJson: jwk,
130
+ payload: authorizationResponsePayload,
131
+ authorizationRequestNonce: nonce,
132
+ alg: validatedMetadata.client_metadata.authorization_encrypted_response_alg,
133
+ enc: validatedMetadata.client_metadata.authorization_encrypted_response_enc,
134
+ authorizationResponseNonce,
135
+ });
136
+ return { response: jwe };
261
137
  };
262
- }
263
- const result = await openid4vpClient.submitOpenid4vpAuthorizationResponse({
264
- request: authorizationRequest.payload,
265
- response: response.responseParams,
266
- jarm: response.jarm ? { responseJwt: response.jarm.responseJwt } : undefined,
267
- });
268
- const responseText = await result.response
138
+ };
139
+ const response = await openidProvider.submitAuthorizationResponse(authorizationResponseWithCorrelationId, getCreateJarmResponseCallback(authorizationResponseNonce));
140
+ const responseText = await response
269
141
  .clone()
270
142
  .text()
271
143
  .catch(() => null);
272
- const responseJson = (await result.response
144
+ const responseJson = (await response
273
145
  .clone()
274
146
  .json()
275
147
  .catch(() => null));
276
- if (!result.response.ok) {
148
+ if (!response.ok) {
277
149
  return {
278
150
  ok: false,
279
151
  serverResponse: {
280
- status: result.response.status,
152
+ status: response.status,
281
153
  body: responseJson ?? responseText,
282
154
  },
283
- authorizationResponse,
284
- authorizationResponsePayload,
155
+ submittedResponse: authorizationResponseWithCorrelationId.response.payload,
285
156
  };
286
157
  }
287
158
  return {
288
159
  ok: true,
289
160
  serverResponse: {
290
- status: result.response.status,
161
+ status: response.status,
291
162
  body: responseJson ?? {},
292
163
  },
293
- authorizationResponse,
294
- authorizationResponsePayload,
164
+ submittedResponse: authorizationResponseWithCorrelationId.response.payload,
295
165
  redirectUri: responseJson?.redirect_uri,
296
166
  presentationDuringIssuanceSession: responseJson?.presentation_during_issuance_session,
297
167
  };
298
168
  }
169
+ async getOpenIdProvider(agentContext, trustedCertificates) {
170
+ const builder = did_auth_siop_1.OP.builder()
171
+ .withExpiresIn(6000)
172
+ .withIssuer(did_auth_siop_1.ResponseIss.SELF_ISSUED_V2)
173
+ .withResponseMode(did_auth_siop_1.ResponseMode.POST)
174
+ .withSupportedVersions([
175
+ did_auth_siop_1.SupportedVersion.SIOPv2_D11,
176
+ did_auth_siop_1.SupportedVersion.SIOPv2_D12_OID4VP_D18,
177
+ did_auth_siop_1.SupportedVersion.SIOPv2_D12_OID4VP_D20,
178
+ ])
179
+ .withCreateJwtCallback((0, utils_1.getCreateJwtCallback)(agentContext))
180
+ .withVerifyJwtCallback((0, utils_1.getVerifyJwtCallback)(agentContext, trustedCertificates))
181
+ .withHasher(core_1.Hasher.hash);
182
+ const openidProvider = builder.build();
183
+ return openidProvider;
184
+ }
185
+ getOpenIdTokenIssuerFromVerifiablePresentation(verifiablePresentation) {
186
+ let openIdTokenIssuer;
187
+ if (verifiablePresentation instanceof core_1.W3cJsonLdVerifiablePresentation) {
188
+ const [firstProof] = (0, core_1.asArray)(verifiablePresentation.proof);
189
+ if (!firstProof)
190
+ throw new core_1.CredoError('Verifiable presentation does not contain a proof');
191
+ if (!firstProof.verificationMethod.startsWith('did:')) {
192
+ throw new core_1.CredoError('Verifiable presentation proof verificationMethod is not a did. Unable to extract openIdTokenIssuer from verifiable presentation');
193
+ }
194
+ openIdTokenIssuer = {
195
+ method: 'did',
196
+ didUrl: firstProof.verificationMethod,
197
+ };
198
+ }
199
+ else if (verifiablePresentation instanceof core_1.W3cJwtVerifiablePresentation) {
200
+ const kid = verifiablePresentation.jwt.header.kid;
201
+ if (!kid)
202
+ throw new core_1.CredoError('Verifiable Presentation does not contain a kid in the jwt header');
203
+ if (kid.startsWith('#') && verifiablePresentation.presentation.holderId) {
204
+ openIdTokenIssuer = {
205
+ didUrl: `${verifiablePresentation.presentation.holderId}${kid}`,
206
+ method: 'did',
207
+ };
208
+ }
209
+ else if (kid.startsWith('did:')) {
210
+ openIdTokenIssuer = {
211
+ didUrl: kid,
212
+ method: 'did',
213
+ };
214
+ }
215
+ else {
216
+ throw new core_1.CredoError("JWT W3C Verifiable presentation does not include did in JWT header 'kid'. Unable to extract openIdTokenIssuer from verifiable presentation");
217
+ }
218
+ }
219
+ else if (verifiablePresentation instanceof core_1.MdocDeviceResponse) {
220
+ throw new core_1.CredoError('Mdoc Verifiable Presentations are not yet supported');
221
+ }
222
+ else {
223
+ const cnf = verifiablePresentation.payload.cnf;
224
+ // FIXME: SD-JWT VC should have better payload typing, so this doesn't become so ugly
225
+ if (!cnf ||
226
+ typeof cnf !== 'object' ||
227
+ !('kid' in cnf) ||
228
+ typeof cnf.kid !== 'string' ||
229
+ !cnf.kid.startsWith('did:') ||
230
+ !cnf.kid.includes('#')) {
231
+ throw new core_1.CredoError("SD-JWT Verifiable presentation has no 'cnf' claim or does not include 'cnf' claim where 'kid' is a didUrl pointing to a key. Unable to extract openIdTokenIssuer from verifiable presentation");
232
+ }
233
+ openIdTokenIssuer = {
234
+ didUrl: cnf.kid,
235
+ method: 'did',
236
+ };
237
+ }
238
+ return openIdTokenIssuer;
239
+ }
240
+ assertValidTokenIssuer(authorizationRequest, openIdTokenIssuer) {
241
+ const subjectSyntaxTypesSupported = authorizationRequest.registrationMetadataPayload.subject_syntax_types_supported;
242
+ if (!subjectSyntaxTypesSupported) {
243
+ throw new core_1.CredoError('subject_syntax_types_supported is not supplied in the registration metadata. subject_syntax_types is REQUIRED.');
244
+ }
245
+ let allowedSubjectSyntaxTypes = [];
246
+ if (openIdTokenIssuer.method === 'did') {
247
+ const parsedDid = (0, core_1.parseDid)(openIdTokenIssuer.didUrl);
248
+ // Either did:<method> or did (for all did methods) is allowed
249
+ allowedSubjectSyntaxTypes = [`did:${parsedDid.method}`, 'did'];
250
+ }
251
+ else if (openIdTokenIssuer.method === 'jwk') {
252
+ allowedSubjectSyntaxTypes = ['urn:ietf:params:oauth:jwk-thumbprint'];
253
+ }
254
+ else {
255
+ throw new core_1.CredoError("Only 'did' and 'jwk' are supported as openIdTokenIssuer at the moment");
256
+ }
257
+ // At least one of the allowed subject syntax types must be supported by the RP
258
+ if (!allowedSubjectSyntaxTypes.some((allowed) => subjectSyntaxTypesSupported.includes(allowed))) {
259
+ throw new core_1.CredoError([
260
+ 'The provided openIdTokenIssuer is not supported by the relying party.',
261
+ `Supported subject syntax types: '${subjectSyntaxTypesSupported.join(', ')}'`,
262
+ ].join('\n'));
263
+ }
264
+ }
265
+ async encryptJarmResponse(agentContext, options) {
266
+ const { payload, jwkJson } = options;
267
+ const jwk = (0, core_1.getJwkFromJson)(jwkJson);
268
+ const key = jwk.key;
269
+ if (!agentContext.wallet.directEncryptCompactJweEcdhEs) {
270
+ throw new core_1.CredoError('Cannot decrypt Jarm Response, wallet does not support directEncryptCompactJweEcdhEs. You need to upgrade your wallet implementation.');
271
+ }
272
+ if (options.alg !== 'ECDH-ES') {
273
+ throw new core_1.CredoError("Only 'ECDH-ES' is supported as 'alg' value for JARM response encryption");
274
+ }
275
+ if (options.enc !== 'A256GCM' && options.enc !== 'A128CBC-HS256') {
276
+ throw new core_1.CredoError("Only 'A256GCM' and 'A128CBC-HS256' are supported as 'enc' value for JARM response encryption");
277
+ }
278
+ if (key.keyType !== core_1.KeyType.P256) {
279
+ throw new core_1.CredoError(`Only '${core_1.KeyType.P256}' key type is supported for JARM response encryption`);
280
+ }
281
+ const data = core_1.Buffer.from(JSON.stringify(payload));
282
+ const jwe = await agentContext.wallet.directEncryptCompactJweEcdhEs({
283
+ data,
284
+ recipientKey: key,
285
+ header: {
286
+ kid: jwkJson.kid,
287
+ },
288
+ encryptionAlgorithm: options.enc,
289
+ apu: core_1.TypedArrayEncoder.toBase64URL(core_1.TypedArrayEncoder.fromString(options.authorizationResponseNonce)),
290
+ apv: core_1.TypedArrayEncoder.toBase64URL(core_1.TypedArrayEncoder.fromString(options.authorizationRequestNonce)),
291
+ });
292
+ return jwe;
293
+ }
299
294
  };
300
295
  exports.OpenId4VcSiopHolderService = OpenId4VcSiopHolderService;
301
296
  exports.OpenId4VcSiopHolderService = OpenId4VcSiopHolderService = __decorate([
302
297
  (0, core_1.injectable)(),
303
- __metadata("design:paramtypes", [core_1.DifPresentationExchangeService,
304
- core_1.DcqlService])
298
+ __metadata("design:paramtypes", [core_1.DifPresentationExchangeService])
305
299
  ], OpenId4VcSiopHolderService);
306
300
  //# sourceMappingURL=OpenId4vcSiopHolderService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenId4vcSiopHolderService.js","sourceRoot":"","sources":["../../src/openid4vc-holder/OpenId4vcSiopHolderService.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yCAMuB;AACvB,oDAAgH;AAEhH,mDAAwD;AAGjD,IAAM,0BAA0B,GAAhC,MAAM,0BAA0B;IACrC,YACU,2BAA2D,EAC3D,WAAwB;QADxB,gCAA2B,GAA3B,2BAA2B,CAAgC;QAC3D,gBAAW,GAAX,WAAW,CAAa;IAC/B,CAAC;IAEI,kBAAkB,CAAC,YAA0B,EAAE,mBAA8C;QACnG,MAAM,SAAS,GAAG,IAAA,8BAAkB,EAAC,YAAY,EAAE,mBAAmB,CAAC,CAAA;QACvE,OAAO,IAAI,2BAAe,CAAC,EAAE,SAAS,EAAE,CAAC,CAAA;IAC3C,CAAC;IAEO,KAAK,CAAC,iCAAiC,CAC7C,YAA0B,EAC1B,uBAAgC,EAChC,eAAiC;QAEjC,MAAM,sBAAsB,GAAG,uBAA4D,CAAA;QAC3F,IAAI,CAAC,2BAA2B,CAAC,8BAA8B,CAAC,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