@azure/msal-common 7.3.0 → 7.4.0

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 (81) hide show
  1. package/dist/_virtual/_tslib.js +1 -1
  2. package/dist/account/AccountInfo.d.ts +2 -0
  3. package/dist/account/AccountInfo.d.ts.map +1 -1
  4. package/dist/account/AuthToken.js +1 -1
  5. package/dist/account/CcsCredential.js +1 -1
  6. package/dist/account/ClientInfo.js +3 -3
  7. package/dist/account/ClientInfo.js.map +1 -1
  8. package/dist/authority/Authority.js +1 -1
  9. package/dist/authority/AuthorityFactory.js +1 -1
  10. package/dist/authority/AuthorityMetadata.js +1 -1
  11. package/dist/authority/AuthorityOptions.js +1 -1
  12. package/dist/authority/AuthorityType.js +1 -1
  13. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  14. package/dist/authority/OpenIdConfigResponse.js +1 -1
  15. package/dist/authority/ProtocolMode.js +1 -1
  16. package/dist/authority/RegionDiscovery.js +1 -1
  17. package/dist/cache/CacheManager.d.ts.map +1 -1
  18. package/dist/cache/CacheManager.js +2 -1
  19. package/dist/cache/CacheManager.js.map +1 -1
  20. package/dist/cache/entities/AccessTokenEntity.js +1 -1
  21. package/dist/cache/entities/AccountEntity.js +1 -1
  22. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  23. package/dist/cache/entities/AuthorityMetadataEntity.js +1 -1
  24. package/dist/cache/entities/CacheRecord.js +1 -1
  25. package/dist/cache/entities/CredentialEntity.js +1 -1
  26. package/dist/cache/entities/IdTokenEntity.js +1 -1
  27. package/dist/cache/entities/RefreshTokenEntity.js +1 -1
  28. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  29. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  30. package/dist/cache/persistence/TokenCacheContext.js +1 -1
  31. package/dist/client/AuthorizationCodeClient.js +1 -1
  32. package/dist/client/BaseClient.js +1 -1
  33. package/dist/client/ClientCredentialClient.js +1 -1
  34. package/dist/client/DeviceCodeClient.js +1 -1
  35. package/dist/client/OnBehalfOfClient.js +1 -1
  36. package/dist/client/RefreshTokenClient.js +1 -1
  37. package/dist/client/SilentFlowClient.js +1 -1
  38. package/dist/client/UsernamePasswordClient.js +1 -1
  39. package/dist/config/ClientConfiguration.js +1 -1
  40. package/dist/crypto/ICrypto.js +1 -1
  41. package/dist/crypto/JoseHeader.js +1 -1
  42. package/dist/crypto/PopTokenGenerator.js +1 -1
  43. package/dist/error/AuthError.js +1 -1
  44. package/dist/error/ClientAuthError.js +1 -1
  45. package/dist/error/ClientConfigurationError.js +1 -1
  46. package/dist/error/InteractionRequiredAuthError.js +1 -1
  47. package/dist/error/JoseHeaderError.js +1 -1
  48. package/dist/error/ServerError.js +1 -1
  49. package/dist/index.cjs.js +50 -4
  50. package/dist/index.cjs.js.map +1 -1
  51. package/dist/index.d.ts +2 -1
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +3 -2
  54. package/dist/index.js.map +1 -1
  55. package/dist/logger/Logger.js +1 -1
  56. package/dist/network/INetworkModule.js +1 -1
  57. package/dist/network/NetworkManager.js +1 -1
  58. package/dist/network/ThrottlingUtils.js +1 -1
  59. package/dist/packageMetadata.d.ts +1 -1
  60. package/dist/packageMetadata.js +2 -2
  61. package/dist/packageMetadata.js.map +1 -1
  62. package/dist/request/AuthenticationHeaderParser.js +1 -1
  63. package/dist/request/RequestParameterBuilder.js +1 -1
  64. package/dist/request/RequestValidator.js +1 -1
  65. package/dist/request/ScopeSet.js +1 -1
  66. package/dist/response/ResponseHandler.js +1 -1
  67. package/dist/telemetry/performance/PerformanceClient.js +1 -1
  68. package/dist/telemetry/performance/PerformanceEvent.js +1 -1
  69. package/dist/telemetry/performance/StubPerformanceClient.js +1 -1
  70. package/dist/telemetry/server/ServerTelemetryManager.js +1 -1
  71. package/dist/url/UrlString.d.ts +9 -0
  72. package/dist/url/UrlString.d.ts.map +1 -1
  73. package/dist/url/UrlString.js +34 -1
  74. package/dist/url/UrlString.js.map +1 -1
  75. package/dist/utils/Constants.d.ts.map +1 -1
  76. package/dist/utils/Constants.js +2 -2
  77. package/dist/utils/Constants.js.map +1 -1
  78. package/dist/utils/ProtocolUtils.js +1 -1
  79. package/dist/utils/StringUtils.js +1 -1
  80. package/dist/utils/TimeUtils.js +1 -1
  81. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BaseClient } from './BaseClient.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BaseClient } from './BaseClient.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BaseClient } from './BaseClient.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { BaseClient } from './BaseClient.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BaseClient } from './BaseClient.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BaseClient } from './BaseClient.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __assign, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { DEFAULT_CRYPTO_IMPLEMENTATION } from '../crypto/ICrypto.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from '../error/AuthError.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { JoseHeaderError } from '../error/JoseHeaderError.js';
