@sphereon/oid4vci-client 0.8.2-next.48 → 0.8.2-next.87

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 (47) hide show
  1. package/dist/AccessTokenClient.d.ts +0 -1
  2. package/dist/AccessTokenClient.d.ts.map +1 -1
  3. package/dist/AccessTokenClient.js +2 -9
  4. package/dist/AccessTokenClient.js.map +1 -1
  5. package/dist/AuthorizationCodeClient.d.ts +9 -0
  6. package/dist/AuthorizationCodeClient.d.ts.map +1 -0
  7. package/dist/AuthorizationCodeClient.js +124 -0
  8. package/dist/AuthorizationCodeClient.js.map +1 -0
  9. package/dist/CredentialOfferClient.d.ts.map +1 -1
  10. package/dist/CredentialOfferClient.js +3 -1
  11. package/dist/CredentialOfferClient.js.map +1 -1
  12. package/dist/CredentialRequestClient.d.ts +2 -0
  13. package/dist/CredentialRequestClient.d.ts.map +1 -1
  14. package/dist/CredentialRequestClient.js +9 -7
  15. package/dist/CredentialRequestClient.js.map +1 -1
  16. package/dist/OpenID4VCIClient.d.ts +50 -29
  17. package/dist/OpenID4VCIClient.d.ts.map +1 -1
  18. package/dist/OpenID4VCIClient.js +191 -190
  19. package/dist/OpenID4VCIClient.js.map +1 -1
  20. package/dist/functions/AuthorizationUtil.d.ts +3 -0
  21. package/dist/functions/AuthorizationUtil.d.ts.map +1 -0
  22. package/dist/functions/AuthorizationUtil.js +22 -0
  23. package/dist/functions/AuthorizationUtil.js.map +1 -0
  24. package/dist/index.d.ts +1 -0
  25. package/dist/index.d.ts.map +1 -1
  26. package/dist/index.js +1 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/types/index.d.ts +1 -0
  29. package/dist/types/index.d.ts.map +1 -0
  30. package/dist/types/index.js +2 -0
  31. package/dist/types/index.js.map +1 -0
  32. package/lib/AccessTokenClient.ts +5 -11
  33. package/lib/AuthorizationCodeClient.ts +151 -0
  34. package/lib/CredentialOfferClient.ts +4 -1
  35. package/lib/CredentialRequestClient.ts +13 -4
  36. package/lib/OpenID4VCIClient.ts +250 -228
  37. package/lib/__tests__/AccessTokenClient.spec.ts +2 -0
  38. package/lib/__tests__/CredentialRequestClient.spec.ts +10 -2
  39. package/lib/__tests__/EBSIE2E.spec.test.ts +8 -6
  40. package/lib/__tests__/OpenID4VCIClient.spec.ts +115 -79
  41. package/lib/__tests__/OpenID4VCIClientPAR.spec.ts +59 -49
  42. package/lib/__tests__/SdJwt.spec.ts +2 -0
  43. package/lib/__tests__/SphereonE2E.spec.test.ts +2 -2
  44. package/lib/functions/AuthorizationUtil.ts +18 -0
  45. package/lib/index.ts +1 -0
  46. package/lib/types/index.ts +0 -0
  47. package/package.json +3 -3
@@ -16,56 +16,129 @@ exports.OpenID4VCIClient = void 0;
16
16
  const oid4vci_common_1 = require("@sphereon/oid4vci-common");
17
17
  const debug_1 = __importDefault(require("debug"));
18
18
  const AccessTokenClient_1 = require("./AccessTokenClient");
19
+ const AuthorizationCodeClient_1 = require("./AuthorizationCodeClient");
19
20
  const CredentialOfferClient_1 = require("./CredentialOfferClient");
20
21
  const CredentialRequestClientBuilder_1 = require("./CredentialRequestClientBuilder");
21
22
  const MetadataClient_1 = require("./MetadataClient");
22
23
  const ProofOfPossessionBuilder_1 = require("./ProofOfPossessionBuilder");
23
- const functions_1 = require("./functions");
24
+ const AuthorizationUtil_1 = require("./functions/AuthorizationUtil");
24
25
  const debug = (0, debug_1.default)('sphereon:oid4vci');
