@azure/msal-node 1.14.3 → 1.14.5
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/cache/serializer/Deserializer.d.ts.map +1 -1
- package/dist/cache/serializer/Serializer.d.ts.map +1 -1
- package/dist/cache/serializer/SerializerTypes.d.ts +1 -0
- package/dist/cache/serializer/SerializerTypes.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/msal-node.cjs.development.js +95 -38
- package/dist/msal-node.cjs.development.js.map +1 -1
- package/dist/msal-node.cjs.production.min.js +1 -1
- package/dist/msal-node.cjs.production.min.js.map +1 -1
- package/dist/msal-node.esm.js +95 -38
- package/dist/msal-node.esm.js.map +1 -1
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/utils/Constants.d.ts +12 -2
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/NetworkUtils.d.ts +2 -5
- package/dist/utils/NetworkUtils.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Deserializer.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/Deserializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAwG,MAAM,oBAAoB,CAAC;AAC1O,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEvM;;GAEG;AACH,qBAAa,YAAY;IACrB;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAOvD;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAA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GAAG,gBAAgB;IAmBzG;;;OAGG;IACH,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa;CAmBlE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Serializer.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/Serializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEvM,qBAAa,UAAU;IACnB;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM;IAIjD;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;IAqBzF;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC;IAiBzF;;;OAGG;IACH,MAAM,CAAC,qBAAqB,CAAC,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"Serializer.d.ts","sourceRoot":"","sources":["../../src/cache/serializer/Serializer.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACvH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEvM,qBAAa,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W,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;;GAGG;AACH,oBAAY,2BAA2B,GAAG;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../src/client/PublicClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EAEH,oBAAoB,EAQvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAInE;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,wBAAwB;IAC9F;;;;;;;;;;;;;;;;OAgBG;gBACS,aAAa,EAAE,aAAa;IAIxC;;;;;;;;OAQG;IACU,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAwBvG;;OAEG;IACG,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../src/client/PublicClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EAEH,oBAAoB,EAQvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAGjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAInE;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,wBAAwB;IAC9F;;;;;;;;;;;;;;;;OAgBG;gBACS,aAAa,EAAE,aAAa;IAIxC;;;;;;;;OAQG;IACU,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAwBvG;;OAEG;IACG,uBAAuB,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAsC5F"}
|
|
@@ -30,9 +30,22 @@ var HttpMethod;
|
|
|
30
30
|
var HttpStatus;
|
|
31
31
|
|
|
32
32
|
(function (HttpStatus) {
|
|
33
|
-
HttpStatus[HttpStatus["
|
|
33
|
+
HttpStatus[HttpStatus["SUCCESS_RANGE_START"] = 200] = "SUCCESS_RANGE_START";
|
|
34
|
+
HttpStatus[HttpStatus["SUCCESS_RANGE_END"] = 299] = "SUCCESS_RANGE_END";
|
|
34
35
|
HttpStatus[HttpStatus["REDIRECT"] = 302] = "REDIRECT";
|
|
36
|
+
HttpStatus[HttpStatus["CLIENT_ERROR_RANGE_START"] = 400] = "CLIENT_ERROR_RANGE_START";
|
|
37
|
+
HttpStatus[HttpStatus["CLIENT_ERROR_RANGE_END"] = 499] = "CLIENT_ERROR_RANGE_END";
|
|
38
|
+
HttpStatus[HttpStatus["SERVER_ERROR_RANGE_START"] = 500] = "SERVER_ERROR_RANGE_START";
|
|
39
|
+
HttpStatus[HttpStatus["SERVER_ERROR_RANGE_END"] = 599] = "SERVER_ERROR_RANGE_END";
|
|
35
40
|
})(HttpStatus || (HttpStatus = {}));
|
|
41
|
+
|
|
42
|
+
var ProxyStatus;
|
|
43
|
+
|
|
44
|
+
(function (ProxyStatus) {
|
|
45
|
+
ProxyStatus[ProxyStatus["SUCCESS_RANGE_START"] = 200] = "SUCCESS_RANGE_START";
|
|
46
|
+
ProxyStatus[ProxyStatus["SUCCESS_RANGE_END"] = 299] = "SUCCESS_RANGE_END";
|
|
47
|
+
ProxyStatus[ProxyStatus["SERVER_ERROR"] = 500] = "SERVER_ERROR";
|
|
48
|
+
})(ProxyStatus || (ProxyStatus = {}));
|
|
36
49
|
/**
|
|
37
50
|
* Constants used for region discovery
|
|
38
51
|
*/
|
|
@@ -109,6 +122,21 @@ const LOOPBACK_SERVER_CONSTANTS = {
|
|
|
109
122
|
TIMEOUT_MS: 5000
|
|
110
123
|
};
|
|
111
124
|
|
|
125
|
+
/*
|
|
126
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
127
|
+
* Licensed under the MIT License.
|
|
128
|
+
*/
|
|
129
|
+
class NetworkUtils {
|
|
130
|
+
static getNetworkResponse(headers, body, statusCode) {
|
|
131
|
+
return {
|
|
132
|
+
headers: headers,
|
|
133
|
+
body: body,
|
|
134
|
+
status: statusCode
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
112
140
|
/*
|
|
113
141
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
114
142
|
* Licensed under the MIT License.
|
|
@@ -186,12 +214,12 @@ const networkRequestViaProxy = (url, httpMethod, options, timeout) => {
|
|
|
186
214
|
request.end(); // establish connection to the proxy
|
|
187
215
|
|
|
188
216
|
request.on("connect", (response, socket) => {
|
|
189
|
-
const
|
|
217
|
+
const proxyStatusCode = (response == null ? void 0 : response.statusCode) || ProxyStatus.SERVER_ERROR;
|
|
190
218
|
|
|
191
|
-
if (
|
|
219
|
+
if (proxyStatusCode < ProxyStatus.SUCCESS_RANGE_START || proxyStatusCode > ProxyStatus.SUCCESS_RANGE_END) {
|
|
192
220
|
request.destroy();
|
|
193
221
|
socket.destroy();
|
|
194
|
-
reject(new Error(`
|
|
222
|
+
reject(new Error(`Error connecting to proxy. Http status code: ${response.statusCode}. Http status message: ${(response == null ? void 0 : response.statusMessage) || "Unknown"}`));
|
|
195
223
|
}
|
|
196
224
|
|
|
197
225
|
if (tunnelRequestOptions.timeout) {
|
|
@@ -213,9 +241,11 @@ const networkRequestViaProxy = (url, httpMethod, options, timeout) => {
|
|
|
213
241
|
// combine all received buffer streams into one buffer, and then into a string
|
|
214
242
|
const dataString = Buffer.concat([...data]).toString(); // separate each line into it's own entry in an arry
|
|
215
243
|
|
|
216
|
-
const dataStringArray = dataString.split("\r\n"); // the first entry will contain the statusCode
|
|
244
|
+
const dataStringArray = dataString.split("\r\n"); // the first entry will contain the statusCode and statusMessage
|
|
245
|
+
|
|
246
|
+
const httpStatusCode = parseInt(dataStringArray[0].split(" ")[1]); // remove "HTTP/1.1" and the status code to get the status message
|
|
217
247
|
|
|
218
|
-
const
|
|
248
|
+
const statusMessage = dataStringArray[0].split(" ").slice(2).join(" "); // the last entry will contain the body
|
|
219
249
|
|
|
220
250
|
const body = dataStringArray[dataStringArray.length - 1]; // everything in between the first and last entries are the headers
|
|
221
251
|
|
|
@@ -245,13 +275,10 @@ const networkRequestViaProxy = (url, httpMethod, options, timeout) => {
|
|
|
245
275
|
entries.set(headerKey, headerValue);
|
|
246
276
|
});
|
|
247
277
|
const headers = Object.fromEntries(entries);
|
|
248
|
-
const
|
|
249
|
-
|
|
250
|
-
body: JSON.parse(body),
|
|
251
|
-
status: statusCode
|
|
252
|
-
};
|
|
278
|
+
const parsedHeaders = headers;
|
|
279
|
+
const networkResponse = NetworkUtils.getNetworkResponse(parsedHeaders, parseBody(httpStatusCode, statusMessage, parsedHeaders, body), httpStatusCode);
|
|
253
280
|
|
|
254
|
-
if ((
|
|
281
|
+
if ((httpStatusCode < HttpStatus.SUCCESS_RANGE_START || httpStatusCode > HttpStatus.SUCCESS_RANGE_END) && // do not destroy the request for the device code flow
|
|
255
282
|
networkResponse.body["error"] !== Constants.AUTHORIZATION_PENDING) {
|
|
256
283
|
request.destroy();
|
|
257
284
|
}
|
|
@@ -309,6 +336,7 @@ const networkRequestViaHttps = (url, httpMethod, options, timeout) => {
|
|
|
309
336
|
request.on("response", response => {
|
|
310
337
|
const headers = response.headers;
|
|
311
338
|
const statusCode = response.statusCode;
|
|
339
|
+
const statusMessage = response.statusMessage;
|
|
312
340
|
const data = [];
|
|
313
341
|
response.on("data", chunk => {
|
|
314
342
|
data.push(chunk);
|
|
@@ -316,13 +344,10 @@ const networkRequestViaHttps = (url, httpMethod, options, timeout) => {
|
|
|
316
344
|
response.on("end", () => {
|
|
317
345
|
// combine all received buffer streams into one buffer, and then into a string
|
|
318
346
|
const body = Buffer.concat([...data]).toString();
|
|
319
|
-
const
|
|
320
|
-
|
|
321
|
-
body: JSON.parse(body),
|
|
322
|
-
status: statusCode
|
|
323
|
-
};
|
|
347
|
+
const parsedHeaders = headers;
|
|
348
|
+
const networkResponse = NetworkUtils.getNetworkResponse(parsedHeaders, parseBody(statusCode, statusMessage, parsedHeaders, body), statusCode);
|
|
324
349
|
|
|
325
|
-
if ((statusCode <
|
|
350
|
+
if ((statusCode < HttpStatus.SUCCESS_RANGE_START || statusCode > HttpStatus.SUCCESS_RANGE_END) && // do not destroy the request for the device code flow
|
|
326
351
|
networkResponse.body["error"] !== Constants.AUTHORIZATION_PENDING) {
|
|
327
352
|
request.destroy();
|
|
328
353
|
}
|
|
@@ -336,20 +361,51 @@ const networkRequestViaHttps = (url, httpMethod, options, timeout) => {
|
|
|
336
361
|
});
|
|
337
362
|
});
|
|
338
363
|
};
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
*
|
|
342
|
-
*
|
|
364
|
+
/**
|
|
365
|
+
* Check if extra parsing is needed on the repsonse from the server
|
|
366
|
+
* @param statusCode {number} the status code of the response from the server
|
|
367
|
+
* @param statusMessage {string | undefined} the status message of the response from the server
|
|
368
|
+
* @param headers {Record<string, string>} the headers of the response from the server
|
|
369
|
+
* @param body {string} the body from the response of the server
|
|
370
|
+
* @returns {Object} JSON parsed body or error object
|
|
343
371
|
*/
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
const parseBody = (statusCode, statusMessage, headers, body) => {
|
|
375
|
+
/*
|
|
376
|
+
* Informational responses (100 – 199)
|
|
377
|
+
* Successful responses (200 – 299)
|
|
378
|
+
* Redirection messages (300 – 399)
|
|
379
|
+
* Client error responses (400 – 499)
|
|
380
|
+
* Server error responses (500 – 599)
|
|
381
|
+
*/
|
|
382
|
+
let parsedBody;
|
|
383
|
+
|
|
384
|
+
try {
|
|
385
|
+
parsedBody = JSON.parse(body);
|
|
386
|
+
} catch (error) {
|
|
387
|
+
let errorType;
|
|
388
|
+
let errorDescriptionHelper;
|
|
389
|
+
|
|
390
|
+
if (statusCode >= HttpStatus.CLIENT_ERROR_RANGE_START && statusCode <= HttpStatus.CLIENT_ERROR_RANGE_END) {
|
|
391
|
+
errorType = "client_error";
|
|
392
|
+
errorDescriptionHelper = "A client";
|
|
393
|
+
} else if (statusCode >= HttpStatus.SERVER_ERROR_RANGE_START && statusCode <= HttpStatus.SERVER_ERROR_RANGE_END) {
|
|
394
|
+
errorType = "server_error";
|
|
395
|
+
errorDescriptionHelper = "A server";
|
|
396
|
+
} else {
|
|
397
|
+
errorType = "unknown_error";
|
|
398
|
+
errorDescriptionHelper = "An unknown";
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
parsedBody = {
|
|
402
|
+
error: errorType,
|
|
403
|
+
error_description: `${errorDescriptionHelper} error occured.\nHttp status code: ${statusCode}\nHttp status message: ${statusMessage || "Unknown"}\nHeaders: ${JSON.stringify(headers)}`
|
|
404
|
+
};
|
|
350
405
|
}
|
|
351
406
|
|
|
352
|
-
|
|
407
|
+
return parsedBody;
|
|
408
|
+
};
|
|
353
409
|
|
|
354
410
|
/*
|
|
355
411
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -385,7 +441,7 @@ const DEFAULT_LOGGER_OPTIONS = {
|
|
|
385
441
|
};
|
|
386
442
|
const DEFAULT_SYSTEM_OPTIONS = {
|
|
387
443
|
loggerOptions: DEFAULT_LOGGER_OPTIONS,
|
|
388
|
-
networkClient: /*#__PURE__*/
|
|
444
|
+
networkClient: /*#__PURE__*/new HttpClient(),
|
|
389
445
|
proxyUrl: msalCommon.Constants.EMPTY_STRING
|
|
390
446
|
};
|
|
391
447
|
const DEFAULT_TELEMETRY_OPTIONS = {
|
|
@@ -785,7 +841,8 @@ class Deserializer {
|
|
|
785
841
|
keyId: serializedAT.key_id,
|
|
786
842
|
tokenType: serializedAT.token_type,
|
|
787
843
|
requestedClaims: serializedAT.requestedClaims,
|
|
788
|
-
requestedClaimsHash: serializedAT.requestedClaimsHash
|
|
844
|
+
requestedClaimsHash: serializedAT.requestedClaimsHash,
|
|
845
|
+
userAssertionHash: serializedAT.userAssertionHash
|
|
789
846
|
};
|
|
790
847
|
const accessToken = new msalCommon.AccessTokenEntity();
|
|
791
848
|
msalCommon.CacheManager.toObject(accessToken, mappedAT);
|
|
@@ -951,7 +1008,8 @@ class Serializer {
|
|
|
951
1008
|
key_id: atEntity.keyId,
|
|
952
1009
|
token_type: atEntity.tokenType,
|
|
953
1010
|
requestedClaims: atEntity.requestedClaims,
|
|
954
|
-
requestedClaimsHash: atEntity.requestedClaimsHash
|
|
1011
|
+
requestedClaimsHash: atEntity.requestedClaimsHash,
|
|
1012
|
+
userAssertionHash: atEntity.userAssertionHash
|
|
955
1013
|
};
|
|
956
1014
|
});
|
|
957
1015
|
return accessTokens;
|
|
@@ -1769,7 +1827,7 @@ class TokenCache {
|
|
|
1769
1827
|
|
|
1770
1828
|
/* eslint-disable header/header */
|
|
1771
1829
|
const name = "@azure/msal-node";
|
|
1772
|
-
const version = "1.14.
|
|
1830
|
+
const version = "1.14.5";
|
|
1773
1831
|
|
|
1774
1832
|
/*
|
|
1775
1833
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -2217,7 +2275,7 @@ class ClientApplication {
|
|
|
2217
2275
|
azureRegionConfiguration,
|
|
2218
2276
|
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache
|
|
2219
2277
|
};
|
|
2220
|
-
return await msalCommon.AuthorityFactory.createDiscoveredInstance(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions, this.config.system.proxyUrl);
|
|
2278
|
+
return await msalCommon.AuthorityFactory.createDiscoveredInstance(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions, this.logger, this.config.system.proxyUrl);
|
|
2221
2279
|
}
|
|
2222
2280
|
/**
|
|
2223
2281
|
* Clear the cache
|
|
@@ -2407,7 +2465,7 @@ class PublicClientApplication extends ClientApplication {
|
|
|
2407
2465
|
const authCodeListener = loopbackClient.listenForAuthCode(successTemplate, errorTemplate);
|
|
2408
2466
|
const redirectUri = loopbackClient.getRedirectUri();
|
|
2409
2467
|
const validRequest = { ...remainingProperties,
|
|
2410
|
-
scopes: request.scopes ||
|
|
2468
|
+
scopes: request.scopes || msalCommon.OIDC_DEFAULT_SCOPES,
|
|
2411
2469
|
redirectUri: redirectUri,
|
|
2412
2470
|
responseMode: msalCommon.ResponseMode.QUERY,
|
|
2413
2471
|
codeChallenge: challenge,
|
|
@@ -2428,10 +2486,9 @@ class PublicClientApplication extends ClientApplication {
|
|
|
2428
2486
|
const clientInfo = authCodeResponse.client_info;
|
|
2429
2487
|
const tokenRequest = {
|
|
2430
2488
|
code: authCodeResponse.code,
|
|
2431
|
-
scopes: msalCommon.OIDC_DEFAULT_SCOPES,
|
|
2432
|
-
redirectUri: validRequest.redirectUri,
|
|
2433
2489
|
codeVerifier: verifier,
|
|
2434
|
-
clientInfo: clientInfo || msalCommon.Constants.EMPTY_STRING
|
|
2490
|
+
clientInfo: clientInfo || msalCommon.Constants.EMPTY_STRING,
|
|
2491
|
+
...validRequest
|
|
2435
2492
|
};
|
|
2436
2493
|
return this.acquireTokenByCode(tokenRequest);
|
|
2437
2494
|
}
|