4
4
  import { JsonTypes } from '../utils/Constants.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { TimeUtils } from '../utils/TimeUtils.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { Constants } from '../utils/Constants.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from './AuthError.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { ClientAuthError } from './ClientAuthError.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from './AuthError.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from './AuthError.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { AuthError } from './AuthError.js';
package/dist/index.cjs.js CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v7.3.0 2022-08-01 */
1
+ /*! @azure/msal-common v7.4.0 2022-09-06 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -139,7 +139,7 @@ var Constants = {
139
139
  KNOWN_PUBLIC_CLOUDS: ["login.microsoftonline.com", "login.windows.net", "login.microsoft.com", "sts.windows.net"],
140
140
  TOKEN_RESPONSE_TYPE: "token",
141
141
  ID_TOKEN_RESPONSE_TYPE: "id_token",
142
- SHR_NONCE_VALIDITY: 240,
142
+ SHR_NONCE_VALIDITY: 240
143
143
  };
144
144
  var OIDC_DEFAULT_SCOPES = [
145
145
  Constants.OPENID_SCOPE,
@@ -285,6 +285,15 @@ var CodeChallengeMethodValues = {
285
285
  PLAIN: "plain",
286
286
  S256: "S256"
287
287
  };
288
+ /**
289
+ * The method used to encode the code verifier for the code challenge parameter. can be one
290
+ * of plain or s256. if excluded, code challenge is assumed to be plaintext. for more
291
+ * information, see the pkce rcf: https://tools.ietf.org/html/rfc7636
292
+ */
293
+ [
294
+ CodeChallengeMethodValues.PLAIN,
295
+ CodeChallengeMethodValues.S256
296
+ ];
288
297
  /**
289
298
  * allowed values for response_mode
290
299
  */
