@azure/msal-browser 4.18.0 → 4.20.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 (445) 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/NativeStatusCodes.mjs +1 -1
  5. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  8. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +3 -2
  9. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  10. package/dist/cache/AccountManager.d.ts.map +1 -1
  11. package/dist/cache/AccountManager.mjs +1 -6
  12. package/dist/cache/AccountManager.mjs.map +1 -1
  13. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  14. package/dist/cache/BrowserCacheManager.d.ts +26 -11
  15. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  16. package/dist/cache/BrowserCacheManager.mjs +239 -56
  17. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  18. package/dist/cache/CacheHelpers.d.ts +2 -2
  19. package/dist/cache/CacheHelpers.d.ts.map +1 -1
  20. package/dist/cache/CacheHelpers.mjs +6 -6
  21. package/dist/cache/CacheHelpers.mjs.map +1 -1
  22. package/dist/cache/CacheKeys.d.ts +14 -0
  23. package/dist/cache/CacheKeys.d.ts.map +1 -0
  24. package/dist/cache/CacheKeys.mjs +33 -0
  25. package/dist/cache/CacheKeys.mjs.map +1 -0
  26. package/dist/cache/CookieStorage.d.ts +1 -0
  27. package/dist/cache/CookieStorage.d.ts.map +1 -1
  28. package/dist/cache/CookieStorage.mjs +5 -1
  29. package/dist/cache/CookieStorage.mjs.map +1 -1
  30. package/dist/cache/DatabaseStorage.mjs +1 -1
  31. package/dist/cache/EncryptedData.d.ts +8 -0
  32. package/dist/cache/EncryptedData.d.ts.map +1 -0
  33. package/dist/cache/EncryptedData.mjs +14 -0
  34. package/dist/cache/EncryptedData.mjs.map +1 -0
  35. package/dist/cache/IWindowStorage.d.ts +2 -0
  36. package/dist/cache/IWindowStorage.d.ts.map +1 -1
  37. package/dist/cache/LocalStorage.d.ts +2 -0
  38. package/dist/cache/LocalStorage.d.ts.map +1 -1
  39. package/dist/cache/LocalStorage.mjs +46 -13
  40. package/dist/cache/LocalStorage.mjs.map +1 -1
  41. package/dist/cache/MemoryStorage.d.ts +1 -0
  42. package/dist/cache/MemoryStorage.d.ts.map +1 -1
  43. package/dist/cache/MemoryStorage.mjs +5 -1
  44. package/dist/cache/MemoryStorage.mjs.map +1 -1
  45. package/dist/cache/SessionStorage.d.ts +1 -0
  46. package/dist/cache/SessionStorage.d.ts.map +1 -1
  47. package/dist/cache/SessionStorage.mjs +5 -1
  48. package/dist/cache/SessionStorage.mjs.map +1 -1
  49. package/dist/cache/TokenCache.mjs +1 -1
  50. package/dist/config/Configuration.d.ts +4 -0
  51. package/dist/config/Configuration.d.ts.map +1 -1
  52. package/dist/config/Configuration.mjs +2 -1
  53. package/dist/config/Configuration.mjs.map +1 -1
  54. package/dist/controllers/ControllerFactory.mjs +1 -1
  55. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  56. package/dist/controllers/StandardController.d.ts.map +1 -1
  57. package/dist/controllers/StandardController.mjs +26 -14
  58. package/dist/controllers/StandardController.mjs.map +1 -1
  59. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  60. package/dist/crypto/BrowserCrypto.mjs +1 -1
  61. package/dist/crypto/CryptoOps.mjs +1 -1
  62. package/dist/crypto/PkceGenerator.mjs +1 -1
  63. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  64. package/dist/custom-auth-path/app/PublicClientApplication.mjs +1 -1
  65. package/dist/custom-auth-path/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  66. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  67. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  68. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  69. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthProvider.mjs +3 -2
  70. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  71. package/dist/custom-auth-path/cache/AccountManager.d.ts.map +1 -1
  72. package/dist/custom-auth-path/cache/AccountManager.mjs +1 -6
  73. package/dist/custom-auth-path/cache/AccountManager.mjs.map +1 -1
  74. package/dist/custom-auth-path/cache/AsyncMemoryStorage.mjs +1 -1
  75. package/dist/custom-auth-path/cache/BrowserCacheManager.d.ts +26 -11
  76. package/dist/custom-auth-path/cache/BrowserCacheManager.d.ts.map +1 -1
  77. package/dist/custom-auth-path/cache/BrowserCacheManager.mjs +239 -56
  78. package/dist/custom-auth-path/cache/BrowserCacheManager.mjs.map +1 -1
  79. package/dist/custom-auth-path/cache/CacheHelpers.d.ts +2 -2
  80. package/dist/custom-auth-path/cache/CacheHelpers.d.ts.map +1 -1
  81. package/dist/custom-auth-path/cache/CacheHelpers.mjs +6 -6
  82. package/dist/custom-auth-path/cache/CacheHelpers.mjs.map +1 -1
  83. package/dist/custom-auth-path/cache/CacheKeys.d.ts +14 -0
  84. package/dist/custom-auth-path/cache/CacheKeys.d.ts.map +1 -0
  85. package/dist/custom-auth-path/cache/CacheKeys.mjs +32 -0
  86. package/dist/custom-auth-path/cache/CacheKeys.mjs.map +1 -0
  87. package/dist/custom-auth-path/cache/CookieStorage.d.ts +1 -0
  88. package/dist/custom-auth-path/cache/CookieStorage.d.ts.map +1 -1
  89. package/dist/custom-auth-path/cache/CookieStorage.mjs +5 -1
  90. package/dist/custom-auth-path/cache/CookieStorage.mjs.map +1 -1
  91. package/dist/custom-auth-path/cache/DatabaseStorage.mjs +1 -1
  92. package/dist/custom-auth-path/cache/EncryptedData.d.ts +8 -0
  93. package/dist/custom-auth-path/cache/EncryptedData.d.ts.map +1 -0
  94. package/dist/custom-auth-path/cache/EncryptedData.mjs +14 -0
  95. package/dist/custom-auth-path/cache/EncryptedData.mjs.map +1 -0
  96. package/dist/custom-auth-path/cache/IWindowStorage.d.ts +2 -0
  97. package/dist/custom-auth-path/cache/IWindowStorage.d.ts.map +1 -1
  98. package/dist/custom-auth-path/cache/LocalStorage.d.ts +2 -0
  99. package/dist/custom-auth-path/cache/LocalStorage.d.ts.map +1 -1
  100. package/dist/custom-auth-path/cache/LocalStorage.mjs +46 -13
  101. package/dist/custom-auth-path/cache/LocalStorage.mjs.map +1 -1
  102. package/dist/custom-auth-path/cache/MemoryStorage.d.ts +1 -0
  103. package/dist/custom-auth-path/cache/MemoryStorage.d.ts.map +1 -1
  104. package/dist/custom-auth-path/cache/MemoryStorage.mjs +5 -1
  105. package/dist/custom-auth-path/cache/MemoryStorage.mjs.map +1 -1
  106. package/dist/custom-auth-path/cache/SessionStorage.d.ts +1 -0
  107. package/dist/custom-auth-path/cache/SessionStorage.d.ts.map +1 -1
  108. package/dist/custom-auth-path/cache/SessionStorage.mjs +5 -1
  109. package/dist/custom-auth-path/cache/SessionStorage.mjs.map +1 -1
  110. package/dist/custom-auth-path/cache/TokenCache.mjs +1 -1
  111. package/dist/custom-auth-path/config/Configuration.d.ts +4 -0
  112. package/dist/custom-auth-path/config/Configuration.d.ts.map +1 -1
  113. package/dist/custom-auth-path/config/Configuration.mjs +2 -1
  114. package/dist/custom-auth-path/config/Configuration.mjs.map +1 -1
  115. package/dist/custom-auth-path/controllers/ControllerFactory.mjs +1 -1
  116. package/dist/custom-auth-path/controllers/StandardController.d.ts.map +1 -1
  117. package/dist/custom-auth-path/controllers/StandardController.mjs +26 -14
  118. package/dist/custom-auth-path/controllers/StandardController.mjs.map +1 -1
  119. package/dist/custom-auth-path/crypto/BrowserCrypto.mjs +1 -1
  120. package/dist/custom-auth-path/crypto/CryptoOps.mjs +1 -1
  121. package/dist/custom-auth-path/crypto/PkceGenerator.mjs +1 -1
  122. package/dist/custom-auth-path/custom_auth/CustomAuthConstants.d.ts +1 -1
  123. package/dist/custom-auth-path/custom_auth/CustomAuthConstants.mjs +1 -1
  124. package/dist/custom-auth-path/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  125. package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  126. package/dist/custom-auth-path/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  127. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  128. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  129. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  130. package/dist/custom-auth-path/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  131. package/dist/custom-auth-path/custom_auth/core/error/CustomAuthError.mjs +1 -1
  132. package/dist/custom-auth-path/custom_auth/core/error/HttpError.mjs +1 -1
  133. package/dist/custom-auth-path/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  134. package/dist/custom-auth-path/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  135. package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  136. package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  137. package/dist/custom-auth-path/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  138. package/dist/custom-auth-path/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  139. package/dist/custom-auth-path/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  140. package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  141. package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  142. package/dist/custom-auth-path/custom_auth/core/error/UnexpectedError.mjs +1 -1
  143. package/dist/custom-auth-path/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  144. package/dist/custom-auth-path/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  145. package/dist/custom-auth-path/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  146. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  147. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  148. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  149. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  150. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  151. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  152. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  153. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  154. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  155. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  156. package/dist/custom-auth-path/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  157. package/dist/custom-auth-path/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  158. package/dist/custom-auth-path/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  159. package/dist/custom-auth-path/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  160. package/dist/custom-auth-path/custom_auth/core/utils/UrlUtils.mjs +1 -1
  161. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  162. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  163. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  164. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  165. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  166. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  167. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  168. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  169. package/dist/custom-auth-path/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  170. package/dist/custom-auth-path/custom_auth/index.mjs +1 -1
  171. package/dist/custom-auth-path/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  172. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  173. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  174. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  175. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  176. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  177. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  178. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  179. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  180. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  181. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  182. package/dist/custom-auth-path/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  183. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  184. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  185. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  186. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  187. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  188. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCredentialResult.mjs +1 -1
  189. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  190. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  191. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  192. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  193. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  194. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  195. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  196. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  197. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  198. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  199. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  200. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  201. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  202. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  203. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  204. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  205. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  206. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  207. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  208. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  209. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  210. package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  211. package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  212. package/dist/custom-auth-path/encode/Base64Decode.mjs +1 -1
  213. package/dist/custom-auth-path/encode/Base64Encode.mjs +1 -1
  214. package/dist/custom-auth-path/error/BrowserAuthError.mjs +1 -1
  215. package/dist/custom-auth-path/error/BrowserAuthErrorCodes.mjs +1 -1
  216. package/dist/custom-auth-path/error/BrowserConfigurationAuthError.mjs +1 -1
  217. package/dist/custom-auth-path/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  218. package/dist/custom-auth-path/error/NativeAuthError.mjs +1 -1
  219. package/dist/custom-auth-path/error/NativeAuthErrorCodes.mjs +1 -1
  220. package/dist/custom-auth-path/event/EventHandler.mjs +1 -1
  221. package/dist/custom-auth-path/event/EventType.mjs +1 -1
  222. package/dist/custom-auth-path/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  223. package/dist/custom-auth-path/interaction_client/BaseInteractionClient.mjs +3 -7
  224. package/dist/custom-auth-path/interaction_client/BaseInteractionClient.mjs.map +1 -1
  225. package/dist/custom-auth-path/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  226. package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  227. package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.mjs +2 -2
  228. package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  229. package/dist/custom-auth-path/interaction_client/PopupClient.d.ts.map +1 -1
  230. package/dist/custom-auth-path/interaction_client/PopupClient.mjs +1 -2
  231. package/dist/custom-auth-path/interaction_client/PopupClient.mjs.map +1 -1
  232. package/dist/custom-auth-path/interaction_client/RedirectClient.d.ts.map +1 -1
  233. package/dist/custom-auth-path/interaction_client/RedirectClient.mjs +1 -2
  234. package/dist/custom-auth-path/interaction_client/RedirectClient.mjs.map +1 -1
  235. package/dist/custom-auth-path/interaction_client/SilentAuthCodeClient.mjs +1 -1
  236. package/dist/custom-auth-path/interaction_client/SilentCacheClient.mjs +1 -1
  237. package/dist/custom-auth-path/interaction_client/SilentIframeClient.mjs +1 -1
  238. package/dist/custom-auth-path/interaction_client/SilentRefreshClient.mjs +1 -1
  239. package/dist/custom-auth-path/interaction_client/StandardInteractionClient.mjs +1 -1
  240. package/dist/custom-auth-path/interaction_handler/InteractionHandler.mjs +1 -1
  241. package/dist/custom-auth-path/interaction_handler/SilentHandler.mjs +1 -1
  242. package/dist/custom-auth-path/naa/AccountInfo.d.ts +1 -0
  243. package/dist/custom-auth-path/naa/AccountInfo.d.ts.map +1 -1
  244. package/dist/custom-auth-path/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  245. package/dist/custom-auth-path/navigation/NavigationClient.mjs +1 -1
  246. package/dist/custom-auth-path/network/FetchClient.mjs +1 -1
  247. package/dist/custom-auth-path/operatingcontext/BaseOperatingContext.d.ts.map +1 -1
  248. package/dist/custom-auth-path/operatingcontext/BaseOperatingContext.mjs +3 -2
  249. package/dist/custom-auth-path/operatingcontext/BaseOperatingContext.mjs.map +1 -1
  250. package/dist/custom-auth-path/operatingcontext/StandardOperatingContext.mjs +1 -1
  251. package/dist/custom-auth-path/packageMetadata.d.ts +1 -1
  252. package/dist/custom-auth-path/packageMetadata.mjs +2 -2
  253. package/dist/custom-auth-path/protocol/Authorize.mjs +1 -1
  254. package/dist/custom-auth-path/request/RequestHelpers.mjs +1 -1
  255. package/dist/custom-auth-path/response/ResponseHandler.mjs +1 -1
  256. package/dist/custom-auth-path/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  257. package/dist/custom-auth-path/utils/BrowserConstants.d.ts +0 -10
  258. package/dist/custom-auth-path/utils/BrowserConstants.d.ts.map +1 -1
  259. package/dist/custom-auth-path/utils/BrowserConstants.mjs +3 -11
  260. package/dist/custom-auth-path/utils/BrowserConstants.mjs.map +1 -1
  261. package/dist/custom-auth-path/utils/BrowserProtocolUtils.mjs +1 -1
  262. package/dist/custom-auth-path/utils/BrowserUtils.mjs +1 -1
  263. package/dist/custom-auth-path/utils/Helpers.d.ts +7 -0
  264. package/dist/custom-auth-path/utils/Helpers.d.ts.map +1 -0
  265. package/dist/custom-auth-path/utils/Helpers.mjs +20 -0
  266. package/dist/custom-auth-path/utils/Helpers.mjs.map +1 -0
  267. package/dist/custom-auth-path/utils/MsalFrameStatsUtils.mjs +1 -1
  268. package/dist/custom_auth/CustomAuthConstants.d.ts +1 -1
  269. package/dist/encode/Base64Decode.mjs +1 -1
  270. package/dist/encode/Base64Encode.mjs +1 -1
  271. package/dist/error/BrowserAuthError.mjs +1 -1
  272. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  273. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  274. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  275. package/dist/error/NativeAuthError.mjs +1 -1
  276. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  277. package/dist/error/NestedAppAuthError.mjs +1 -1
  278. package/dist/event/EventHandler.mjs +1 -1
  279. package/dist/event/EventMessage.mjs +1 -1
  280. package/dist/event/EventType.mjs +1 -1
  281. package/dist/index.mjs +1 -1
  282. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  283. package/dist/interaction_client/BaseInteractionClient.mjs +3 -7
  284. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  285. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  286. package/dist/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  287. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +2 -2
  288. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  289. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  290. package/dist/interaction_client/PopupClient.mjs +1 -2
  291. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  292. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  293. package/dist/interaction_client/RedirectClient.mjs +1 -2
  294. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  295. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  296. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  297. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  298. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  299. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  300. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  301. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  302. package/dist/naa/AccountInfo.d.ts +1 -0
  303. package/dist/naa/AccountInfo.d.ts.map +1 -1
  304. package/dist/naa/BridgeError.mjs +1 -1
  305. package/dist/naa/BridgeProxy.mjs +1 -1
  306. package/dist/naa/BridgeStatusCode.mjs +1 -1
  307. package/dist/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  308. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +3 -1
  309. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  310. package/dist/navigation/NavigationClient.mjs +1 -1
  311. package/dist/network/FetchClient.mjs +1 -1
  312. package/dist/operatingcontext/BaseOperatingContext.d.ts.map +1 -1
  313. package/dist/operatingcontext/BaseOperatingContext.mjs +3 -2
  314. package/dist/operatingcontext/BaseOperatingContext.mjs.map +1 -1
  315. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  316. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  317. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  318. package/dist/packageMetadata.d.ts +1 -1
  319. package/dist/packageMetadata.mjs +2 -2
  320. package/dist/protocol/Authorize.mjs +1 -1
  321. package/dist/request/RequestHelpers.mjs +1 -1
  322. package/dist/response/ResponseHandler.mjs +1 -1
  323. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  324. package/dist/telemetry/BrowserPerformanceClient.mjs +3 -2
  325. package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
  326. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  327. package/dist/utils/BrowserConstants.d.ts +0 -10
  328. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  329. package/dist/utils/BrowserConstants.mjs +3 -12
  330. package/dist/utils/BrowserConstants.mjs.map +1 -1
  331. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  332. package/dist/utils/BrowserUtils.mjs +1 -1
  333. package/dist/utils/Helpers.d.ts +7 -0
  334. package/dist/utils/Helpers.d.ts.map +1 -0
  335. package/dist/utils/Helpers.mjs +20 -0
  336. package/dist/utils/Helpers.mjs.map +1 -0
  337. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  338. package/lib/custom-auth-path/msal-custom-auth.cjs +2686 -2554
  339. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  340. package/lib/custom-auth-path/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  341. package/lib/custom-auth-path/types/cache/AccountManager.d.ts.map +1 -1
  342. package/lib/custom-auth-path/types/cache/BrowserCacheManager.d.ts +26 -11
  343. package/lib/custom-auth-path/types/cache/BrowserCacheManager.d.ts.map +1 -1
  344. package/lib/custom-auth-path/types/cache/CacheHelpers.d.ts +2 -2
  345. package/lib/custom-auth-path/types/cache/CacheHelpers.d.ts.map +1 -1
  346. package/lib/custom-auth-path/types/cache/CacheKeys.d.ts +14 -0
  347. package/lib/custom-auth-path/types/cache/CacheKeys.d.ts.map +1 -0
  348. package/lib/custom-auth-path/types/cache/CookieStorage.d.ts +1 -0
  349. package/lib/custom-auth-path/types/cache/CookieStorage.d.ts.map +1 -1
  350. package/lib/custom-auth-path/types/cache/EncryptedData.d.ts +8 -0
  351. package/lib/custom-auth-path/types/cache/EncryptedData.d.ts.map +1 -0
  352. package/lib/custom-auth-path/types/cache/IWindowStorage.d.ts +2 -0
  353. package/lib/custom-auth-path/types/cache/IWindowStorage.d.ts.map +1 -1
  354. package/lib/custom-auth-path/types/cache/LocalStorage.d.ts +2 -0
  355. package/lib/custom-auth-path/types/cache/LocalStorage.d.ts.map +1 -1
  356. package/lib/custom-auth-path/types/cache/MemoryStorage.d.ts +1 -0
  357. package/lib/custom-auth-path/types/cache/MemoryStorage.d.ts.map +1 -1
  358. package/lib/custom-auth-path/types/cache/SessionStorage.d.ts +1 -0
  359. package/lib/custom-auth-path/types/cache/SessionStorage.d.ts.map +1 -1
  360. package/lib/custom-auth-path/types/config/Configuration.d.ts +4 -0
  361. package/lib/custom-auth-path/types/config/Configuration.d.ts.map +1 -1
  362. package/lib/custom-auth-path/types/controllers/StandardController.d.ts.map +1 -1
  363. package/lib/custom-auth-path/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  364. package/lib/custom-auth-path/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  365. package/lib/custom-auth-path/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  366. package/lib/custom-auth-path/types/interaction_client/PopupClient.d.ts.map +1 -1
  367. package/lib/custom-auth-path/types/interaction_client/RedirectClient.d.ts.map +1 -1
  368. package/lib/custom-auth-path/types/naa/AccountInfo.d.ts +1 -0
  369. package/lib/custom-auth-path/types/naa/AccountInfo.d.ts.map +1 -1
  370. package/lib/custom-auth-path/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  371. package/lib/custom-auth-path/types/operatingcontext/BaseOperatingContext.d.ts.map +1 -1
  372. package/lib/custom-auth-path/types/packageMetadata.d.ts +1 -1
  373. package/lib/custom-auth-path/types/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  374. package/lib/custom-auth-path/types/utils/BrowserConstants.d.ts +0 -10
  375. package/lib/custom-auth-path/types/utils/BrowserConstants.d.ts.map +1 -1
  376. package/lib/custom-auth-path/types/utils/Helpers.d.ts +7 -0
  377. package/lib/custom-auth-path/types/utils/Helpers.d.ts.map +1 -0
  378. package/lib/msal-browser.cjs +2754 -2610
  379. package/lib/msal-browser.cjs.map +1 -1
  380. package/lib/msal-browser.js +2754 -2610
  381. package/lib/msal-browser.js.map +1 -1
  382. package/lib/msal-browser.min.js +67 -69
  383. package/lib/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  384. package/lib/types/cache/AccountManager.d.ts.map +1 -1
  385. package/lib/types/cache/BrowserCacheManager.d.ts +26 -11
  386. package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
  387. package/lib/types/cache/CacheHelpers.d.ts +2 -2
  388. package/lib/types/cache/CacheHelpers.d.ts.map +1 -1
  389. package/lib/types/cache/CacheKeys.d.ts +14 -0
  390. package/lib/types/cache/CacheKeys.d.ts.map +1 -0
  391. package/lib/types/cache/CookieStorage.d.ts +1 -0
  392. package/lib/types/cache/CookieStorage.d.ts.map +1 -1
  393. package/lib/types/cache/EncryptedData.d.ts +8 -0
  394. package/lib/types/cache/EncryptedData.d.ts.map +1 -0
  395. package/lib/types/cache/IWindowStorage.d.ts +2 -0
  396. package/lib/types/cache/IWindowStorage.d.ts.map +1 -1
  397. package/lib/types/cache/LocalStorage.d.ts +2 -0
  398. package/lib/types/cache/LocalStorage.d.ts.map +1 -1
  399. package/lib/types/cache/MemoryStorage.d.ts +1 -0
  400. package/lib/types/cache/MemoryStorage.d.ts.map +1 -1
  401. package/lib/types/cache/SessionStorage.d.ts +1 -0
  402. package/lib/types/cache/SessionStorage.d.ts.map +1 -1
  403. package/lib/types/config/Configuration.d.ts +4 -0
  404. package/lib/types/config/Configuration.d.ts.map +1 -1
  405. package/lib/types/controllers/StandardController.d.ts.map +1 -1
  406. package/lib/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  407. package/lib/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  408. package/lib/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  409. package/lib/types/interaction_client/PopupClient.d.ts.map +1 -1
  410. package/lib/types/interaction_client/RedirectClient.d.ts.map +1 -1
  411. package/lib/types/naa/AccountInfo.d.ts +1 -0
  412. package/lib/types/naa/AccountInfo.d.ts.map +1 -1
  413. package/lib/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  414. package/lib/types/operatingcontext/BaseOperatingContext.d.ts.map +1 -1
  415. package/lib/types/packageMetadata.d.ts +1 -1
  416. package/lib/types/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  417. package/lib/types/utils/BrowserConstants.d.ts +0 -10
  418. package/lib/types/utils/BrowserConstants.d.ts.map +1 -1
  419. package/lib/types/utils/Helpers.d.ts +7 -0
  420. package/lib/types/utils/Helpers.d.ts.map +1 -0
  421. package/package.json +2 -2
  422. package/src/broker/nativeBroker/PlatformAuthProvider.ts +2 -4
  423. package/src/cache/AccountManager.ts +0 -6
  424. package/src/cache/BrowserCacheManager.ts +381 -61
  425. package/src/cache/CacheHelpers.ts +13 -5
  426. package/src/cache/CacheKeys.ts +39 -0
  427. package/src/cache/CookieStorage.ts +5 -0
  428. package/src/cache/EncryptedData.ts +19 -0
  429. package/src/cache/IWindowStorage.ts +8 -0
  430. package/src/cache/LocalStorage.ts +83 -27
  431. package/src/cache/MemoryStorage.ts +5 -0
  432. package/src/cache/SessionStorage.ts +5 -0
  433. package/src/config/Configuration.ts +5 -0
  434. package/src/controllers/StandardController.ts +28 -11
  435. package/src/interaction_client/BaseInteractionClient.ts +1 -15
  436. package/src/interaction_client/PlatformAuthInteractionClient.ts +4 -2
  437. package/src/interaction_client/PopupClient.ts +0 -5
  438. package/src/interaction_client/RedirectClient.ts +0 -5
  439. package/src/naa/AccountInfo.ts +1 -0
  440. package/src/naa/mapping/NestedAppAuthAdapter.ts +4 -0
  441. package/src/operatingcontext/BaseOperatingContext.ts +2 -5
  442. package/src/packageMetadata.ts +1 -1
  443. package/src/telemetry/BrowserPerformanceClient.ts +2 -4
  444. package/src/utils/BrowserConstants.ts +0 -15
  445. package/src/utils/Helpers.ts +19 -0
