@azure/msal-node 1.18.1 → 1.18.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../src/client/PublicClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EAEH,oBAAoB,EAUpB,WAAW,EAEd,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;AAGnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,wBAAwB;IAC9F,OAAO,CAAC,kBAAkB,CAAC,CAAsB;IACjD;;;;;;;;;;;;;;;;OAgBG;gBACS,aAAa,EAAE,aAAa;IAYxC;;;;;;;;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;IA6DzF;;;;OAIG;IACG,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAsB1F;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAarD;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;CAQjD"}
1
+ {"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../src/client/PublicClientApplication.ts"],"names":[],"mappings":"AAMA,OAAO,EAEH,oBAAoB,EAUpB,WAAW,EAEd,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;AAGnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,wBAAwB;IAC9F,OAAO,CAAC,kBAAkB,CAAC,CAAsB;IACjD;;;;;;;;;;;;;;;;OAgBG;gBACS,aAAa,EAAE,aAAa;IAYxC;;;;;;;;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;IAkEzF;;;;OAIG;IACG,kBAAkB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAsB1F;;;;OAIG;IACG,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAarD;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;CAQjD"}
@@ -1638,7 +1638,7 @@ class TokenCache {
1638
1638
 
1639
1639
  /* eslint-disable header/header */
1640
1640
  const name = "@azure/msal-node";
1641
- const version = "1.18.1";
1641
+ const version = "1.18.3";
1642
1642
 
1643
1643
  /*
1644
1644
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2228,35 +2228,40 @@ class PublicClientApplication extends ClientApplication {
2228
2228
  challenge
2229
2229
  } = await this.cryptoProvider.generatePkceCodes();
2230
2230
  const loopbackClient = customLoopbackClient || new LoopbackClient();
2231
- const authCodeListener = loopbackClient.listenForAuthCode(successTemplate, errorTemplate);
2232
- const redirectUri = loopbackClient.getRedirectUri();
2233
- const validRequest = {
2234
- ...remainingProperties,
2235
- correlationId: correlationId,
2236
- scopes: request.scopes || msalCommon.OIDC_DEFAULT_SCOPES,
2237
- redirectUri: redirectUri,
2238
- responseMode: msalCommon.ResponseMode.QUERY,
2239
- codeChallenge: challenge,
2240
- codeChallengeMethod: msalCommon.CodeChallengeMethodValues.S256
2241
- };
2242
- const authCodeUrl = await this.getAuthCodeUrl(validRequest);
2243
- await openBrowser(authCodeUrl);
2244
- const authCodeResponse = await authCodeListener.finally(() => {
2231
+ try {
2232
+ const authCodeListener = loopbackClient.listenForAuthCode(successTemplate, errorTemplate);
2233
+ const redirectUri = loopbackClient.getRedirectUri();
2234
+ const validRequest = {
2235
+ ...remainingProperties,
2236
+ correlationId: correlationId,
2237
+ scopes: request.scopes || msalCommon.OIDC_DEFAULT_SCOPES,
2238
+ redirectUri: redirectUri,
2239
+ responseMode: msalCommon.ResponseMode.QUERY,
2240
+ codeChallenge: challenge,
2241
+ codeChallengeMethod: msalCommon.CodeChallengeMethodValues.S256
2242
+ };
2243
+ const authCodeUrl = await this.getAuthCodeUrl(validRequest);
2244
+ await openBrowser(authCodeUrl);
2245
+ const authCodeResponse = await authCodeListener.finally(() => {
2246
+ loopbackClient.closeServer();
2247
+ });
2248
+ if (authCodeResponse.error) {
2249
+ throw new msalCommon.ServerError(authCodeResponse.error, authCodeResponse.error_description, authCodeResponse.suberror);
2250
+ } else if (!authCodeResponse.code) {
2251
+ throw NodeAuthError.createNoAuthCodeInResponseError();
2252
+ }
2253
+ const clientInfo = authCodeResponse.client_info;
2254
+ const tokenRequest = {
2255
+ code: authCodeResponse.code,
2256
+ codeVerifier: verifier,
2257
+ clientInfo: clientInfo || msalCommon.Constants.EMPTY_STRING,
2258
+ ...validRequest
2259
+ };
2260
+ return this.acquireTokenByCode(tokenRequest);
2261
+ } catch (e) {
2245
2262
  loopbackClient.closeServer();
2246
- });
2247
- if (authCodeResponse.error) {
2248
- throw new msalCommon.ServerError(authCodeResponse.error, authCodeResponse.error_description, authCodeResponse.suberror);
2249
- } else if (!authCodeResponse.code) {
2250
- throw NodeAuthError.createNoAuthCodeInResponseError();
2251
- }
2252
- const clientInfo = authCodeResponse.client_info;
2253
- const tokenRequest = {
2254
- code: authCodeResponse.code,
2255
- codeVerifier: verifier,
2256
- clientInfo: clientInfo || msalCommon.Constants.EMPTY_STRING,
2257
- ...validRequest
2258
- };
2259
- return this.acquireTokenByCode(tokenRequest);
2263
+ throw e;
2264
+ }
2260
2265
  }
2261
2266
  /**
2262
2267
  * Returns a token retrieved either from the cache or by exchanging the refresh token for a fresh access token. If brokering is enabled the token request will be serviced by the broker.