25
26
  class OpenID4VCIClient {
26
- constructor({ credentialOffer, clientId, kid, alg, credentialIssuer, }) {
27
- this._credentialOffer = credentialOffer;
27
+ constructor({ credentialOffer, clientId, kid, alg, credentialIssuer, pkce, authorizationRequest, jwk, endpointMetadata, accessTokenResponse, authorizationRequestOpts, authorizationURL, }) {
28
+ var _a;
28
29
  const issuer = credentialIssuer !== null && credentialIssuer !== void 0 ? credentialIssuer : (credentialOffer ? (0, oid4vci_common_1.getIssuerFromCredentialOfferPayload)(credentialOffer.credential_offer) : undefined);
29
30
  if (!issuer) {
30
31
  throw Error('No credential issuer supplied or deduced from offer');
31
32
  }
32
- this._credentialIssuer = issuer;
33
- this._kid = kid;
34
- this._alg = alg;
35
- this._clientId = clientId;
33
+ this._state = {
34
+ credentialOffer,
35
+ credentialIssuer: issuer,
36
+ kid,
37
+ alg,
38
+ // TODO: We need to refactor this and always explicitly call createAuthorizationRequestUrl, so we can have a credential selection first and use the kid as a default for the client id
39
+ clientId: (_a = clientId !== null && clientId !== void 0 ? clientId : (credentialOffer && (0, oid4vci_common_1.getClientIdFromCredentialOfferPayload)(credentialOffer.credential_offer))) !== null && _a !== void 0 ? _a : kid === null || kid === void 0 ? void 0 : kid.split('#')[0],
40
+ pkce: Object.assign({ disabled: false, codeChallengeMethod: oid4vci_common_1.CodeChallengeMethod.S256 }, pkce),
41
+ authorizationRequestOpts,
42
+ jwk,
43
+ endpointMetadata,
44
+ accessTokenResponse,
45
+ authorizationURL,
46
+ };
47
+ // Running syncAuthorizationRequestOpts later as it is using the state
48
+ if (!this._state.authorizationRequestOpts) {
49
+ this._state.authorizationRequestOpts = this.syncAuthorizationRequestOpts(authorizationRequest);
50
+ }
51
+ debug(`Authorization req options: ${JSON.stringify(this._state.authorizationRequestOpts, null, 2)}`);
36
52
  }
37
- static fromCredentialIssuer({ kid, alg, retrieveServerMetadata, clientId, credentialIssuer, }) {
53
+ static fromCredentialIssuer({ kid, alg, retrieveServerMetadata, clientId, credentialIssuer, pkce, authorizationRequest, createAuthorizationRequestURL, }) {
38
54
  return __awaiter(this, void 0, void 0, function* () {
39
- const client = new OpenID4VCIClient({ kid, alg, clientId, credentialIssuer });
55
+ const client = new OpenID4VCIClient({
56
+ kid,
57
+ alg,
58
+ clientId: clientId !== null && clientId !== void 0 ? clientId : authorizationRequest === null || authorizationRequest === void 0 ? void 0 : authorizationRequest.clientId,
59
+ credentialIssuer,
60
+ pkce,
61
+ authorizationRequest,
62
+ });
40
63
  if (retrieveServerMetadata === undefined || retrieveServerMetadata) {
41
64
  yield client.retrieveServerMetadata();
42
65
  }
66
+ if (createAuthorizationRequestURL === undefined || createAuthorizationRequestURL) {
67
+ yield client.createAuthorizationRequestUrl({ authorizationRequest, pkce });
68
+ }
43
69
  return client;
44
70
  });
45
71
  }
46
- static fromURI({ uri, kid, alg, retrieveServerMetadata, clientId, resolveOfferUri, }) {
72
+ static fromState({ state }) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const clientState = typeof state === 'string' ? JSON.parse(state) : state;
75
+ return new OpenID4VCIClient(clientState);
76
+ });
77
+ }
78
+ static fromURI({ uri, kid, alg, retrieveServerMetadata, clientId, pkce, createAuthorizationRequestURL, authorizationRequest, resolveOfferUri, }) {
79
+ var _a;
47
80
  return __awaiter(this, void 0, void 0, function* () {
81
+ const credentialOfferClient = yield CredentialOfferClient_1.CredentialOfferClient.fromURI(uri, { resolve: resolveOfferUri });
48
82
  const client = new OpenID4VCIClient({
49
- credentialOffer: yield CredentialOfferClient_1.CredentialOfferClient.fromURI(uri, { resolve: resolveOfferUri }),
83
+ credentialOffer: credentialOfferClient,
50
84
  kid,
51
85
  alg,
52
- clientId,
86
+ clientId: (_a = clientId !== null && clientId !== void 0 ? clientId : authorizationRequest === null || authorizationRequest === void 0 ? void 0 : authorizationRequest.clientId) !== null && _a !== void 0 ? _a : credentialOfferClient.clientId,
87
+ pkce,
88
+ authorizationRequest,
53
89
  });
54
90
  if (retrieveServerMetadata === undefined || retrieveServerMetadata) {
55
91
  yield client.retrieveServerMetadata();
56
92
  }
93
+ if (credentialOfferClient.supportedFlows.includes(oid4vci_common_1.AuthzFlowType.AUTHORIZATION_CODE_FLOW) &&
94
+ (createAuthorizationRequestURL === undefined || createAuthorizationRequestURL)) {
95
+ yield client.createAuthorizationRequestUrl({ authorizationRequest, pkce });
96
+ debug(`Authorization Request URL: ${client._state.authorizationURL}`);
97
+ }
57
98
  return client;
58
99
  });
59
100
  }
101
+ /**
102
+ * Allows you to create an Authorization Request URL when using an Authorization Code flow. This URL needs to be accessed using the front channel (browser)
103
+ *
104
+ * The Identity provider would present a login screen typically; after you authenticated, it would redirect to the provided redirectUri; which can be same device or cross-device
105
+ * @param opts
106
+ */
107
+ createAuthorizationRequestUrl(opts) {
108
+ var _a;
109
+ return __awaiter(this, void 0, void 0, function* () {
110
+ if (!this._state.authorizationURL) {
111
+ this.calculatePKCEOpts(opts === null || opts === void 0 ? void 0 : opts.pkce);
112
+ this._state.authorizationRequestOpts = this.syncAuthorizationRequestOpts(opts === null || opts === void 0 ? void 0 : opts.authorizationRequest);
113
+ if (!this._state.authorizationRequestOpts) {
114
+ throw Error(`No Authorization Request options present or provided in this call`);
115
+ }
116
+ // todo: Probably can go with current logic in MetadataClient who will always set the authorization_endpoint when found
117
+ // handling this because of the support for v1_0-08
118
+ if (((_a = this._state.endpointMetadata) === null || _a === void 0 ? void 0 : _a.credentialIssuerMetadata) &&
119
+ 'authorization_endpoint' in this._state.endpointMetadata.credentialIssuerMetadata) {
120
+ this._state.endpointMetadata.authorization_endpoint = this._state.endpointMetadata.credentialIssuerMetadata.authorization_endpoint;
121
+ }
122
+ this._state.authorizationURL = yield (0, AuthorizationCodeClient_1.createAuthorizationRequestUrl)({
123
+ pkce: this._state.pkce,
124
+ endpointMetadata: this.endpointMetadata,
125
+ authorizationRequest: this._state.authorizationRequestOpts,
126
+ credentialOffer: this.credentialOffer,
127
+ credentialsSupported: this.getCredentialsSupported(true),
128
+ });
129
+ }
130
+ return this._state.authorizationURL;
131
+ });
132
+ }
60
133
  retrieveServerMetadata() {
61
134
  return __awaiter(this, void 0, void 0, function* () {
62
135
  this.assertIssuerData();
63
- if (!this._endpointMetadata) {
136
+ if (!this._state.endpointMetadata) {
64
137
  if (this.credentialOffer) {
65
- this._endpointMetadata = yield MetadataClient_1.MetadataClient.retrieveAllMetadataFromCredentialOffer(this.credentialOffer);
138
+ this._state.endpointMetadata = yield MetadataClient_1.MetadataClient.retrieveAllMetadataFromCredentialOffer(this.credentialOffer);
66
139
  }
67
- else if (this._credentialIssuer) {
68
- this._endpointMetadata = yield MetadataClient_1.MetadataClient.retrieveAllMetadata(this._credentialIssuer);
140
+ else if (this._state.credentialIssuer) {
141
+ this._state.endpointMetadata = yield MetadataClient_1.MetadataClient.retrieveAllMetadata(this._state.credentialIssuer);
69
142
  }
70
143
  else {
71
144
  throw Error(`Cannot retrieve issuer metadata without either a credential offer, or issuer value`);
@@ -74,179 +147,57 @@ class OpenID4VCIClient {
74
147
  return this.endpointMetadata;
75
148
  });
76
149
  }
77
- // todo: Unify this method with the par method
78
- createAuthorizationRequestUrl({ codeChallengeMethod, codeChallenge, authorizationDetails, redirectUri, scope }) {
79
- var _a, _b;
80
- // Scope and authorization_details can be used in the same authorization request
81
- // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-rar-23#name-relationship-to-scope-param
82
- if (!scope && !authorizationDetails) {
83
- if (!this.credentialOffer) {
84
- throw Error('Please provide a scope or authorization_details');
85
- }
86
- const creds = this.credentialOffer.credential_offer.credentials;
87
- authorizationDetails = creds
88
- .flatMap((cred) => (typeof cred === 'string' ? this.getCredentialsSupported(true) : cred))
89
- .map((cred) => {
90
- return Object.assign(Object.assign({}, cred), { type: 'openid_credential', locations: [this._credentialIssuer], format: cred.format });
91
- });
92
- if (authorizationDetails.length === 0) {
93
- throw Error(`Could not create authorization details from credential offer. Please pass in explicit details`);
94
- }
95
- }
96
- // todo: Probably can go with current logic in MetadataClient who will always set the authorization_endpoint when found
97
- // handling this because of the support for v1_0-08
98
- if (this._endpointMetadata &&
99
- this._endpointMetadata.credentialIssuerMetadata &&
100
- 'authorization_endpoint' in this._endpointMetadata.credentialIssuerMetadata) {
101
- this._endpointMetadata.authorization_endpoint = this._endpointMetadata.credentialIssuerMetadata.authorization_endpoint;
102
- }
103
- if (!((_a = this._endpointMetadata) === null || _a === void 0 ? void 0 : _a.authorization_endpoint)) {
104
- throw Error('Server metadata does not contain authorization endpoint');
105
- }
106
- // add 'openid' scope if not present
107
- if (!(scope === null || scope === void 0 ? void 0 : scope.includes('openid'))) {
108
- scope = ['openid', scope].filter((s) => !!s).join(' ');
109
- }
110
- const queryObj = {
111
- response_type: oid4vci_common_1.ResponseType.AUTH_CODE,
112
- code_challenge_method: codeChallengeMethod !== null && codeChallengeMethod !== void 0 ? codeChallengeMethod : oid4vci_common_1.CodeChallengeMethod.SHA256,
113
- code_challenge: codeChallenge,
114
- authorization_details: JSON.stringify(this.handleAuthorizationDetails(authorizationDetails)),
115
- redirect_uri: redirectUri,
116
- scope: scope,
117
- };
118
- if (this.clientId) {
119
- queryObj['client_id'] = this.clientId;
120
- }
121
- if ((_b = this.credentialOffer) === null || _b === void 0 ? void 0 : _b.issuerState) {
122
- queryObj['issuer_state'] = this.credentialOffer.issuerState;
123
- }
124
- return (0, functions_1.convertJsonToURI)(queryObj, {
125
- baseUrl: this._endpointMetadata.authorization_endpoint,
126
- uriTypeProperties: ['redirect_uri', 'scope', 'authorization_details', 'issuer_state'],
127
- mode: oid4vci_common_1.JsonURIMode.X_FORM_WWW_URLENCODED,
128
- // We do not add the version here, as this always needs to be form encoded
129
- });
130
- }
131
- // todo: Unify this method with the create auth request url method
132
- acquirePushedAuthorizationRequestURI({ codeChallengeMethod, codeChallenge, authorizationDetails, redirectUri, scope, }) {
133
- var _a, _b, _c;
134
- return __awaiter(this, void 0, void 0, function* () {
135
- // Scope and authorization_details can be used in the same authorization request
136
- // https://datatracker.ietf.org/doc/html/draft-ietf-oauth-rar-23#name-relationship-to-scope-param
137
- if (!scope && !authorizationDetails) {
138
- throw Error('Please provide a scope or authorization_details');
139
- }
140
- // Authorization servers supporting PAR SHOULD include the URL of their pushed authorization request endpoint in their authorization server metadata document
141
- // Note that the presence of pushed_authorization_request_endpoint is sufficient for a client to determine that it may use the PAR flow.
142
- // What happens if it doesn't ???
143
- // let parEndpoint: string
144
- if (!((_a = this._endpointMetadata) === null || _a === void 0 ? void 0 : _a.credentialIssuerMetadata) ||
145
- !('pushed_authorization_request_endpoint' in this._endpointMetadata.credentialIssuerMetadata) ||
146
- typeof this._endpointMetadata.credentialIssuerMetadata.pushed_authorization_request_endpoint !== 'string') {
147
- throw Error('Server metadata does not contain pushed authorization request endpoint');
148
- }
149
- const parEndpoint = this._endpointMetadata.credentialIssuerMetadata.pushed_authorization_request_endpoint;
150
- // add 'openid' scope if not present
151
- if (!(scope === null || scope === void 0 ? void 0 : scope.includes('openid'))) {
152
- scope = ['openid', scope].filter((s) => !!s).join(' ');
153
- }
154
- const queryObj = {
155
- response_type: oid4vci_common_1.ResponseType.AUTH_CODE,
156
- code_challenge_method: codeChallengeMethod !== null && codeChallengeMethod !== void 0 ? codeChallengeMethod : oid4vci_common_1.CodeChallengeMethod.SHA256,
157
- code_challenge: codeChallenge,
158
- authorization_details: JSON.stringify(this.handleAuthorizationDetails(authorizationDetails)),
159
- redirect_uri: redirectUri,
160
- scope: scope,
161
- };
162
- if (this.clientId) {
163
- queryObj['client_id'] = this.clientId;
164
- }
165
- if ((_b = this.credentialOffer) === null || _b === void 0 ? void 0 : _b.issuerState) {
166
- queryObj['issuer_state'] = this.credentialOffer.issuerState;
167
- }
168
- const response = yield (0, functions_1.formPost)(parEndpoint, new URLSearchParams(queryObj));
169
- return (0, functions_1.convertJsonToURI)({ request_uri: (_c = response.successBody) === null || _c === void 0 ? void 0 : _c.request_uri }, {
170
- baseUrl: this._endpointMetadata.credentialIssuerMetadata.authorization_endpoint,
171
- uriTypeProperties: ['request_uri'],
172
- mode: oid4vci_common_1.JsonURIMode.X_FORM_WWW_URLENCODED,
173
- });
174
- });
175
- }
176
- handleAuthorizationDetails(authorizationDetails) {
177
- if (authorizationDetails) {
178
- if (Array.isArray(authorizationDetails)) {
179
- return authorizationDetails.map((value) => this.handleLocations(Object.assign({}, value)));
180
- }
181
- else {
182
- return this.handleLocations(Object.assign({}, authorizationDetails));
183
- }
184
- }
185
- return authorizationDetails;
186
- }
187
- handleLocations(authorizationDetails) {
188
- var _a;
189
- if (authorizationDetails &&
190
- (((_a = this.endpointMetadata.credentialIssuerMetadata) === null || _a === void 0 ? void 0 : _a.authorization_server) || this.endpointMetadata.authorization_endpoint)) {
191
- if (authorizationDetails.locations) {
192
- if (Array.isArray(authorizationDetails.locations)) {
193
- authorizationDetails.locations.push(this.endpointMetadata.issuer);
194
- }
195
- else {
196
- authorizationDetails.locations = [authorizationDetails.locations, this.endpointMetadata.issuer];
197
- }
198
- }
199
- else {
200
- authorizationDetails.locations = this.endpointMetadata.issuer;
201
- }
202
- }
203
- return authorizationDetails;
150
+ calculatePKCEOpts(pkce) {
151
+ this._state.pkce = (0, AuthorizationUtil_1.generateMissingPKCEOpts)(Object.assign(Object.assign({}, this._state.pkce), pkce));
204
152
  }
205
153
  acquireAccessToken(opts) {
206
- var _a, _b;
154
+ var _a, _b, _c, _d, _e, _f;
207
155
  return __awaiter(this, void 0, void 0, function* () {
208
- const { pin, clientId, codeVerifier, code, redirectUri } = opts !== null && opts !== void 0 ? opts : {};
156
+ const { pin, clientId } = opts !== null && opts !== void 0 ? opts : {};
157
+ let { redirectUri } = opts !== null && opts !== void 0 ? opts : {};
158
+ const code = (_a = opts === null || opts === void 0 ? void 0 : opts.code) !== null && _a !== void 0 ? _a : ((opts === null || opts === void 0 ? void 0 : opts.authorizationResponse) ? (0, oid4vci_common_1.toAuthorizationResponsePayload)(opts.authorizationResponse).code : undefined);
159
+ if (opts === null || opts === void 0 ? void 0 : opts.codeVerifier) {
160
+ this._state.pkce.codeVerifier = opts.codeVerifier;
161
+ }
209
162
  this.assertIssuerData();
210
163
  if (clientId) {
211
- this._clientId = clientId;
164
+ this._state.clientId = clientId;
212
165
  }
213
- if (!this._accessTokenResponse) {
166
+ if (!this._state.accessTokenResponse) {
214
167
  const accessTokenClient = new AccessTokenClient_1.AccessTokenClient();
215
- const response = yield accessTokenClient.acquireAccessToken({
216
- credentialOffer: this.credentialOffer,
217
- metadata: this.endpointMetadata,
218
- credentialIssuer: this.getIssuer(),
219
- pin,
220
- codeVerifier,
221
- code,
222
- redirectUri,
223
- asOpts: { clientId },
224
- });
168
+ if (redirectUri && redirectUri !== ((_b = this._state.authorizationRequestOpts) === null || _b === void 0 ? void 0 : _b.redirectUri)) {
169
+ console.log(`Redirect URI mismatch between access-token (${redirectUri}) and authorization request (${(_c = this._state.authorizationRequestOpts) === null || _c === void 0 ? void 0 : _c.redirectUri}). According to the specification that is not allowed.`);
170
+ }
171
+ if (((_d = this._state.authorizationRequestOpts) === null || _d === void 0 ? void 0 : _d.redirectUri) && !redirectUri) {
172
+ redirectUri = this._state.authorizationRequestOpts.redirectUri;
173
+ }
174
+ const response = yield accessTokenClient.acquireAccessToken(Object.assign(Object.assign({ credentialOffer: this.credentialOffer, metadata: this.endpointMetadata, credentialIssuer: this.getIssuer(), pin }, (!this._state.pkce.disabled && { codeVerifier: this._state.pkce.codeVerifier })), { code,
175
+ redirectUri, asOpts: { clientId: this.clientId } }));
225
176
  if (response.errorBody) {
226
177
  debug(`Access token error:\r\n${response.errorBody}`);
227
- throw Error(`Retrieving an access token from ${(_a = this._endpointMetadata) === null || _a === void 0 ? void 0 : _a.token_endpoint} for issuer ${this.getIssuer()} failed with status: ${response.origResponse.status}`);
178
+ throw Error(`Retrieving an access token from ${(_e = this._state.endpointMetadata) === null || _e === void 0 ? void 0 : _e.token_endpoint} for issuer ${this.getIssuer()} failed with status: ${response.origResponse.status}`);
228
179
  }
229
180
  else if (!response.successBody) {
230
181
  debug(`Access token error. No success body`);
231
- throw Error(`Retrieving an access token from ${(_b = this._endpointMetadata) === null || _b === void 0 ? void 0 : _b.token_endpoint} for issuer ${this.getIssuer()} failed as there was no success response body`);
182
+ throw Error(`Retrieving an access token from ${(_f = this._state.endpointMetadata) === null || _f === void 0 ? void 0 : _f.token_endpoint} for issuer ${this.getIssuer()} failed as there was no success response body`);
232
183
  }
233
- this._accessTokenResponse = response.successBody;
184
+ this._state.accessTokenResponse = response.successBody;
234
185
  }
235
186
  return this.accessTokenResponse;
236
187
  });
237
188
  }
238
- acquireCredentials({ credentialTypes, proofCallbacks, format, kid, jwk, alg, jti, deferredCredentialAwait, deferredCredentialIntervalInMS, }) {
189
+ acquireCredentials({ credentialTypes, context, proofCallbacks, format, kid, jwk, alg, jti, deferredCredentialAwait, deferredCredentialIntervalInMS, }) {
239
190
  var _a, _b, _c;
240
191
  return __awaiter(this, void 0, void 0, function* () {
241
192
  if ([jwk, kid].filter((v) => v !== undefined).length > 1) {
242
193
  throw new Error(oid4vci_common_1.KID_JWK_X5C_ERROR + `. jwk: ${jwk !== undefined}, kid: ${kid !== undefined}`);
243
194
  }
244
195
  if (alg)
245
- this._alg = alg;
196
+ this._state.alg = alg;
246
197
  if (jwk)
247
- this._jwk = jwk;
198
+ this._state.jwk = jwk;
248
199
  if (kid)
249
- this._kid = kid;
200
+ this._state.kid = kid;
250
201
  const requestBuilder = this.credentialOffer
251
202
  ? CredentialRequestClientBuilder_1.CredentialRequestClientBuilder.fromCredentialOffer({
252
203
  credentialOffer: this.credentialOffer,
@@ -262,12 +213,12 @@ class OpenID4VCIClient {
262
213
  requestBuilder.withDeferredCredentialAwait(deferredCredentialAwait !== null && deferredCredentialAwait !== void 0 ? deferredCredentialAwait : false, deferredCredentialIntervalInMS);
263
214
  if ((_a = this.endpointMetadata) === null || _a === void 0 ? void 0 : _a.credentialIssuerMetadata) {
264
215
  const metadata = this.endpointMetadata.credentialIssuerMetadata;
265
- const types = Array.isArray(credentialTypes) ? [...credentialTypes].sort() : [credentialTypes];
216
+ const types = Array.isArray(credentialTypes) ? credentialTypes : [credentialTypes];
266
217
  if (metadata.credentials_supported && Array.isArray(metadata.credentials_supported)) {
267
218
  let typeSupported = false;
268
219
  metadata.credentials_supported.forEach((supportedCredential) => {
269
220
  const subTypes = (0, oid4vci_common_1.getTypesFromCredentialSupported)(supportedCredential);
270
- if (subTypes.sort().every((t, i) => types[i] === t) ||
221
+ if (subTypes.every((t, i) => types[i] === t) ||
271
222
  (types.length === 1 && (types[0] === supportedCredential.id || subTypes.includes(types[0])))) {
272
223
  typeSupported = true;
273
224
  }
@@ -293,11 +244,11 @@ class OpenID4VCIClient {
293
244
  })
294
245
  .withIssuer(this.getIssuer())
295
246
  .withAlg(this.alg);
296
- if (this._jwk) {
297
- proofBuilder.withJWK(this._jwk);
247
+ if (this._state.jwk) {
248
+ proofBuilder.withJWK(this._state.jwk);
298
249
  }
299
- if (this._kid) {
300
- proofBuilder.withKid(this._kid);
250
+ if (this._state.kid) {
251
+ proofBuilder.withKid(this._state.kid);
301
252
  }
302
253
  if (this.clientId) {
303
254
  proofBuilder.withClientId(this.clientId);
@@ -307,20 +258,26 @@ class OpenID4VCIClient {
307
258
  }
308
259
  const response = yield credentialRequestClient.acquireCredentialsUsingProof({
309
260
  proofInput: proofBuilder,
310
- credentialTypes: credentialTypes,
261
+ credentialTypes,
262
+ context,
311
263
  format,
312
264
  });
313
265
  if (response.errorBody) {
314
266
  debug(`Credential request error:\r\n${JSON.stringify(response.errorBody)}`);
315
- throw Error(`Retrieving a credential from ${(_b = this._endpointMetadata) === null || _b === void 0 ? void 0 : _b.credential_endpoint} for issuer ${this.getIssuer()} failed with status: ${response.origResponse.status}`);
267
+ throw Error(`Retrieving a credential from ${(_b = this._state.endpointMetadata) === null || _b === void 0 ? void 0 : _b.credential_endpoint} for issuer ${this.getIssuer()} failed with status: ${response.origResponse.status}`);
316
268
  }
317
269
  else if (!response.successBody) {
318
270
  debug(`Credential request error. No success body`);
319
- throw Error(`Retrieving a credential from ${(_c = this._endpointMetadata) === null || _c === void 0 ? void 0 : _c.credential_endpoint} for issuer ${this.getIssuer()} failed as there was no success response body`);
271
+ throw Error(`Retrieving a credential from ${(_c = this._state.endpointMetadata) === null || _c === void 0 ? void 0 : _c.credential_endpoint} for issuer ${this.getIssuer()} failed as there was no success response body`);
320
272
  }
321
273
  return response.successBody;
322
274
  });
323
275
  }
276
+ exportState() {
277
+ return __awaiter(this, void 0, void 0, function* () {
278
+ return JSON.stringify(this._state);
279
+ });
280
+ }
324
281
  // FIXME: We really should convert <v11 to v12 objects first. Right now the logic doesn't map nicely and is brittle.
325
282
  // We should resolve IDs to objects first in case of strings.
326
283
  // When < v11 convert into a v12 object. When v12 object retain it.
@@ -362,11 +319,20 @@ class OpenID4VCIClient {
362
319
  }
363
320
  }
364
321
  issuerSupportedFlowTypes() {
365
- var _a, _b;
366
- return (_b = (_a = this.credentialOffer) === null || _a === void 0 ? void 0 : _a.supportedFlows) !== null && _b !== void 0 ? _b : [oid4vci_common_1.AuthzFlowType.AUTHORIZATION_CODE_FLOW];
322
+ var _a, _b, _c, _d;
323
+ return ((_b = (_a = this.credentialOffer) === null || _a === void 0 ? void 0 : _a.supportedFlows) !== null && _b !== void 0 ? _b : (((_d = (_c = this._state.endpointMetadata) === null || _c === void 0 ? void 0 : _c.credentialIssuerMetadata) === null || _d === void 0 ? void 0 : _d.authorization_endpoint) ? [oid4vci_common_1.AuthzFlowType.AUTHORIZATION_CODE_FLOW] : []));
324
+ }
325
+ isFlowTypeSupported(flowType) {
326
+ return this.issuerSupportedFlowTypes().includes(flowType);
327
+ }
328
+ get authorizationURL() {
329
+ return this._state.authorizationURL;
330
+ }
331
+ hasAuthorizationURL() {
332
+ return !!this.authorizationURL;
367
333
  }
368
334
  get credentialOffer() {
369
- return this._credentialOffer;
335
+ return this._state.credentialOffer;
370
336
  }
371
337
  version() {
372
338
  var _a, _b;
@@ -375,33 +341,39 @@ class OpenID4VCIClient {
375
341
  get endpointMetadata() {
376
342
  this.assertServerMetadata();
377
343
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
378
- return this._endpointMetadata;
344
+ return this._state.endpointMetadata;
379
345
  }
380
346
  get kid() {
381
347
  this.assertIssuerData();
382
- if (!this._kid) {
348
+ if (!this._state.kid) {
383
349
  throw new Error('No value for kid is supplied');
384
350
  }
385
- return this._kid;
351
+ return this._state.kid;
386
352
  }
387
353
  get alg() {
388
354
  this.assertIssuerData();
389
- if (!this._alg) {
355
+ if (!this._state.alg) {
390
356
  throw new Error('No value for alg is supplied');
391
357
  }
392
- return this._alg;
358
+ return this._state.alg;
359
+ }
360
+ set clientId(value) {
361
+ this._state.clientId = value;
393
362
  }
394
363
  get clientId() {
395
- return this._clientId;
364
+ return this._state.clientId;
365
+ }
366
+ hasAccessTokenResponse() {
367
+ return !!this._state.accessTokenResponse;
396
368
  }
397
369
  get accessTokenResponse() {
398
370
  this.assertAccessToken();
399
371
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
400
- return this._accessTokenResponse;
372
+ return this._state.accessTokenResponse;
401
373
  }
402
374
  getIssuer() {
403
375
  this.assertIssuerData();
404
- return this._credentialIssuer;
376
+ return this._state.credentialIssuer;
405
377
  }
406
378
  getAccessTokenEndpoint() {
407
379
  this.assertIssuerData();
@@ -420,24 +392,53 @@ class OpenID4VCIClient {
420
392
  this.assertIssuerData();
421
393
  return this.endpointMetadata ? this.endpointMetadata.credential_endpoint : `${this.getIssuer()}/credential`;
422
394
  }
423
- assertIssuerData() {
424
- if (!this._credentialOffer && this.issuerSupportedFlowTypes().includes(oid4vci_common_1.AuthzFlowType.PRE_AUTHORIZED_CODE_FLOW)) {
425
- throw Error(`No issuance initiation or credential offer present`);
395
+ /**
396
+ * Too bad we need a method like this, but EBSI is not exposing metadata
397
+ */
398
+ isEBSI() {
399
+ var _a, _b, _c;
400
+ if ((_a = this.credentialOffer) === null || _a === void 0 ? void 0 : _a.credential_offer.credentials.find((cred) =>
401
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
402
+ // @ts-ignore
403
+ typeof cred !== 'string' && 'trust_framework' in cred && 'name' in cred.trust_framework && cred.trust_framework.name.includes('ebsi'))) {
404
+ return true;
426
405
  }
427
- else if (!this._credentialIssuer) {
406
+ this.assertIssuerData();
407
+ return (_c = (_b = this.endpointMetadata.credentialIssuerMetadata) === null || _b === void 0 ? void 0 : _b.authorization_endpoint) === null || _c === void 0 ? void 0 : _c.includes('ebsi.eu');
408
+ }
409
+ assertIssuerData() {
410
+ if (!this._state.credentialIssuer) {
428
411
  throw Error(`No credential issuer value present`);
429
412
  }
413
+ else if (!this._state.credentialOffer && this._state.endpointMetadata && this.issuerSupportedFlowTypes().length === 0) {
414
+ throw Error(`No issuance initiation or credential offer present`);
415
+ }
430
416
  }
431
417
  assertServerMetadata() {
432
- if (!this._endpointMetadata) {
418
+ if (!this._state.endpointMetadata) {
433
419
  throw Error('No server metadata');
434
420
  }
435
421
  }
436
422
  assertAccessToken() {
437
- if (!this._accessTokenResponse) {
423
+ if (!this._state.accessTokenResponse) {
438
424
  throw Error(`No access token present`);
439
425
  }
440
426
  }
427
+ syncAuthorizationRequestOpts(opts) {
428
+ var _a, _b;
429
+ let authorizationRequestOpts = Object.assign(Object.assign({}, (_a = this._state) === null || _a === void 0 ? void 0 : _a.authorizationRequestOpts), opts);
430
+ if (!authorizationRequestOpts) {
431
+ // We only set a redirectUri if no options are provided.
432
+ // Note that this only works for mobile apps, that can handle a code query param on the default openid-credential-offer deeplink.
433
+ // Provide your own options if that is not desired!
434
+ authorizationRequestOpts = { redirectUri: `${oid4vci_common_1.DefaultURISchemes.CREDENTIAL_OFFER}://` };
435
+ }
436
+ const clientId = (_b = authorizationRequestOpts.clientId) !== null && _b !== void 0 ? _b : this._state.clientId;
437
+ // sync clientId
438
+ this._state.clientId = clientId;
439
+ authorizationRequestOpts.clientId = clientId;
440
+ return authorizationRequestOpts;
441
+ }
441
442
  }
442
443
  exports.OpenID4VCIClient = OpenID4VCIClient;
443
444
  //# sourceMappingURL=OpenID4VCIClient.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OpenID4VCIClient.js","sourceRoot":"","sources":["../lib/OpenID4VCIClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6DAqBkC;AAElC,kDAA0B;AAE1B,2DAAwD;AACxD,mEAAgE;AAChE,qFAAkF;AAClF,qDAAkD;AAClD,yEAAsE;AACtE,2CAAyD;AAEzD,MAAM,KAAK,GAAG,IAAA,eAAK,EAAC,kBAAkB,CAAC,CAAC;AAkBxC,MAAa,gBAAgB;I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pE,CAAC;IACH,CAAC;IAEO,oBAAoB;QAC1B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAClC,MAAM,KAAK,CAAC,oBAAoB,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAEO,iBAAiB;QACvB,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;YACrC,MAAM,KAAK,CAAC,yBAAyB,CAAC,CAAC;QACzC,CAAC;IACH,CAAC;IAEO,4BAA4B,CAAC,IAA+B;;QAClE,IAAI,wBAAwB,GAAG,gCAAK,MAAA,IAAI,CAAC,MAAM,0CAAE,wBAAwB,GAAK,IAAI,CAA8B,CAAC;QACjH,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAC9B,wDAAwD;YACxD,iIAAiI;YACjI,mDAAmD;YACnD,wBAAwB,GAAG,EAAE,WAAW,EAAE,GAAG,kCAAiB,CAAC,gBAAgB,KAAK,EAAE,CAAC;QACzF,CAAC;QACD,MAAM,QAAQ,GAAG,MAAA,wBAAwB,CAAC,QAAQ,mCAAI,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QAC3E,gBAAgB;QAChB,IAAI,CAAC,MAAM,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAChC,wBAAwB,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC7C,OAAO,wBAAwB,CAAC;IAClC,CAAC;CACF;AArjBD,4CAqjBC"}
@@ -0,0 +1,3 @@
1
+ import { PKCEOpts } from '@sphereon/oid4vci-common';
2
+ export declare const generateMissingPKCEOpts: (pkce: PKCEOpts) => PKCEOpts;
3
+ //# sourceMappingURL=AuthorizationUtil.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorizationUtil.d.ts","sourceRoot":"","sources":["../../lib/functions/AuthorizationUtil.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2F,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAE7I,eAAO,MAAM,uBAAuB,SAAU,QAAQ,aAerD,CAAC"}