@azure/msal-browser 3.26.0 → 3.26.1

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 (78) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/app/PublicClientNext.mjs +1 -1
  4. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
  5. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  6. package/dist/cache/AccountManager.mjs +1 -1
  7. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  8. package/dist/cache/BrowserCacheManager.mjs +1 -1
  9. package/dist/cache/BrowserStorage.mjs +1 -1
  10. package/dist/cache/DatabaseStorage.mjs +1 -1
  11. package/dist/cache/MemoryStorage.mjs +1 -1
  12. package/dist/cache/TokenCache.mjs +1 -1
  13. package/dist/config/Configuration.mjs +1 -1
  14. package/dist/controllers/ControllerFactory.mjs +1 -1
  15. package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
  16. package/dist/controllers/NestedAppAuthController.mjs +22 -8
  17. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  18. package/dist/controllers/StandardController.mjs +1 -1
  19. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  20. package/dist/crypto/BrowserCrypto.mjs +1 -1
  21. package/dist/crypto/CryptoOps.mjs +1 -1
  22. package/dist/crypto/PkceGenerator.mjs +1 -1
  23. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  24. package/dist/encode/Base64Decode.mjs +1 -1
  25. package/dist/encode/Base64Encode.mjs +1 -1
  26. package/dist/error/BrowserAuthError.mjs +1 -1
  27. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  28. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  29. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  30. package/dist/error/NativeAuthError.mjs +1 -1
  31. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  32. package/dist/error/NestedAppAuthError.mjs +1 -1
  33. package/dist/event/EventHandler.mjs +1 -1
  34. package/dist/event/EventMessage.mjs +1 -1
  35. package/dist/event/EventType.mjs +1 -1
  36. package/dist/index.mjs +1 -1
  37. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  38. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  39. package/dist/interaction_client/NativeInteractionClient.mjs +1 -1
  40. package/dist/interaction_client/PopupClient.mjs +1 -1
  41. package/dist/interaction_client/RedirectClient.mjs +1 -1
  42. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  43. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  44. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  45. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  46. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  47. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  48. package/dist/interaction_handler/RedirectHandler.mjs +1 -1
  49. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  50. package/dist/naa/BridgeError.mjs +1 -1
  51. package/dist/naa/BridgeProxy.mjs +1 -1
  52. package/dist/naa/BridgeStatusCode.mjs +1 -1
  53. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  54. package/dist/navigation/NavigationClient.mjs +1 -1
  55. package/dist/network/FetchClient.mjs +1 -1
  56. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  57. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  58. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  59. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  60. package/dist/packageMetadata.d.ts +1 -1
  61. package/dist/packageMetadata.mjs +2 -2
  62. package/dist/request/RequestHelpers.mjs +1 -1
  63. package/dist/response/ResponseHandler.mjs +1 -1
  64. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  65. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  66. package/dist/utils/BrowserConstants.mjs +1 -1
  67. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  68. package/dist/utils/BrowserUtils.mjs +1 -1
  69. package/lib/msal-browser.cjs +22 -8
  70. package/lib/msal-browser.cjs.map +1 -1
  71. package/lib/msal-browser.js +22 -8
  72. package/lib/msal-browser.js.map +1 -1
  73. package/lib/msal-browser.min.js +19 -19
  74. package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  75. package/lib/types/packageMetadata.d.ts +1 -1
  76. package/package.json +1 -1
  77. package/src/controllers/NestedAppAuthController.ts +25 -12
  78. package/src/packageMetadata.ts +1 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v3.26.0 2024-10-08 */
1
+ /*! @azure/msal-browser v3.26.1 2024-10-08 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v3.26.0 2024-10-08 */
1
+ /*! @azure/msal-browser v3.26.1 2024-10-08 */
2
2
  'use strict';
3
3
  import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common/browser';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v3.26.0 2024-10-08 */
1
+ /*! @azure/msal-browser v3.26.1 2024-10-08 */
2
2
  'use strict';
3
3
  import { ProtocolUtils, createClientAuthError, ClientAuthErrorCodes } from '@azure/msal-common/browser';
4
4
 
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v3.26.0 2024-10-08 */
1
+ /*! @azure/msal-browser v3.26.1 2024-10-08 */
2
2
  'use strict';
3
3
  import { UrlString } from '@azure/msal-common/browser';
4
4
  export { invoke, invokeAsync } from '@azure/msal-common/browser';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v3.26.0 2024-10-08 */
1
+ /*! @azure/msal-browser v3.26.1 2024-10-08 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
@@ -10234,7 +10234,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10234
10234
 
10235
10235
  /* eslint-disable header/header */
10236
10236
  const name = "@azure/msal-browser";
10237
- const version = "3.26.0";
10237
+ const version = "3.26.1";
10238
10238
 
10239
10239
  /*
10240
10240
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -17544,7 +17544,9 @@ class NestedAppAuthController {
17544
17544
  const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
17545
17545
  const reqTimestamp = nowSeconds();
17546
17546
  const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
17547
- const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
17547
+ const result = {
17548
+ ...this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp),
17549
+ };
17548
17550
  // cache the tokens in the response
17549
17551
  await this.hydrateCache(result, request);
17550
17552
  this.browserStorage.setActiveAccount(result.account);
@@ -17628,7 +17630,22 @@ class NestedAppAuthController {
17628
17630
  atsMeasurement?.add({
17629
17631
  nestedAppAuthRequest: true,
17630
17632
  });
17631
- const result = await this.acquireTokenFromCacheInternal(request);
17633
+ // if the request has claims, we cannot look up in the cache
17634
+ if (request.claims) {
17635
+ this.logger.verbose("Claims are present in the request, skipping cache lookup");
17636
+ return null;
17637
+ }
17638
+ // respect cache lookup policy
17639
+ let result = null;
17640
+ switch (request.cacheLookupPolicy) {
17641
+ case CacheLookupPolicy.Default:
17642
+ case CacheLookupPolicy.AccessToken:
17643
+ case CacheLookupPolicy.AccessTokenAndRefreshToken:
17644
+ result = await this.acquireTokenFromCacheInternal(request);
17645
+ break;
17646
+ default:
17647
+ return null;
17648
+ }
17632
17649
  if (result) {
17633
17650
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, result);
17634
17651
  atsMeasurement?.add({
@@ -17681,13 +17698,10 @@ class NestedAppAuthController {
17681
17698
  if (!cachedAccessToken) {
17682
17699
  this.logger.verbose("No cached access token found");
17683
17700
  return Promise.resolve(null);
17684
- // If access token has expired, remove the token from cache and return null
17685
17701
  }
17686
17702
  else if (wasClockTurnedBack(cachedAccessToken.cachedAt) ||
17687
17703
  isTokenExpired(cachedAccessToken.expiresOn, this.config.system.tokenRenewalOffsetSeconds)) {
17688
- this.logger.verbose("Cached access token has expired, deleting all related tokens from cache");
17689
- const accountEntity = AccountEntity.createFromAccountInfo(currentAccount);
17690
- await this.browserStorage.removeAccountContext(accountEntity);
17704
+ this.logger.verbose("Cached access token has expired");
17691
17705
  return Promise.resolve(null);
17692
17706
  }
17693
17707
  const cachedIdToken = this.browserStorage.getIdToken(currentAccount, tokenKeys, currentAccount.tenantId, this.performanceClient, authRequest.correlationId);