@@ -1 +1 @@
1
- {"version":3,"file":"AccountManager.mjs","sources":["../../../../src/cache/AccountManager.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAKH;;;;AAIG;AACG,SAAU,cAAc,CAC1B,MAAc,EACd,cAAmC,EACnC,WAAoB,EACpB,aAAqB,EACrB,aAA6B,EAAA;AAE7B,IAAA,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACxC,IAAA,OAAO,WAAW;UACZ,cAAc,CAAC,cAAc,CAAC,aAAa,IAAI,EAAE,EAAE,aAAa,CAAC;UACjE,EAAE,CAAC;AACb,CAAC;AAED;;;;AAIG;AACG,SAAU,UAAU,CACtB,aAA4B,EAC5B,MAAc,EACd,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,MAAM,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;IAClC,IAAI,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;AACzC,QAAA,MAAM,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC;AACxD,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,EAC3B,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,cAAc,CAAC,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC;AAED;;AAEG;AACa,SAAA,gBAAgB,CAC5B,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,OAAO,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAC1D;;;;"}
1
+ {"version":3,"file":"AccountManager.mjs","sources":["../../../../src/cache/AccountManager.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAKH;;;;AAIG;AACG,SAAU,cAAc,CAC1B,MAAc,EACd,cAAmC,EACnC,WAAoB,EACpB,aAAqB,EACrB,aAA6B,EAAA;AAE7B,IAAA,MAAM,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC;AACxC,IAAA,OAAO,WAAW;UACZ,cAAc,CAAC,cAAc,CAAC,aAAa,IAAI,EAAE,EAAE,aAAa,CAAC;UACjE,EAAE,CAAC;AACb,CAAC;AAED;;;;AAIG;AACG,SAAU,UAAU,CACtB,aAA4B,EAC5B,MAAc,EACd,cAAmC,EACnC,aAAqB,EAAA;IAErB,MAAM,OAAO,GAAuB,cAAc,CAAC,wBAAwB,CACvE,aAAa,EACb,aAAa,CAChB,CAAC;AAEF,IAAA,IAAI,OAAO,EAAE;AACT,QAAA,MAAM,CAAC,OAAO,CACV,+DAA+D,CAClE,CAAC;AACF,QAAA,OAAO,OAAO,CAAC;AAClB,KAAA;AAAM,SAAA;AACH,QAAA,MAAM,CAAC,OAAO,CAAC,uDAAuD,CAAC,CAAC;AACxE,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;AACL,CAAC;AAED;;;;;;;AAOG;AACG,SAAU,oBAAoB,CAChC,QAAgB,EAChB,MAAc,EACd,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,MAAM,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IAC5C,IAAI,CAAC,QAAQ,EAA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,CAC/B,cAAsB,EACtB,MAAc,EACd,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAC3C,IAAI,CAAC,cAAc,EAAE;AACjB,QAAA,MAAM,CAAC,OAAO,CAAC,iDAAiD,CAAC,CAAC;AAClE,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;AAED,IAAA,MAAM,OAAO,GAAG,cAAc,CAAC,wBAAwB,CACnD;QACI,cAAc;KACjB,EACD,aAAa,CAChB,CAAC;AACF,IAAA,IAAI,OAAO,EAAE;AACT,QAAA,MAAM,CAAC,OAAO,CACV,uEAAuE,CAC1E,CAAC;AACF,QAAA,MAAM,CAAC,UAAU,CACb,8EAA8E,cAAc,CAAA,CAAE,CACjG,CAAC;AACF,QAAA,OAAO,OAAO,CAAC;AAClB,KAAA;AAAM,SAAA;AACH,QAAA,MAAM,CAAC,OAAO,CACV,gEAAgE,CACnE,CAAC;AACF,QAAA,OAAO,IAAI,CAAC;AACf,KAAA;AACL,CAAC;AAED;;;AAGG;SACa,gBAAgB,CAC5B,OAA2B,EAC3B,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,cAAc,CAAC,gBAAgB,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;AAC5D,CAAC;AAED;;AAEG;AACa,SAAA,gBAAgB,CAC5B,cAAmC,EACnC,aAAqB,EAAA;AAErB,IAAA,OAAO,cAAc,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC;AAC1D;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v4.18.0 2025-07-30 */
1
+ /*! @azure/msal-browser v4.20.0 2025-08-12 */
2
2
  'use strict';
3
3
  import { BrowserAuthError } from '../error/BrowserAuthError.mjs';
4
4
  import { DatabaseStorage } from './DatabaseStorage.mjs';
@@ -1,4 +1,4 @@
1
- import { AccessTokenEntity, AccountEntity, AccountInfo, AppMetadataEntity, AuthorityMetadataEntity, CacheManager, CacheRecord, CommonAuthorizationUrlRequest, ICrypto, IdTokenEntity, IPerformanceClient, Logger, RefreshTokenEntity, ServerTelemetryEntity, StaticAuthorityOptions, StoreInCache, ThrottlingEntity, TokenKeys } from "@azure/msal-common/browser";
1
+ import { AccessTokenEntity, AccountEntity, AccountInfo, AppMetadataEntity, AuthorityMetadataEntity, CacheManager, CacheRecord, CommonAuthorizationUrlRequest, ICrypto, IdTokenEntity, IPerformanceClient, Logger, RefreshTokenEntity, ServerTelemetryEntity, StaticAuthorityOptions, StoreInCache, ThrottlingEntity, TokenKeys, CredentialEntity } from "@azure/msal-common/browser";
2
2
  import { CacheOptions } from "../config/Configuration.js";
3
3
  import { INTERACTION_TYPE } from "../utils/BrowserConstants.js";
4
4
  import { MemoryStorage } from "./MemoryStorage.js";
@@ -26,6 +26,11 @@ export declare class BrowserCacheManager extends CacheManager {
26
26
  private eventHandler;
27
27
  constructor(clientId: string, cacheConfig: Required<CacheOptions>, cryptoImpl: ICrypto, logger: Logger, performanceClient: IPerformanceClient, eventHandler: EventHandler, staticAuthorityOptions?: StaticAuthorityOptions);
28
28
  initialize(correlationId: string): Promise<void>;
29
+ /**
30
+ * Migrates any existing cache data from previous versions of MSAL.js into the current cache structure.
31
+ */
32
+ migrateExistingCache(correlationId: string): Promise<void>;
33
+ updateV0ToCurrent(currentSchema: number, v0Keys: Array<string>, v1Keys: Array<string>, correlationId: string): Promise<void[]>;
29
34
  /**
30
35
  * Tracks upgrades and downgrades for telemetry and debugging purposes
31
36
  */
@@ -79,12 +84,7 @@ export declare class BrowserCacheManager extends CacheManager {
79
84
  * Extends inherited removeAccount function to include removal of the account key from the map
80
85
  * @param key
81
86
  */
82
- removeAccount(key: string, correlationId: string): void;
83
- /**
84
- * Removes credentials associated with the provided account
85
- * @param account
86
- */
87
- removeAccountContext(account: AccountEntity, correlationId: string): void;
87
+ removeAccount(account: AccountInfo, correlationId: string): void;
88
88
  /**
89
89
  * Removes given idToken from the cache and from the key map
90
90
  * @param key
@@ -101,7 +101,7 @@ export declare class BrowserCacheManager extends CacheManager {
101
101
  * @param correlationId
102
102
  * @param tokenKeys
103
103
  */
104
- removeAccessTokenKeys(keys: Array<string>, correlationId: string): void;
104
+ removeAccessTokenKeys(keys: Array<string>, correlationId: string, schemaVersion?: number): void;
105
105
  /**
106
106
  * Removes given refreshToken from the cache and from the key map
107
107
  * @param key
@@ -111,14 +111,14 @@ export declare class BrowserCacheManager extends CacheManager {
111
111
  * Gets the keys for the cached tokens associated with this clientId
112
112
  * @returns
113
113
  */
114
- getTokenKeys(): TokenKeys;
114
+ getTokenKeys(schemaVersion?: number): TokenKeys;
115
115
  /**
116
116
  * Stores the token keys in the cache
117
117
  * @param tokenKeys
118
118
  * @param correlationId
119
119
  * @returns
120
120
  */
121
- setTokenKeys(tokenKeys: TokenKeys, correlationId: string): void;
121
+ setTokenKeys(tokenKeys: TokenKeys, correlationId: string, schemaVersion?: number): void;
122
122
  /**
123
123
  * generates idToken entity from a string
124
124
  * @param idTokenKey
@@ -254,11 +254,26 @@ export declare class BrowserCacheManager extends CacheManager {
254
254
  */
255
255
  clearTokensAndKeysWithClaims(correlationId: string): void;
256
256
  /**
257
- * Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
257
+ * Prepend msal.<client-id> to each key
258
258
  * @param key
259
259
  * @param addInstanceId
260
260
  */
261
261
  generateCacheKey(key: string): string;
262
+ /**
263
+ * Cache Key: msal.<schema_version>-<home_account_id>-<environment>-<credential_type>-<client_id or familyId>-<realm>-<scopes>-<claims hash>-<scheme>
264
+ * IdToken Example: uid.utid-login.microsoftonline.com-idtoken-app_client_id-contoso.com
265
+ * AccessToken Example: uid.utid-login.microsoftonline.com-accesstoken-app_client_id-contoso.com-scope1 scope2--pop
266
+ * RefreshToken Example: uid.utid-login.microsoftonline.com-refreshtoken-1-contoso.com
267
+ * @param credentialEntity
268
+ * @returns
269
+ */
270
+ generateCredentialKey(credential: CredentialEntity): string;
271
+ /**
272
+ * Cache Key: msal.<schema_version>.<home_account_id>.<environment>.<tenant_id>
273
+ * @param account
274
+ * @returns
275
+ */
276
+ generateAccountKey(account: AccountInfo): string;
262
277
  /**
263
278
  * Reset all temporary cache items
264
279
  * @param state
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserCacheManager.d.ts","sourceRoot":"","sources":["../../../src/cache/BrowserCacheManager.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,iBAAiB,EACjB,aAAa,EACb,WAAW,EAEX,iBAAiB,EAEjB,uBAAuB,EAIvB,YAAY,EACZ,WAAW,EACX,6BAA6B,EAI7B,OAAO,EACP,aAAa,EAEb,kBAAkB,EAClB,MAAM,EAGN,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,YAAY,EAEZ,gBAAgB,EAEhB,SAAS,EACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAK1D,OAAO,EAGH,gBAAgB,EAGnB,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIxD;;;;GAIG;AACH,qBAAa,mBAAoB,SAAQ,YAAY;IAEjD,SAAS,C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-1,8 +1,9 @@
1
- /*! @azure/msal-browser v4.18.0 2025-07-30 */
1
+ /*! @azure/msal-browser v4.20.0 2025-08-12 */
2
2
  'use strict';
3
- import { CacheManager, createCacheError, CacheErrorCodes, invokeAsync, PerformanceEvents, AccountEntity, CacheHelpers, Constants, PersistentCacheKeys, TimeUtils, StringUtils, CacheError, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common/browser';
3
+ import { CacheManager, CacheHelpers, TimeUtils, DEFAULT_TOKEN_RENEWAL_OFFSET_SEC, createCacheError, CacheErrorCodes, invokeAsync, PerformanceEvents, AccountEntity, Constants, PersistentCacheKeys, StringUtils, AuthenticationScheme, CacheError, DEFAULT_CRYPTO_IMPLEMENTATION, CredentialType } from '@azure/msal-common/browser';
4
4
  import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
5
- import { StaticCacheKeys, BrowserCacheLocation, InMemoryCacheKeys, TemporaryCacheKeys, INTERACTION_TYPE } from '../utils/BrowserConstants.mjs';
5
+ import { BrowserCacheLocation, InMemoryCacheKeys, TemporaryCacheKeys, INTERACTION_TYPE } from '../utils/BrowserConstants.mjs';
6
+ import { ACCOUNT_SCHEMA_VERSION, CREDENTIAL_SCHEMA_VERSION, getAccountKeysCacheKey, PREFIX, CACHE_KEY_SEPARATOR, VERSION_CACHE_KEY, getTokenKeysCacheKey } from './CacheKeys.mjs';
6
7
  import { LocalStorage } from './LocalStorage.mjs';
7
8
  import { SessionStorage } from './SessionStorage.mjs';
8
9
  import { MemoryStorage } from './MemoryStorage.mjs';
@@ -13,6 +14,8 @@ import { getAccountKeys, getTokenKeys } from './CacheHelpers.mjs';
13
14
  import { EventType } from '../event/EventType.mjs';
14
15
  import { clearHash } from '../utils/BrowserUtils.mjs';
15
16
  import { version } from '../packageMetadata.mjs';
17
+ import { removeElementFromArray } from '../utils/Helpers.mjs';
18
+ import { isEncrypted } from './EncryptedData.mjs';
16
19
  import { noTokenRequestCacheError, unableToParseTokenRequestCacheError, interactionInProgress } from '../error/BrowserAuthErrorCodes.mjs';
17
20
 
18
21
  /*
@@ -36,20 +39,132 @@ class BrowserCacheManager extends CacheManager {
36
39
  this.eventHandler = eventHandler;
37
40
  }
38
41
  async initialize(correlationId) {
42
+ this.performanceClient.addFields({
43
+ cacheLocation: this.cacheConfig.cacheLocation,
44
+ cacheRetentionDays: this.cacheConfig.cacheRetentionDays,
45
+ }, correlationId);
39
46
  await this.browserStorage.initialize(correlationId);
47
+ await this.migrateExistingCache(correlationId);
40
48
  this.trackVersionChanges(correlationId);
41
49
  }
50
+ /**
51
+ * Migrates any existing cache data from previous versions of MSAL.js into the current cache structure.
52
+ */
53
+ async migrateExistingCache(correlationId) {
54
+ const accountKeys0 = getAccountKeys(this.browserStorage, 0);
55
+ const tokenKeys0 = getTokenKeys(this.clientId, this.browserStorage, 0);
56
+ this.performanceClient.addFields({
57
+ oldAccountCount: accountKeys0.length,
58
+ oldAccessCount: tokenKeys0.accessToken.length,
59
+ oldIdCount: tokenKeys0.idToken.length,
60
+ oldRefreshCount: tokenKeys0.refreshToken.length,
61
+ }, correlationId);
62
+ const accountKeys1 = getAccountKeys(this.browserStorage, 1);
63
+ const tokenKeys1 = getTokenKeys(this.clientId, this.browserStorage, 1);
64
+ this.performanceClient.addFields({
65
+ currAccountCount: accountKeys1.length,
66
+ currAccessCount: tokenKeys1.accessToken.length,
67
+ currIdCount: tokenKeys1.idToken.length,
68
+ currRefreshCount: tokenKeys1.refreshToken.length,
69
+ }, correlationId);
70
+ await Promise.all([
71
+ this.updateV0ToCurrent(ACCOUNT_SCHEMA_VERSION, accountKeys0, accountKeys1, correlationId),
72
+ this.updateV0ToCurrent(CREDENTIAL_SCHEMA_VERSION, tokenKeys0.idToken, tokenKeys1.idToken, correlationId),
73
+ this.updateV0ToCurrent(CREDENTIAL_SCHEMA_VERSION, tokenKeys0.accessToken, tokenKeys1.accessToken, correlationId),
74
+ this.updateV0ToCurrent(CREDENTIAL_SCHEMA_VERSION, tokenKeys0.refreshToken, tokenKeys1.refreshToken, correlationId),
75
+ ]);
76
+ if (accountKeys0.length > 0) {
77
+ this.browserStorage.setItem(getAccountKeysCacheKey(0), JSON.stringify(accountKeys0));
78
+ }
79
+ else {
80
+ this.browserStorage.removeItem(getAccountKeysCacheKey(0));
81
+ }
82
+ if (accountKeys1.length > 0) {
83
+ this.browserStorage.setItem(getAccountKeysCacheKey(1), JSON.stringify(accountKeys1));
84
+ }
85
+ else {
86
+ this.browserStorage.removeItem(getAccountKeysCacheKey(1));
87
+ }
88
+ this.setTokenKeys(tokenKeys0, correlationId, 0);
89
+ this.setTokenKeys(tokenKeys1, correlationId, 1);
90
+ }
91
+ async updateV0ToCurrent(currentSchema, v0Keys, v1Keys, correlationId) {
92
+ const upgradePromises = [];
93
+ for (const v0Key of [...v0Keys]) {
94
+ const rawV0Value = this.browserStorage.getItem(v0Key);
95
+ const parsedV0Value = this.validateAndParseJson(rawV0Value || "");
96
+ if (!parsedV0Value) {
97
+ removeElementFromArray(v0Keys, v0Key);
98
+ continue;
99
+ }
100
+ if (!parsedV0Value.lastUpdatedAt) {
101
+ // Add lastUpdatedAt to the existing v0 entry if it doesnt exist so we know when it's safe to remove it
102
+ parsedV0Value.lastUpdatedAt = Date.now().toString();
103
+ this.setItem(v0Key, JSON.stringify(parsedV0Value), correlationId);
104
+ }
105
+ const decryptedData = isEncrypted(parsedV0Value)
106
+ ? await this.browserStorage.decryptData(v0Key, parsedV0Value, correlationId)
107
+ : parsedV0Value;
108
+ let expirationTime;
109
+ if (decryptedData) {
110
+ if (CacheHelpers.isAccessTokenEntity(decryptedData)) {
111
+ expirationTime = decryptedData.expiresOn;
112
+ }
113
+ else if (CacheHelpers.isRefreshTokenEntity(decryptedData)) {
114
+ expirationTime = decryptedData.expiresOn;
115
+ }
116
+ }
117
+ if (!decryptedData ||
118
+ TimeUtils.isCacheExpired(parsedV0Value.lastUpdatedAt, this.cacheConfig.cacheRetentionDays) ||
119
+ (expirationTime &&
120
+ TimeUtils.isTokenExpired(expirationTime, DEFAULT_TOKEN_RENEWAL_OFFSET_SEC))) {
121
+ this.browserStorage.removeItem(v0Key);
122
+ removeElementFromArray(v0Keys, v0Key);
123
+ this.performanceClient.incrementFields({ expiredCacheRemovedCount: 1 }, correlationId);
124
+ continue;
125
+ }
126
+ if (this.cacheConfig.cacheLocation !==
127
+ BrowserCacheLocation.LocalStorage ||
128
+ isEncrypted(parsedV0Value)) {
129
+ const v1Key = `${PREFIX}.${currentSchema}${CACHE_KEY_SEPARATOR}${v0Key}`;
130
+ const rawV1Entry = this.browserStorage.getItem(v1Key);
131
+ if (!rawV1Entry) {
132
+ upgradePromises.push(this.setUserData(v1Key, JSON.stringify(decryptedData), correlationId, parsedV0Value.lastUpdatedAt).then(() => {
133
+ v1Keys.push(v1Key);
134
+ this.performanceClient.incrementFields({ upgradedCacheCount: 1 }, correlationId);
135
+ }));
136
+ continue;
137
+ }
138
+ else {
139
+ const parsedV1Entry = this.validateAndParseJson(rawV1Entry);
140
+ // If the entry already exists but is older than the v0 entry, replace it
141
+ if (Number(parsedV0Value.lastUpdatedAt) >
142
+ Number(parsedV1Entry.lastUpdatedAt)) {
143
+ upgradePromises.push(this.setUserData(v1Key, JSON.stringify(decryptedData), correlationId, parsedV0Value.lastUpdatedAt).then(() => {
144
+ this.performanceClient.incrementFields({ updatedCacheFromV0Count: 1 }, correlationId);
145
+ }));
146
+ continue;
147
+ }
148
+ }
149
+ }
150
+ /*
151
+ * Note: If we reach here for unencrypted localStorage data, we continue without migrating
152
+ * as we can't migrate unencrypted localStorage data right now since we can't guarantee KMSI=no
153
+ */
154
+ }
155
+ return Promise.all(upgradePromises);
156
+ }
42
157
  /**
43
158
  * Tracks upgrades and downgrades for telemetry and debugging purposes
44
159
  */
45
160
  trackVersionChanges(correlationId) {
46
- const previousVersion = this.browserStorage.getItem(StaticCacheKeys.VERSION);
161
+ const previousVersion = this.browserStorage.getItem(VERSION_CACHE_KEY);
47
162
  if (previousVersion) {
48
163
  this.logger.info(`MSAL.js was last initialized by version: ${previousVersion}`);
49
164
  this.performanceClient.addFields({ previousLibraryVersion: previousVersion }, correlationId);
50
165
  }
51
166
  if (previousVersion !== version) {
52
- this.setItem(StaticCacheKeys.VERSION, version, correlationId);
167
+ this.setItem(VERSION_CACHE_KEY, version, correlationId);
53
168
  }
54
169
  }
55
170
  /**
@@ -57,6 +172,9 @@ class BrowserCacheManager extends CacheManager {
57
172
  * @param input
58
173
  */
59
174
  validateAndParseJson(jsonValue) {
175
+ if (!jsonValue) {
176
+ return null;
177
+ }
60
178
  try {
61
179
  const parsedJson = JSON.parse(jsonValue);
62
180
  /**
@@ -79,6 +197,7 @@ class BrowserCacheManager extends CacheManager {
79
197
  * @param value
80
198
  */
81
199
  setItem(key, value, correlationId) {
200
+ let tokenKeysV0Count = 0;
82
201
  let accessTokenKeys = [];
83
202
  const maxRetries = 20;
84
203
  for (let i = 0; i <= maxRetries; i++) {
@@ -86,7 +205,13 @@ class BrowserCacheManager extends CacheManager {
86
205
  this.browserStorage.setItem(key, value);
87
206
  if (i > 0) {
88
207
  // Finally update the token keys array with the tokens removed
89
- this.removeAccessTokenKeys(accessTokenKeys.slice(0, i), correlationId);
208
+ if (i <= tokenKeysV0Count) {
209
+ this.removeAccessTokenKeys(accessTokenKeys.slice(0, i), correlationId, 0);
210
+ }
211
+ else {
212
+ this.removeAccessTokenKeys(accessTokenKeys.slice(0, tokenKeysV0Count), correlationId, 0);
213
+ this.removeAccessTokenKeys(accessTokenKeys.slice(tokenKeysV0Count, i), correlationId);
214
+ }
90
215
  }
91
216
  break; // If setItem succeeds, exit the loop
92
217
  }
@@ -96,16 +221,17 @@ class BrowserCacheManager extends CacheManager {
96
221
  CacheErrorCodes.cacheQuotaExceeded &&
97
222
  i < maxRetries) {
98
223
  if (!accessTokenKeys.length) {
99
- if (key ===
100
- `${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`) {
101
- // If we are currently trying to set the token keys, use the value we're trying to set
102
- accessTokenKeys = JSON.parse(value)
103
- .accessToken;
104
- }
105
- else {
106
- // If token keys have not been initialized, get them
107
- accessTokenKeys = this.getTokenKeys().accessToken;
108
- }
224
+ // If we are currently trying to set the token keys, use the value we're trying to set
225
+ const tokenKeys0 = key ===
226
+ getTokenKeysCacheKey(this.clientId, 0)
227
+ ? JSON.parse(value).accessToken
228
+ : this.getTokenKeys(0).accessToken;
229
+ const tokenKeys1 = key ===
230
+ getTokenKeysCacheKey(this.clientId)
231
+ ? JSON.parse(value).accessToken
232
+ : this.getTokenKeys().accessToken;
233
+ accessTokenKeys = [...tokenKeys0, ...tokenKeys1];
234
+ tokenKeysV0Count = tokenKeys0.length;
109
235
  }
110
236
  if (accessTokenKeys.length <= i) {
111
237
  // Nothing to remove, rethrow the error
@@ -129,6 +255,7 @@ class BrowserCacheManager extends CacheManager {
129
255
  * @param correlationId
130
256
  */
131
257
  async setUserData(key, value, correlationId, timestamp) {
258
+ let tokenKeysV0Count = 0;
132
259
  let accessTokenKeys = [];
133
260
  const maxRetries = 20;
134
261
  for (let i = 0; i <= maxRetries; i++) {
@@ -136,7 +263,13 @@ class BrowserCacheManager extends CacheManager {
136
263
  await invokeAsync(this.browserStorage.setUserData.bind(this.browserStorage), PerformanceEvents.SetUserData, this.logger, this.performanceClient)(key, value, correlationId, timestamp);
137
264
  if (i > 0) {
138
265
  // Finally update the token keys array with the tokens removed
139
- this.removeAccessTokenKeys(accessTokenKeys.slice(0, i), correlationId);
266
+ if (i <= tokenKeysV0Count) {
267
+ this.removeAccessTokenKeys(accessTokenKeys.slice(0, i), correlationId, 0);
268
+ }
269
+ else {
270
+ this.removeAccessTokenKeys(accessTokenKeys.slice(0, tokenKeysV0Count), correlationId, 0);
271
+ this.removeAccessTokenKeys(accessTokenKeys.slice(tokenKeysV0Count, i), correlationId);
272
+ }
140
273
  }
141
274
  break; // If setItem succeeds, exit the loop
142
275
  }
@@ -146,7 +279,10 @@ class BrowserCacheManager extends CacheManager {
146
279
  CacheErrorCodes.cacheQuotaExceeded &&
147
280
  i < maxRetries) {
148
281
  if (!accessTokenKeys.length) {
149
- accessTokenKeys = this.getTokenKeys().accessToken;
282
+ const tokenKeys0 = this.getTokenKeys(0).accessToken;
283
+ const tokenKeys1 = this.getTokenKeys().accessToken;
284
+ accessTokenKeys = [...tokenKeys0, ...tokenKeys1];
285
+ tokenKeysV0Count = tokenKeys0.length;
150
286
  }
151
287
  if (accessTokenKeys.length <= i) {
152
288
  // Nothing left to remove, rethrow the error
@@ -188,7 +324,7 @@ class BrowserCacheManager extends CacheManager {
188
324
  */
189
325
  async setAccount(account, correlationId) {
190
326
  this.logger.trace("BrowserCacheManager.setAccount called");
191
- const key = account.generateAccountKey();
327
+ const key = this.generateAccountKey(account.getAccountInfo());
192
328
  const timestamp = Date.now().toString();
193
329
  account.lastUpdatedAt = timestamp;
194
330
  await this.setUserData(key, JSON.stringify(account), correlationId, timestamp);
@@ -220,7 +356,7 @@ class BrowserCacheManager extends CacheManager {
220
356
  if (accountKeys.indexOf(key) === -1) {
221
357
  // Only add key if it does not already exist in the map
222
358
  accountKeys.push(key);
223
- this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys), correlationId);
359
+ this.setItem(getAccountKeysCacheKey(), JSON.stringify(accountKeys), correlationId);
224
360
  this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key added");
225
361
  return true;
226
362
  }
@@ -242,11 +378,11 @@ class BrowserCacheManager extends CacheManager {
242
378
  accountKeys.splice(removalIndex, 1);
243
379
  if (accountKeys.length === 0) {
244
380
  // If no keys left, remove the map
245
- this.removeItem(StaticCacheKeys.ACCOUNT_KEYS);
381
+ this.removeItem(getAccountKeysCacheKey());
246
382
  return;
247
383
  }
248
384
  else {
249
- this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys), correlationId);
385
+ this.setItem(getAccountKeysCacheKey(), JSON.stringify(accountKeys), correlationId);
250
386
  }
251
387
  this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap account key removed");
252
388
  }
@@ -258,21 +394,26 @@ class BrowserCacheManager extends CacheManager {
258
394
  * Extends inherited removeAccount function to include removal of the account key from the map
259
395
  * @param key
260
396
  */
261
- removeAccount(key, correlationId) {
262
- super.removeAccount(key, correlationId);
263
- this.removeAccountKeyFromMap(key, correlationId);
264
- }
265
- /**
266
- * Removes credentials associated with the provided account
267
- * @param account
268
- */
269
- removeAccountContext(account, correlationId) {
270
- super.removeAccountContext(account, correlationId);
397
+ removeAccount(account, correlationId) {
398
+ const activeAccount = this.getActiveAccount(correlationId);
399
+ if (activeAccount?.homeAccountId === account.homeAccountId &&
400
+ activeAccount?.environment === account.environment) {
401
+ this.setActiveAccount(null, correlationId);
402
+ }
403
+ super.removeAccount(account, correlationId);
404
+ this.removeAccountKeyFromMap(this.generateAccountKey(account), correlationId);
405
+ // Remove all other associated cache items
406
+ this.browserStorage.getKeys().forEach((key) => {
407
+ if (key.includes(account.homeAccountId) &&
408
+ key.includes(account.environment)) {
409
+ this.browserStorage.removeItem(key);
410
+ }
411
+ });
271
412
  /**
272
413
  * @deprecated - Remove this in next major version in favor of more consistent LOGOUT event
273
414
  */
274
415
  if (this.cacheConfig.cacheLocation === BrowserCacheLocation.LocalStorage) {
275
- this.eventHandler.emitEvent(EventType.ACCOUNT_REMOVED, undefined, account.getAccountInfo());
416
+ this.eventHandler.emitEvent(EventType.ACCOUNT_REMOVED, undefined, account);
276
417
  }
277
418
  }
278
419
  /**
@@ -303,9 +444,9 @@ class BrowserCacheManager extends CacheManager {
303
444
  * @param correlationId
304
445
  * @param tokenKeys
305
446
  */
306
- removeAccessTokenKeys(keys, correlationId) {
447
+ removeAccessTokenKeys(keys, correlationId, schemaVersion = CREDENTIAL_SCHEMA_VERSION) {
307
448
  this.logger.trace("removeAccessTokenKey called");
308
- const tokenKeys = this.getTokenKeys();
449
+ const tokenKeys = this.getTokenKeys(schemaVersion);
309
450
  let keysRemoved = 0;
310
451
  keys.forEach((key) => {
311
452
  const accessRemoval = tokenKeys.accessToken.indexOf(key);
@@ -316,7 +457,7 @@ class BrowserCacheManager extends CacheManager {
316
457
  });
317
458
  if (keysRemoved > 0) {
318
459
  this.logger.info(`removed ${keysRemoved} accessToken keys from tokenKeys map`);
319
- this.setTokenKeys(tokenKeys, correlationId);
460
+ this.setTokenKeys(tokenKeys, correlationId, schemaVersion);
320
461
  return;
321
462
  }
322
463
  }
@@ -338,8 +479,8 @@ class BrowserCacheManager extends CacheManager {
338
479
  * Gets the keys for the cached tokens associated with this clientId
339
480
  * @returns
340
481
  */
341
- getTokenKeys() {
342
- return getTokenKeys(this.clientId, this.browserStorage);
482
+ getTokenKeys(schemaVersion = CREDENTIAL_SCHEMA_VERSION) {
483
+ return getTokenKeys(this.clientId, this.browserStorage, schemaVersion);
343
484
  }
344
485
  /**
345
486
  * Stores the token keys in the cache
@@ -347,16 +488,16 @@ class BrowserCacheManager extends CacheManager {
347
488
  * @param correlationId
348
489
  * @returns
349
490
  */
350
- setTokenKeys(tokenKeys, correlationId) {
491
+ setTokenKeys(tokenKeys, correlationId, schemaVersion = CREDENTIAL_SCHEMA_VERSION) {
351
492
  if (tokenKeys.idToken.length === 0 &&
352
493
  tokenKeys.accessToken.length === 0 &&
353
494
  tokenKeys.refreshToken.length === 0) {
354
495
  // If no keys left, remove the map
355
- this.removeItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`);
496
+ this.removeItem(getTokenKeysCacheKey(this.clientId, schemaVersion));
356
497
  return;
357
498
  }
358
499
  else {
359
- this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys), correlationId);
500
+ this.setItem(getTokenKeysCacheKey(this.clientId, schemaVersion), JSON.stringify(tokenKeys), correlationId);
360
501
  }
361
502
  }
362
503
  /**
@@ -384,7 +525,7 @@ class BrowserCacheManager extends CacheManager {
384
525
  */
385
526
  async setIdTokenCredential(idToken, correlationId) {
386
527
  this.logger.trace("BrowserCacheManager.setIdTokenCredential called");
387
- const idTokenKey = CacheHelpers.generateCredentialKey(idToken);
528
+ const idTokenKey = this.generateCredentialKey(idToken);
388
529
  const timestamp = Date.now().toString();
389
530
  idToken.lastUpdatedAt = timestamp;
390
531
  await this.setUserData(idTokenKey, JSON.stringify(idToken), correlationId, timestamp);
@@ -421,7 +562,7 @@ class BrowserCacheManager extends CacheManager {
421
562
  */
422
563
  async setAccessTokenCredential(accessToken, correlationId) {
423
564
  this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");
424
- const accessTokenKey = CacheHelpers.generateCredentialKey(accessToken);
565
+ const accessTokenKey = this.generateCredentialKey(accessToken);
425
566
  const timestamp = Date.now().toString();
426
567
  accessToken.lastUpdatedAt = timestamp;
427
568
  await this.setUserData(accessTokenKey, JSON.stringify(accessToken), correlationId, timestamp);
@@ -460,7 +601,7 @@ class BrowserCacheManager extends CacheManager {
460
601
  */
461
602
  async setRefreshTokenCredential(refreshToken, correlationId) {
462
603
  this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");
463
- const refreshTokenKey = CacheHelpers.generateCredentialKey(refreshToken);
604
+ const refreshTokenKey = this.generateCredentialKey(refreshToken);
464
605
  const timestamp = Date.now().toString();
465
606
  refreshToken.lastUpdatedAt = timestamp;
466
607
  await this.setUserData(refreshTokenKey, JSON.stringify(refreshToken), correlationId, timestamp);
@@ -732,14 +873,14 @@ class BrowserCacheManager extends CacheManager {
732
873
  this.removeAppMetadata(correlationId);
733
874
  // Remove temp storage first to make sure any cookies are cleared
734
875
  this.temporaryCacheStorage.getKeys().forEach((cacheKey) => {
735
- if (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||
876
+ if (cacheKey.indexOf(PREFIX) !== -1 ||
736
877
  cacheKey.indexOf(this.clientId) !== -1) {
737
878
  this.removeTemporaryItem(cacheKey);
738
879
  }
739
880
  });
740
881
  // Removes all remaining MSAL cache items
741
882
  this.browserStorage.getKeys().forEach((cacheKey) => {
742
- if (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||
883
+ if (cacheKey.indexOf(PREFIX) !== -1 ||
743
884
  cacheKey.indexOf(this.clientId) !== -1) {
744
885
  this.browserStorage.removeItem(cacheKey);
745
886
  }
@@ -771,19 +912,60 @@ class BrowserCacheManager extends CacheManager {
771
912
  }
772
913
  }
773
914
  /**
774
- * Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
915
+ * Prepend msal.<client-id> to each key
775
916
  * @param key
776
917
  * @param addInstanceId
777
918
  */
778
919
  generateCacheKey(key) {
779
- const generatedKey = this.validateAndParseJson(key);
780
- if (!generatedKey) {
781
- if (StringUtils.startsWith(key, Constants.CACHE_PREFIX)) {
782
- return key;
783
- }
784
- return `${Constants.CACHE_PREFIX}.${this.clientId}.${key}`;
920
+ if (StringUtils.startsWith(key, PREFIX)) {
921
+ return key;
785
922
  }
786
- return JSON.stringify(key);
923
+ return `${PREFIX}.${this.clientId}.${key}`;
924
+ }
925
+ /**
926
+ * Cache Key: msal.<schema_version>-<home_account_id>-<environment>-<credential_type>-<client_id or familyId>-<realm>-<scopes>-<claims hash>-<scheme>
927
+ * IdToken Example: uid.utid-login.microsoftonline.com-idtoken-app_client_id-contoso.com
928
+ * AccessToken Example: uid.utid-login.microsoftonline.com-accesstoken-app_client_id-contoso.com-scope1 scope2--pop
929
+ * RefreshToken Example: uid.utid-login.microsoftonline.com-refreshtoken-1-contoso.com
930
+ * @param credentialEntity
931
+ * @returns
932
+ */
933
+ generateCredentialKey(credential) {
934
+ const familyId = (credential.credentialType === CredentialType.REFRESH_TOKEN &&
935
+ credential.familyId) ||
936
+ credential.clientId;
937
+ const scheme = credential.tokenType &&
938
+ credential.tokenType.toLowerCase() !==
939
+ AuthenticationScheme.BEARER.toLowerCase()
940
+ ? credential.tokenType.toLowerCase()
941
+ : "";
942
+ const credentialKey = [
943
+ `${PREFIX}.${CREDENTIAL_SCHEMA_VERSION}`,
944
+ credential.homeAccountId,
945
+ credential.environment,
946
+ credential.credentialType,
947
+ familyId,
948
+ credential.realm || "",
949
+ credential.target || "",
950
+ credential.requestedClaimsHash || "",
951
+ scheme,
952
+ ];
953
+ return credentialKey.join(CACHE_KEY_SEPARATOR).toLowerCase();
954
+ }
955
+ /**
956
+ * Cache Key: msal.<schema_version>.<home_account_id>.<environment>.<tenant_id>
957
+ * @param account
958
+ * @returns
959
+ */
960
+ generateAccountKey(account) {
961
+ const homeTenantId = account.homeAccountId.split(".")[1];
962
+ const accountKey = [
963
+ `${PREFIX}.${ACCOUNT_SCHEMA_VERSION}`,
964
+ account.homeAccountId,
965
+ account.environment,
966
+ homeTenantId || account.tenantId || "",
967
+ ];
968
+ return accountKey.join(CACHE_KEY_SEPARATOR).toLowerCase();
787
969
  }
788
970
  /**
789
971
  * Reset all temporary cache items
@@ -860,7 +1042,7 @@ class BrowserCacheManager extends CacheManager {
860
1042
  }
861
1043
  }
862
1044
  getInteractionInProgress() {
863
- const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;
1045
+ const key = `${PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;
864
1046
  const value = this.getTemporaryCache(key, false);
865
1047
  try {
866
1048
  return value ? JSON.parse(value) : null;
@@ -876,7 +1058,7 @@ class BrowserCacheManager extends CacheManager {
876
1058
  }
877
1059
  setInteractionInProgress(inProgress, type = INTERACTION_TYPE.SIGNIN) {
878
1060
  // Ensure we don't overwrite interaction in progress for a different clientId
879
- const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;
1061
+ const key = `${PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;
880
1062
  if (inProgress) {
881
1063
  if (this.getInteractionInProgress()) {
882
1064
  throw createBrowserAuthError(interactionInProgress);
@@ -976,6 +1158,7 @@ function getStorageImplementation(clientId, cacheLocation, logger, performanceCl
976
1158
  const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger, performanceClient, eventHandler) => {
977
1159
  const cacheOptions = {
978
1160
  cacheLocation: BrowserCacheLocation.MemoryStorage,
1161
+ cacheRetentionDays: 5,
979
1162
  temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
980
1163
  storeAuthStateInCookie: false,
981
1164
  secureCookies: false,