@@ -1372,7 +1381,7 @@ var Logger = /** @class */ (function () {
1372
1381
 
1373
1382
  /* eslint-disable header/header */
1374
1383
  var name = "@azure/msal-common";
1375
- var version = "7.3.0";
1384
+ var version = "7.4.0";
1376
1385
 
1377
1386
  /*
1378
1387
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2004,7 +2013,7 @@ function buildClientInfo(rawClientInfo, crypto) {
2004
2013
  return JSON.parse(decodedClientInfo);
2005
2014
  }
2006
2015
  catch (e) {
2007
- throw ClientAuthError.createClientInfoDecodingError(e);
2016
+ throw ClientAuthError.createClientInfoDecodingError(e.message);
2008
2017
  }
2009
2018
  }
2010
2019
  /**
@@ -2333,6 +2342,7 @@ var CacheManager = /** @class */ (function () {
2333
2342
  var accountInfo = accountEntity.getAccountInfo();
2334
2343
  var idToken = _this.readIdTokenFromCache(_this.clientId, accountInfo);
2335
2344
  if (idToken && !accountInfo.idTokenClaims) {
2345
+ accountInfo.idToken = idToken.secret;
2336
2346
  accountInfo.idTokenClaims = new AuthToken(idToken.secret, _this.cryptoImpl).claims;
2337
2347
  }
2338
2348
  return accountInfo;
@@ -4592,6 +4602,21 @@ var UrlString = /** @class */ (function () {
4592
4602
  }
4593
4603
  return Constants.EMPTY_STRING;
4594
4604
  };
4605
+ /**
4606
+ * Parses query string from given string. Returns empty string if no query symbol is found.
4607
+ * @param queryString
4608
+ */
4609
+ UrlString.parseQueryString = function (queryString) {
4610
+ var queryIndex1 = queryString.indexOf("?");
4611
+ var queryIndex2 = queryString.indexOf("/?");
4612
+ if (queryIndex2 > -1) {
4613
+ return queryString.substring(queryIndex2 + 2);
4614
+ }
4615
+ else if (queryIndex1 > -1) {
4616
+ return queryString.substring(queryIndex1 + 1);
4617
+ }
4618
+ return Constants.EMPTY_STRING;
4619
+ };
4595
4620
  UrlString.constructAuthorityUriFromObject = function (urlObject) {
4596
4621
  return new UrlString(urlObject.Protocol + "//" + urlObject.HostNameAndPort + "/" + urlObject.PathSegments.join("/"));
4597
4622
  };
@@ -4613,6 +4638,24 @@ var UrlString = /** @class */ (function () {
4613
4638
  }
4614
4639
  return deserializedHash;
4615
4640
  };
4641
+ /**
4642
+ * Returns URL query string as server auth code response object.
4643
+ */
4644
+ UrlString.getDeserializedQueryString = function (query) {
4645
+ // Check if given query is empty
4646
+ if (StringUtils.isEmpty(query)) {
4647
+ return {};
4648
+ }
4649
+ // Strip the ? symbol if present
4650
+ var parsedQueryString = UrlString.parseQueryString(query);
4651
+ // If ? symbol was not present, above will return empty string, so give original query value
4652
+ var deserializedQueryString = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedQueryString) ? query : parsedQueryString);
4653
+ // Check if deserialization didn't work
4654
+ if (!deserializedQueryString) {
4655
+ throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedQueryString));
4656
+ }
4657
+ return deserializedQueryString;
4658
+ };
4616
4659
  /**
4617
4660
  * Check if the hash of the URL string contains known properties
4618
4661
  */
@@ -8402,6 +8445,7 @@ exports.ClientAuthErrorMessage = ClientAuthErrorMessage;
8402
8445
  exports.ClientConfigurationError = ClientConfigurationError;
8403
8446
  exports.ClientConfigurationErrorMessage = ClientConfigurationErrorMessage;
8404
8447
  exports.ClientCredentialClient = ClientCredentialClient;
8448
+ exports.CodeChallengeMethodValues = CodeChallengeMethodValues;
8405
8449
  exports.Constants = Constants;
8406
8450
  exports.CredentialEntity = CredentialEntity;
8407
8451
  exports.DEFAULT_CRYPTO_IMPLEMENTATION = DEFAULT_CRYPTO_IMPLEMENTATION;
@@ -8437,5 +8481,7 @@ exports.TimeUtils = TimeUtils;
8437
8481
  exports.TokenCacheContext = TokenCacheContext;
8438
8482
  exports.UrlString = UrlString;
8439
8483
  exports.UsernamePasswordClient = UsernamePasswordClient;
8484
+ exports.buildClientInfo = buildClientInfo;
8485
+ exports.buildClientInfoFromHomeAccountId = buildClientInfoFromHomeAccountId;
8440
8486
  exports.version = version;
8441
8487
  //# sourceMappingURL=index.cjs.js.map