@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
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -10238,7 +10238,7 @@
10238
10238
 
10239
10239
  /* eslint-disable header/header */
10240
10240
  const name = "@azure/msal-browser";
10241
- const version = "3.26.0";
10241
+ const version = "3.26.1";
10242
10242
 
10243
10243
  /*
10244
10244
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -17548,7 +17548,9 @@
17548
17548
  const naaRequest = this.nestedAppAuthAdapter.toNaaTokenRequest(validRequest);
17549
17549
  const reqTimestamp = nowSeconds();
17550
17550
  const response = await this.bridgeProxy.getTokenInteractive(naaRequest);
17551
- const result = this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp);
17551
+ const result = {
17552
+ ...this.nestedAppAuthAdapter.fromNaaTokenResponse(naaRequest, response, reqTimestamp),
17553
+ };
17552
17554
  // cache the tokens in the response
17553
17555
  await this.hydrateCache(result, request);
17554
17556
  this.browserStorage.setActiveAccount(result.account);
@@ -17632,7 +17634,22 @@
17632
17634
  atsMeasurement?.add({
17633
17635
  nestedAppAuthRequest: true,
17634
17636
  });
17635
- const result = await this.acquireTokenFromCacheInternal(request);
17637
+ // if the request has claims, we cannot look up in the cache
17638
+ if (request.claims) {
17639
+ this.logger.verbose("Claims are present in the request, skipping cache lookup");
17640
+ return null;
17641
+ }
17642
+ // respect cache lookup policy
17643
+ let result = null;
17644
+ switch (request.cacheLookupPolicy) {
17645
+ case CacheLookupPolicy.Default:
17646
+ case CacheLookupPolicy.AccessToken:
17647
+ case CacheLookupPolicy.AccessTokenAndRefreshToken:
17648
+ result = await this.acquireTokenFromCacheInternal(request);
17649
+ break;
17650
+ default:
17651
+ return null;
17652
+ }
17636
17653
  if (result) {
17637
17654
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, exports.InteractionType.Silent, result);
17638
17655
  atsMeasurement?.add({
@@ -17685,13 +17702,10 @@
17685
17702
  if (!cachedAccessToken) {
17686
17703
  this.logger.verbose("No cached access token found");
17687
17704
  return Promise.resolve(null);
17688
- // If access token has expired, remove the token from cache and return null
17689
17705
  }
17690
17706
  else if (wasClockTurnedBack(cachedAccessToken.cachedAt) ||
17691
17707
  isTokenExpired(cachedAccessToken.expiresOn, this.config.system.tokenRenewalOffsetSeconds)) {
17692
- this.logger.verbose("Cached access token has expired, deleting all related tokens from cache");
17693
- const accountEntity = AccountEntity.createFromAccountInfo(currentAccount);
17694
- await this.browserStorage.removeAccountContext(accountEntity);
17708
+ this.logger.verbose("Cached access token has expired");
17695
17709
  return Promise.resolve(null);
17696
17710
  }
17697
17711
  const cachedIdToken = this.browserStorage.getIdToken(currentAccount, tokenKeys, currentAccount.tenantId, this.performanceClient, authRequest.correlationId);