@azure/msal-browser 5.13.0 → 5.15.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 (357) hide show
  1. package/dist/app/IPublicClientApplication.mjs +16 -16
  2. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  3. package/dist/app/PublicClientApplication.mjs +1 -1
  4. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  5. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +11 -11
  6. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +21 -21
  8. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
  9. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +3 -3
  10. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  11. package/dist/cache/AccountManager.mjs +1 -1
  12. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  13. package/dist/cache/BrowserCacheManager.mjs +18 -18
  14. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  15. package/dist/cache/CacheHelpers.mjs +1 -1
  16. package/dist/cache/CacheKeys.mjs +1 -1
  17. package/dist/cache/CookieStorage.mjs +4 -4
  18. package/dist/cache/CookieStorage.mjs.map +1 -1
  19. package/dist/cache/DatabaseStorage.mjs +7 -7
  20. package/dist/cache/DatabaseStorage.mjs.map +1 -1
  21. package/dist/cache/EncryptedData.mjs +1 -1
  22. package/dist/cache/LocalStorage.mjs +6 -6
  23. package/dist/cache/LocalStorage.mjs.map +1 -1
  24. package/dist/cache/MemoryStorage.mjs +1 -1
  25. package/dist/cache/SessionStorage.mjs +2 -2
  26. package/dist/cache/SessionStorage.mjs.map +1 -1
  27. package/dist/cache/TokenCache.mjs +10 -8
  28. package/dist/cache/TokenCache.mjs.map +1 -1
  29. package/dist/config/Configuration.mjs +5 -4
  30. package/dist/config/Configuration.mjs.map +1 -1
  31. package/dist/controllers/NestedAppAuthController.mjs +16 -17
  32. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  33. package/dist/controllers/StandardController.mjs +24 -24
  34. package/dist/controllers/StandardController.mjs.map +1 -1
  35. package/dist/crypto/BrowserCrypto.mjs +7 -7
  36. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  37. package/dist/crypto/CryptoOps.mjs +4 -4
  38. package/dist/crypto/CryptoOps.mjs.map +1 -1
  39. package/dist/crypto/PkceGenerator.mjs +3 -3
  40. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  41. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  42. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  43. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  44. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +13 -8
  45. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  46. package/dist/custom_auth/core/CustomAuthAuthority.mjs +2 -2
  47. package/dist/custom_auth/core/CustomAuthAuthority.mjs.map +1 -1
  48. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  54. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  56. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  57. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +4 -4
  58. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +1 -1
  59. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  60. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  61. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  62. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  63. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  64. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +4 -4
  65. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +1 -1
  66. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  67. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  68. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  69. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  70. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  71. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  72. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  73. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  74. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  75. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  76. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  77. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  78. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  79. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  80. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  81. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  82. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  83. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  84. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  85. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  86. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +2 -2
  87. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs.map +1 -1
  88. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  89. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +2 -2
  90. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs.map +1 -1
  91. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  92. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  93. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  94. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  95. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  96. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  97. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  98. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  99. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +4 -4
  100. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs.map +1 -1
  101. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  102. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  103. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  104. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +3 -3
  105. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs.map +1 -1
  106. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  107. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +2 -2
  108. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs.map +1 -1
  109. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  110. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  111. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  112. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  113. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  114. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  115. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  116. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +2 -2
  117. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
  118. package/dist/custom_auth/index.mjs +1 -1
  119. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  120. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  121. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  122. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  123. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  124. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  125. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +3 -3
  126. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs.map +1 -1
  127. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  128. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  129. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +2 -2
  130. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs.map +1 -1
  131. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  132. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +3 -3
  133. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs.map +1 -1
  134. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  135. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  136. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  137. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  138. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  139. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  140. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +2 -2
  141. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs.map +1 -1
  142. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  143. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +2 -2
  144. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs.map +1 -1
  145. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  146. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +2 -2
  147. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs.map +1 -1
  148. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  149. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +2 -2
  150. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs.map +1 -1
  151. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  152. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  153. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  154. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  155. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  156. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  157. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  158. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +2 -2
  159. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs.map +1 -1
  160. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +3 -3
  161. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs.map +1 -1
  162. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  163. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  164. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +2 -2
  165. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs.map +1 -1
  166. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  167. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +5 -5
  168. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs.map +1 -1
  169. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  170. package/dist/encode/Base64Decode.mjs +2 -2
  171. package/dist/encode/Base64Decode.mjs.map +1 -1
  172. package/dist/encode/Base64Encode.mjs +1 -1
  173. package/dist/error/BrowserAuthError.mjs +5 -5
  174. package/dist/error/BrowserAuthError.mjs.map +1 -1
  175. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  176. package/dist/error/BrowserConfigurationAuthError.mjs +5 -5
  177. package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
  178. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  179. package/dist/error/NativeAuthError.mjs +20 -10
  180. package/dist/error/NativeAuthError.mjs.map +1 -1
  181. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  182. package/dist/error/NestedAppAuthError.mjs +9 -5
  183. package/dist/error/NestedAppAuthError.mjs.map +1 -1
  184. package/dist/event/EventHandler.mjs +7 -6
  185. package/dist/event/EventHandler.mjs.map +1 -1
  186. package/dist/event/EventMessage.mjs +1 -1
  187. package/dist/event/EventType.mjs +1 -1
  188. package/dist/index.mjs +1 -1
  189. package/dist/interaction_client/BaseInteractionClient.mjs +6 -7
  190. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  191. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  192. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +24 -20
  193. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  194. package/dist/interaction_client/PopupClient.mjs +14 -14
  195. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  196. package/dist/interaction_client/RedirectClient.mjs +17 -17
  197. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  198. package/dist/interaction_client/SilentAuthCodeClient.mjs +4 -4
  199. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  200. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  201. package/dist/interaction_client/SilentIframeClient.mjs +5 -5
  202. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  203. package/dist/interaction_client/SilentRefreshClient.mjs +3 -3
  204. package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
  205. package/dist/interaction_client/StandardInteractionClient.mjs +6 -6
  206. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  207. package/dist/interaction_handler/InteractionHandler.mjs +3 -3
  208. package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
  209. package/dist/interaction_handler/SilentHandler.mjs +2 -2
  210. package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
  211. package/dist/log-strings-mapping.json +1200 -1200
  212. package/dist/naa/BridgeError.mjs +1 -1
  213. package/dist/naa/BridgeProxy.mjs +1 -1
  214. package/dist/naa/BridgeStatusCode.mjs +1 -1
  215. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +18 -17
  216. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  217. package/dist/navigation/NavigationClient.mjs +2 -2
  218. package/dist/navigation/NavigationClient.mjs.map +1 -1
  219. package/dist/network/FetchClient.mjs +7 -7
  220. package/dist/network/FetchClient.mjs.map +1 -1
  221. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  222. package/dist/operatingcontext/NestedAppOperatingContext.mjs +3 -3
  223. package/dist/operatingcontext/NestedAppOperatingContext.mjs.map +1 -1
  224. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  225. package/dist/packageMetadata.mjs +2 -2
  226. package/dist/protocol/Authorize.mjs +8 -8
  227. package/dist/protocol/Authorize.mjs.map +1 -1
  228. package/dist/redirect_bridge/index.mjs +1 -1
  229. package/dist/request/RequestHelpers.mjs +5 -5
  230. package/dist/request/RequestHelpers.mjs.map +1 -1
  231. package/dist/response/ResponseHandler.mjs +11 -11
  232. package/dist/response/ResponseHandler.mjs.map +1 -1
  233. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  234. package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
  235. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  236. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  237. package/dist/utils/BrowserConstants.mjs +1 -1
  238. package/dist/utils/BrowserProtocolUtils.mjs +4 -4
  239. package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
  240. package/dist/utils/BrowserUtils.mjs +26 -20
  241. package/dist/utils/BrowserUtils.mjs.map +1 -1
  242. package/dist/utils/Helpers.mjs +1 -1
  243. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  244. package/lib/custom-auth-path/log-strings-mapping.json +2 -2
  245. package/lib/custom-auth-path/msal-custom-auth.cjs +969 -866
  246. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  247. package/lib/custom-auth-path/msal-custom-auth.js +860 -761
  248. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  249. package/lib/log-strings-mapping.json +2 -2
  250. package/lib/msal-browser.cjs +898 -796
  251. package/lib/msal-browser.cjs.map +1 -1
  252. package/lib/msal-browser.js +898 -796
  253. package/lib/msal-browser.js.map +1 -1
  254. package/lib/msal-browser.min.js +2 -2
  255. package/lib/redirect-bridge/msal-redirect-bridge.cjs +55 -51
  256. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  257. package/lib/redirect-bridge/msal-redirect-bridge.js +55 -51
  258. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  259. package/lib/redirect-bridge/msal-redirect-bridge.min.js +2 -2
  260. package/package.json +5 -6
  261. package/src/app/IPublicClientApplication.ts +30 -15
  262. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +2 -0
  263. package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +8 -2
  264. package/src/broker/nativeBroker/PlatformAuthProvider.ts +2 -1
  265. package/src/cache/BrowserCacheManager.ts +19 -7
  266. package/src/cache/CookieStorage.ts +13 -3
  267. package/src/cache/DatabaseStorage.ts +12 -6
  268. package/src/cache/LocalStorage.ts +8 -4
  269. package/src/cache/SessionStorage.ts +2 -1
  270. package/src/cache/TokenCache.ts +22 -7
  271. package/src/config/Configuration.ts +15 -4
  272. package/src/controllers/NestedAppAuthController.ts +19 -11
  273. package/src/controllers/StandardController.ts +20 -9
  274. package/src/crypto/BrowserCrypto.ts +10 -2
  275. package/src/crypto/CryptoOps.ts +4 -2
  276. package/src/crypto/PkceGenerator.ts +8 -2
  277. package/src/custom_auth/controller/CustomAuthStandardController.ts +2 -4
  278. package/src/custom_auth/core/CustomAuthAuthority.ts +4 -2
  279. package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +2 -1
  280. package/src/encode/Base64Decode.ts +2 -1
  281. package/src/error/BrowserAuthError.ts +9 -3
  282. package/src/error/BrowserConfigurationAuthError.ts +9 -3
  283. package/src/error/NativeAuthError.ts +44 -11
  284. package/src/error/NestedAppAuthError.ts +14 -4
  285. package/src/event/EventHandler.ts +2 -1
  286. package/src/interaction_client/BaseInteractionClient.ts +10 -6
  287. package/src/interaction_client/PlatformAuthInteractionClient.ts +49 -21
  288. package/src/interaction_client/PopupClient.ts +14 -8
  289. package/src/interaction_client/RedirectClient.ts +21 -10
  290. package/src/interaction_client/SilentAuthCodeClient.ts +5 -3
  291. package/src/interaction_client/SilentIframeClient.ts +5 -3
  292. package/src/interaction_client/SilentRefreshClient.ts +3 -2
  293. package/src/interaction_client/StandardInteractionClient.ts +8 -4
  294. package/src/interaction_handler/InteractionHandler.ts +4 -2
  295. package/src/interaction_handler/SilentHandler.ts +4 -1
  296. package/src/naa/mapping/NestedAppAuthAdapter.ts +43 -14
  297. package/src/navigation/NavigationClient.ts +1 -0
  298. package/src/network/FetchClient.ts +14 -6
  299. package/src/packageMetadata.ts +1 -1
  300. package/src/protocol/Authorize.ts +23 -7
  301. package/src/request/RequestHelpers.ts +6 -3
  302. package/src/response/ResponseHandler.ts +20 -7
  303. package/src/utils/BrowserProtocolUtils.ts +11 -3
  304. package/src/utils/BrowserUtils.ts +44 -17
  305. package/types/app/IPublicClientApplication.d.ts.map +1 -1
  306. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  307. package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
  308. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  309. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  310. package/types/cache/CookieStorage.d.ts +1 -1
  311. package/types/cache/CookieStorage.d.ts.map +1 -1
  312. package/types/cache/DatabaseStorage.d.ts.map +1 -1
  313. package/types/cache/LocalStorage.d.ts.map +1 -1
  314. package/types/cache/SessionStorage.d.ts.map +1 -1
  315. package/types/cache/TokenCache.d.ts.map +1 -1
  316. package/types/config/Configuration.d.ts +5 -1
  317. package/types/config/Configuration.d.ts.map +1 -1
  318. package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  319. package/types/controllers/StandardController.d.ts.map +1 -1
  320. package/types/crypto/BrowserCrypto.d.ts.map +1 -1
  321. package/types/crypto/CryptoOps.d.ts.map +1 -1
  322. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  323. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  324. package/types/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
  325. package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  326. package/types/encode/Base64Decode.d.ts.map +1 -1
  327. package/types/error/BrowserAuthError.d.ts +2 -2
  328. package/types/error/BrowserAuthError.d.ts.map +1 -1
  329. package/types/error/BrowserConfigurationAuthError.d.ts +2 -2
  330. package/types/error/BrowserConfigurationAuthError.d.ts.map +1 -1
  331. package/types/error/NativeAuthError.d.ts +2 -2
  332. package/types/error/NativeAuthError.d.ts.map +1 -1
  333. package/types/error/NestedAppAuthError.d.ts +2 -2
  334. package/types/error/NestedAppAuthError.d.ts.map +1 -1
  335. package/types/event/EventHandler.d.ts.map +1 -1
  336. package/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  337. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  338. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  339. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  340. package/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  341. package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  342. package/types/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  343. package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  344. package/types/interaction_handler/InteractionHandler.d.ts.map +1 -1
  345. package/types/interaction_handler/SilentHandler.d.ts.map +1 -1
  346. package/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  347. package/types/navigation/NavigationClient.d.ts.map +1 -1
  348. package/types/network/FetchClient.d.ts.map +1 -1
  349. package/types/packageMetadata.d.ts +1 -1
  350. package/types/protocol/Authorize.d.ts.map +1 -1
  351. package/types/request/RequestHelpers.d.ts.map +1 -1
  352. package/types/response/ResponseHandler.d.ts +1 -1
  353. package/types/response/ResponseHandler.d.ts.map +1 -1
  354. package/types/utils/BrowserProtocolUtils.d.ts +1 -1
  355. package/types/utils/BrowserProtocolUtils.d.ts.map +1 -1
  356. package/types/utils/BrowserUtils.d.ts +5 -3
  357. package/types/utils/BrowserUtils.d.ts.map +1 -1
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
12
12
  },
13
- "version": "5.13.0",
13
+ "version": "5.15.0",
14
14
  "description": "Microsoft Authentication Library for js",
15
15
  "keywords": [
16
16
  "implicit",
@@ -98,15 +98,14 @@
98
98
  "apiExtractor": "api-extractor run"
99
99
  },
100
100
  "devDependencies": {
101
- "@azure/storage-blob": "^12.2.1",
102
101
  "@babel/core": "^7.7.2",
103
102
  "@babel/plugin-proposal-class-properties": "^7.7.0",
104
103
  "@babel/plugin-proposal-object-rest-spread": "^7.6.2",
105
104
  "@babel/preset-env": "^7.7.1",
106
105
  "@babel/preset-typescript": "^7.7.2",
107
- "@microsoft/api-extractor": "^7.43.4",
106
+ "@microsoft/api-extractor": "^7.58.7",
108
107
  "@rollup/plugin-node-resolve": "^15.0.1",
109
- "@rollup/plugin-terser": "^0.4.0",
108
+ "@rollup/plugin-terser": "^1.0.0",
110
109
  "@rollup/plugin-typescript": "^11.0.0",
111
110
  "@types/jest": "^29.5.0",
112
111
  "@types/node": "^20.3.1",
@@ -124,12 +123,12 @@
124
123
  "rollup-msal": "file:../../shared-configs/rollup-msal",
125
124
  "shx": "^0.3.2",
126
125
  "ssri": "^8.0.1",
127
- "ts-jest": "^29.2.5",
126
+ "ts-jest": "^29.4.11",
128
127
  "ts-jest-resolver": "^2.0.1",
129
128
  "tslib": "^1.10.0",
130
129
  "typescript": "^4.9.5"
131
130
  },
132
131
  "dependencies": {
133
- "@azure/msal-common": "16.8.0"
132
+ "@azure/msal-common": "16.10.0"
134
133
  }
135
134
  }
@@ -81,35 +81,40 @@ export const stubbedPublicClientApplication: IPublicClientApplication = {
81
81
  initialize: () => {
82
82
  return Promise.reject(
83
83
  createBrowserConfigurationAuthError(
84
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
84
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
85
+ ""
85
86
  )
86
87
  );
87
88
  },
88
89
  acquireTokenPopup: () => {
89
90
  return Promise.reject(
90
91
  createBrowserConfigurationAuthError(
91
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
92
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
93
+ ""
92
94
  )
93
95
  );
94
96
  },
95
97
  acquireTokenRedirect: () => {
96
98
  return Promise.reject(
97
99
  createBrowserConfigurationAuthError(
98
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
100
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
101
+ ""
99
102
  )
100
103
  );
101
104
  },
102
105
  acquireTokenSilent: () => {
103
106
  return Promise.reject(
104
107
  createBrowserConfigurationAuthError(
105
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
108
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
109
+ ""
106
110
  )
107
111
  );
108
112
  },
109
113
  acquireTokenByCode: () => {
110
114
  return Promise.reject(
111
115
  createBrowserConfigurationAuthError(
112
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
116
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
117
+ ""
113
118
  )
114
119
  );
115
120
  },
@@ -122,42 +127,48 @@ export const stubbedPublicClientApplication: IPublicClientApplication = {
122
127
  handleRedirectPromise: () => {
123
128
  return Promise.reject(
124
129
  createBrowserConfigurationAuthError(
125
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
130
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
131
+ ""
126
132
  )
127
133
  );
128
134
  },
129
135
  loginPopup: () => {
130
136
  return Promise.reject(
131
137
  createBrowserConfigurationAuthError(
132
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
138
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
139
+ ""
133
140
  )
134
141
  );
135
142
  },
136
143
  loginRedirect: () => {
137
144
  return Promise.reject(
138
145
  createBrowserConfigurationAuthError(
139
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
146
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
147
+ ""
140
148
  )
141
149
  );
142
150
  },
143
151
  logoutRedirect: () => {
144
152
  return Promise.reject(
145
153
  createBrowserConfigurationAuthError(
146
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
154
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
155
+ ""
147
156
  )
148
157
  );
149
158
  },
150
159
  logoutPopup: () => {
151
160
  return Promise.reject(
152
161
  createBrowserConfigurationAuthError(
153
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
162
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
163
+ ""
154
164
  )
155
165
  );
156
166
  },
157
167
  ssoSilent: () => {
158
168
  return Promise.reject(
159
169
  createBrowserConfigurationAuthError(
160
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
170
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
171
+ ""
161
172
  )
162
173
  );
163
174
  },
@@ -175,7 +186,8 @@ export const stubbedPublicClientApplication: IPublicClientApplication = {
175
186
  },
176
187
  getLogger: () => {
177
188
  throw createBrowserConfigurationAuthError(
178
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
189
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
190
+ ""
179
191
  );
180
192
  },
181
193
  setLogger: () => {
@@ -195,20 +207,23 @@ export const stubbedPublicClientApplication: IPublicClientApplication = {
195
207
  },
196
208
  getConfiguration: () => {
197
209
  throw createBrowserConfigurationAuthError(
198
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
210
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
211
+ ""
199
212
  );
200
213
  },
201
214
  hydrateCache: () => {
202
215
  return Promise.reject(
203
216
  createBrowserConfigurationAuthError(
204
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
217
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
218
+ ""
205
219
  )
206
220
  );
207
221
  },
208
222
  clearCache: () => {
209
223
  return Promise.reject(
210
224
  createBrowserConfigurationAuthError(
211
- BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
225
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled,
226
+ ""
212
227
  )
213
228
  );
214
229
  },
@@ -208,6 +208,7 @@ export class PlatformAuthDOMHandler implements IPlatformAuthHandler {
208
208
  );
209
209
  throw createNativeAuthError(
210
210
  errorResponse.error.code,
211
+ correlationId,
211
212
  errorResponse.error.description,
212
213
  {
213
214
  error: parseInt(errorResponse.error.errorCode),
@@ -221,6 +222,7 @@ export class PlatformAuthDOMHandler implements IPlatformAuthHandler {
221
222
  }
222
223
  throw createAuthError(
223
224
  AuthErrorCodes.unexpectedError,
225
+ correlationId,
224
226
  "Response missing expected properties."
225
227
  );
226
228
  }
@@ -211,7 +211,8 @@ export class PlatformAuthExtensionHandler implements IPlatformAuthHandler {
211
211
  });
212
212
  reject(
213
213
  createBrowserAuthError(
214
- BrowserAuthErrorCodes.nativeHandshakeTimeout
214
+ BrowserAuthErrorCodes.nativeHandshakeTimeout,
215
+ ""
215
216
  )
216
217
  );
217
218
  this.handshakeResolvers.delete(req.responseId);
@@ -280,7 +281,8 @@ export class PlatformAuthExtensionHandler implements IPlatformAuthHandler {
280
281
  });
281
282
  handshakeResolver.reject(
282
283
  createBrowserAuthError(
283
- BrowserAuthErrorCodes.nativeExtensionNotInstalled
284
+ BrowserAuthErrorCodes.nativeExtensionNotInstalled,
285
+ ""
284
286
  )
285
287
  );
286
288
  }
@@ -327,6 +329,7 @@ export class PlatformAuthExtensionHandler implements IPlatformAuthHandler {
327
329
  resolver.reject(
328
330
  createNativeAuthError(
329
331
  response.code,
332
+ correlationId,
330
333
  response.description,
331
334
  response.ext
332
335
  )
@@ -339,6 +342,7 @@ export class PlatformAuthExtensionHandler implements IPlatformAuthHandler {
339
342
  resolver.reject(
340
343
  createNativeAuthError(
341
344
  response.result["code"],
345
+ correlationId,
342
346
  response.result["description"],
343
347
  response.result["ext"]
344
348
  )
@@ -349,6 +353,7 @@ export class PlatformAuthExtensionHandler implements IPlatformAuthHandler {
349
353
  } else {
350
354
  throw createAuthError(
351
355
  AuthErrorCodes.unexpectedError,
356
+ correlationId,
352
357
  "Event does not contain result."
353
358
  );
354
359
  }
@@ -420,6 +425,7 @@ export class PlatformAuthExtensionHandler implements IPlatformAuthHandler {
420
425
  } else {
421
426
  throw createAuthError(
422
427
  AuthErrorCodes.unexpectedError,
428
+ "",
423
429
  "Response missing expected properties."
424
430
  );
425
431
  }
@@ -128,7 +128,8 @@ export function isPlatformAuthAllowed(
128
128
  config.experimental.allowPlatformBrokerWithDOM
129
129
  ) {
130
130
  throw createClientConfigurationError(
131
- ClientConfigurationErrorCodes.invalidPlatformBrokerConfiguration
131
+ ClientConfigurationErrorCodes.invalidPlatformBrokerConfiguration,
132
+ ""
132
133
  );
133
134
  }
134
135
 
@@ -446,7 +446,8 @@ export class BrowserCacheManager extends CacheManager {
446
446
  const idToken = JSON.parse(rawValue) as IdTokenEntity;
447
447
  const claims = AuthToken.extractTokenClaims(
448
448
  idToken.secret,
449
- base64Decode
449
+ base64Decode,
450
+ ""
450
451
  );
451
452
  if (claims) {
452
453
  kmsiMap[idToken.homeAccountId] = AuthToken.isKmsi(claims);
@@ -561,7 +562,8 @@ export class BrowserCacheManager extends CacheManager {
561
562
 
562
563
  const claims = AuthToken.extractTokenClaims(
563
564
  oldSchemaData.secret,
564
- base64Decode
565
+ base64Decode,
566
+ correlationId
565
567
  );
566
568
 
567
569
  const newIdTokenKey = this.generateCredentialKey(oldSchemaData);
@@ -576,7 +578,8 @@ export class BrowserCacheManager extends CacheManager {
576
578
  Object.keys(
577
579
  AuthToken.extractTokenClaims(
578
580
  currentIdToken.secret,
579
- base64Decode
581
+ base64Decode,
582
+ correlationId
580
583
  ) || {}
581
584
  ).includes("signin_state");
582
585
 
@@ -603,6 +606,7 @@ export class BrowserCacheManager extends CacheManager {
603
606
  account.homeAccountId,
604
607
  account.localAccountId,
605
608
  tenantId,
609
+ account.nativeAccountId,
606
610
  claims
607
611
  );
608
612
  tenantProfiles.push(newTenantProfile);
@@ -2236,7 +2240,8 @@ export class BrowserCacheManager extends CacheManager {
2236
2240
  );
2237
2241
  if (!encodedTokenRequest) {
2238
2242
  throw createBrowserAuthError(
2239
- BrowserAuthErrorCodes.noTokenRequestCacheError
2243
+ BrowserAuthErrorCodes.noTokenRequestCacheError,
2244
+ ""
2240
2245
  );
2241
2246
  }
2242
2247
  const encodedVerifier = this.getTemporaryCache(
@@ -2262,7 +2267,8 @@ export class BrowserCacheManager extends CacheManager {
2262
2267
  correlationId
2263
2268
  );
2264
2269
  throw createBrowserAuthError(
2265
- BrowserAuthErrorCodes.unableToParseTokenRequestCacheError
2270
+ BrowserAuthErrorCodes.unableToParseTokenRequestCacheError,
2271
+ ""
2266
2272
  );
2267
2273
  }
2268
2274
 
@@ -2363,7 +2369,8 @@ export class BrowserCacheManager extends CacheManager {
2363
2369
  this.removeTemporaryItem(key);
2364
2370
  } else {
2365
2371
  throw createBrowserAuthError(
2366
- BrowserAuthErrorCodes.interactionInProgress
2372
+ BrowserAuthErrorCodes.interactionInProgress,
2373
+ ""
2367
2374
  );
2368
2375
  }
2369
2376
  }
@@ -2425,6 +2432,7 @@ export class BrowserCacheManager extends CacheManager {
2425
2432
  ? TimeUtils.toSecondsFromDate(result.extExpiresOn)
2426
2433
  : 0,
2427
2434
  base64Decode,
2435
+ request.correlationId || "",
2428
2436
  undefined, // refreshOn
2429
2437
  result.tokenType as Constants.AuthenticationScheme,
2430
2438
  undefined, // userAssertionHash
@@ -2443,7 +2451,11 @@ export class BrowserCacheManager extends CacheManager {
2443
2451
  cacheRecord,
2444
2452
  result.correlationId,
2445
2453
  AuthToken.isKmsi(
2446
- AuthToken.extractTokenClaims(result.idToken, base64Decode)
2454
+ AuthToken.extractTokenClaims(
2455
+ result.idToken,
2456
+ base64Decode,
2457
+ result.correlationId
2458
+ )
2447
2459
  ),
2448
2460
  ApiId.hydrateCache
2449
2461
  );
@@ -46,7 +46,10 @@ export class CookieStorage implements IWindowStorage<string> {
46
46
  }
47
47
 
48
48
  getUserData(): string | null {
49
- throw createClientAuthError(ClientAuthErrorCodes.methodNotImplemented);
49
+ throw createClientAuthError(
50
+ ClientAuthErrorCodes.methodNotImplemented,
51
+ ""
52
+ );
50
53
  }
51
54
 
52
55
  setItem(
@@ -73,9 +76,16 @@ export class CookieStorage implements IWindowStorage<string> {
73
76
  document.cookie = cookieStr;
74
77
  }
75
78
 
76
- async setUserData(): Promise<void> {
79
+ async setUserData(
80
+ _key: string,
81
+ _value: string,
82
+ correlationId: string
83
+ ): Promise<void> {
77
84
  return Promise.reject(
78
- createClientAuthError(ClientAuthErrorCodes.methodNotImplemented)
85
+ createClientAuthError(
86
+ ClientAuthErrorCodes.methodNotImplemented,
87
+ correlationId
88
+ )
79
89
  );
80
90
  }
81
91
 
@@ -65,7 +65,8 @@ export class DatabaseStorage<T> implements IAsyncStorage<T> {
65
65
  openDB.addEventListener("error", () =>
66
66
  reject(
67
67
  createBrowserAuthError(
68
- BrowserAuthErrorCodes.databaseUnavailable
68
+ BrowserAuthErrorCodes.databaseUnavailable,
69
+ ""
69
70
  )
70
71
  )
71
72
  );
@@ -104,7 +105,8 @@ export class DatabaseStorage<T> implements IAsyncStorage<T> {
104
105
  if (!this.db) {
105
106
  return reject(
106
107
  createBrowserAuthError(
107
- BrowserAuthErrorCodes.databaseNotOpen
108
+ BrowserAuthErrorCodes.databaseNotOpen,
109
+ ""
108
110
  )
109
111
  );
110
112
  }
@@ -140,7 +142,8 @@ export class DatabaseStorage<T> implements IAsyncStorage<T> {
140
142
  if (!this.db) {
141
143
  return reject(
142
144
  createBrowserAuthError(
143
- BrowserAuthErrorCodes.databaseNotOpen
145
+ BrowserAuthErrorCodes.databaseNotOpen,
146
+ ""
144
147
  )
145
148
  );
146
149
  }
@@ -175,7 +178,8 @@ export class DatabaseStorage<T> implements IAsyncStorage<T> {
175
178
  if (!this.db) {
176
179
  return reject(
177
180
  createBrowserAuthError(
178
- BrowserAuthErrorCodes.databaseNotOpen
181
+ BrowserAuthErrorCodes.databaseNotOpen,
182
+ ""
179
183
  )
180
184
  );
181
185
  }
@@ -208,7 +212,8 @@ export class DatabaseStorage<T> implements IAsyncStorage<T> {
208
212
  if (!this.db) {
209
213
  return reject(
210
214
  createBrowserAuthError(
211
- BrowserAuthErrorCodes.databaseNotOpen
215
+ BrowserAuthErrorCodes.databaseNotOpen,
216
+ ""
212
217
  )
213
218
  );
214
219
  }
@@ -244,7 +249,8 @@ export class DatabaseStorage<T> implements IAsyncStorage<T> {
244
249
  if (!this.db) {
245
250
  return reject(
246
251
  createBrowserAuthError(
247
- BrowserAuthErrorCodes.databaseNotOpen
252
+ BrowserAuthErrorCodes.databaseNotOpen,
253
+ ""
248
254
  )
249
255
  );
250
256
  }
@@ -60,7 +60,8 @@ export class LocalStorage implements IWindowStorage<string> {
60
60
  ) {
61
61
  if (!window.localStorage) {
62
62
  throw createBrowserConfigurationAuthError(
63
- BrowserConfigurationAuthErrorCodes.storageNotSupported
63
+ BrowserConfigurationAuthErrorCodes.storageNotSupported,
64
+ ""
64
65
  );
65
66
  }
66
67
  this.memoryStorage = new MemoryStorage<string>();
@@ -164,7 +165,8 @@ export class LocalStorage implements IWindowStorage<string> {
164
165
  getUserData(key: string): string | null {
165
166
  if (!this.initialized) {
166
167
  throw createBrowserAuthError(
167
- BrowserAuthErrorCodes.uninitializedPublicClientApplication
168
+ BrowserAuthErrorCodes.uninitializedPublicClientApplication,
169
+ ""
168
170
  );
169
171
  }
170
172
  return this.memoryStorage.getItem(key);
@@ -177,7 +179,8 @@ export class LocalStorage implements IWindowStorage<string> {
177
179
  ): Promise<object | null> {
178
180
  if (!this.initialized || !this.encryptionCookie) {
179
181
  throw createBrowserAuthError(
180
- BrowserAuthErrorCodes.uninitializedPublicClientApplication
182
+ BrowserAuthErrorCodes.uninitializedPublicClientApplication,
183
+ ""
181
184
  );
182
185
  }
183
186
 
@@ -234,7 +237,8 @@ export class LocalStorage implements IWindowStorage<string> {
234
237
  ): Promise<void> {
235
238
  if (!this.initialized || !this.encryptionCookie) {
236
239
  throw createBrowserAuthError(
237
- BrowserAuthErrorCodes.uninitializedPublicClientApplication
240
+ BrowserAuthErrorCodes.uninitializedPublicClientApplication,
241
+ ""
238
242
  );
239
243
  }
240
244
 
@@ -13,7 +13,8 @@ export class SessionStorage implements IWindowStorage<string> {
13
13
  constructor() {
14
14
  if (!window.sessionStorage) {
15
15
  throw createBrowserConfigurationAuthError(
16
- BrowserConfigurationAuthErrorCodes.storageNotSupported
16
+ BrowserConfigurationAuthErrorCodes.storageNotSupported,
17
+ ""
17
18
  );
18
19
  }
19
20
  }
@@ -43,6 +43,7 @@ import * as BrowserRootPerformanceEvents from "../telemetry/BrowserRootPerforman
43
43
  import { ApiId } from "../utils/BrowserConstants.js";
44
44
  import * as BrowserUtils from "../utils/BrowserUtils.js";
45
45
  import { BrowserCacheManager } from "./BrowserCacheManager.js";
46
+ import { name, version } from "../packageMetadata.js";
46
47
 
47
48
  export type LoadTokenOptions = {
48
49
  clientInfo?: string;
@@ -80,7 +81,11 @@ export async function loadExternalTokens(
80
81
 
81
82
  try {
82
83
  const idTokenClaims = response.id_token
83
- ? AuthToken.extractTokenClaims(response.id_token, base64Decode)
84
+ ? AuthToken.extractTokenClaims(
85
+ response.id_token,
86
+ base64Decode,
87
+ correlationId
88
+ )
84
89
  : undefined;
85
90
  const kmsi = AuthToken.isKmsi(idTokenClaims || {});
86
91
 
@@ -91,7 +96,11 @@ export async function loadExternalTokens(
91
96
  authorityMetadata: browserConfig.auth.authorityMetadata,
92
97
  };
93
98
 
94
- const logger = new Logger(browserConfig.system.loggerOptions || {});
99
+ const logger = new Logger(
100
+ browserConfig.system.loggerOptions || {},
101
+ name,
102
+ version
103
+ );
95
104
  const cryptoOps = new CryptoOps(logger, browserConfig.telemetry.client);
96
105
  const storage = new BrowserCacheManager(
97
106
  browserConfig.auth.clientId,
@@ -102,6 +111,7 @@ export async function loadExternalTokens(
102
111
  new EventHandler(logger),
103
112
  buildStaticAuthorityOptions(browserConfig.auth)
104
113
  );
114
+ await storage.initialize(correlationId);
105
115
 
106
116
  const authorityString =
107
117
  request.authority || browserConfig.auth.authority;
@@ -254,7 +264,10 @@ async function loadAccount(
254
264
  "TokenCache - if an account is not provided on the request, clientInfo or idToken must be provided instead.",
255
265
  correlationId
256
266
  );
257
- throw createBrowserAuthError(BrowserAuthErrorCodes.unableToLoadToken);
267
+ throw createBrowserAuthError(
268
+ BrowserAuthErrorCodes.unableToLoadToken,
269
+ ""
270
+ );
258
271
  }
259
272
 
260
273
  const homeAccountId = AccountEntityUtils.generateHomeAccountId(
@@ -378,8 +391,8 @@ async function loadAccessToken(
378
391
  logger.verbose("TokenCache - loading access token", correlationId);
379
392
 
380
393
  const scopes = response.scope
381
- ? ScopeSet.fromString(response.scope)
382
- : new ScopeSet(request.scopes);
394
+ ? ScopeSet.fromString(response.scope, correlationId)
395
+ : new ScopeSet(request.scopes, correlationId);
383
396
  const expiresOn =
384
397
  options.expiresOn || response.expires_in + TimeUtils.nowSeconds();
385
398
 
@@ -397,7 +410,8 @@ async function loadAccessToken(
397
410
  scopes.printScopes(),
398
411
  expiresOn,
399
412
  extendedExpiresOn,
400
- base64Decode
413
+ base64Decode,
414
+ correlationId
401
415
  );
402
416
 
403
417
  await storage.setAccessTokenCredential(
@@ -486,7 +500,8 @@ function generateAuthenticationResult(
486
500
  if (cacheRecord?.accessToken) {
487
501
  accessToken = cacheRecord.accessToken.secret;
488
502
  responseScopes = ScopeSet.fromString(
489
- cacheRecord.accessToken.target
503
+ cacheRecord.accessToken.target,
504
+ request.correlationId || ""
490
505
  ).asArray();
491
506
  // Access token expiresOn stored in seconds, converting to Date for AuthenticationResult
492
507
  expiresOn = TimeUtils.toDateFromSeconds(
@@ -26,6 +26,7 @@ import { BrowserCacheLocation } from "../utils/BrowserConstants.js";
26
26
  import { INavigationClient } from "../navigation/INavigationClient.js";
27
27
  import { NavigationClient } from "../navigation/NavigationClient.js";
28
28
  import { FetchClient } from "../network/FetchClient.js";
29
+ import { name, version } from "../packageMetadata.js";
29
30
 
30
31
  // Default timeout for popup windows and iframes in milliseconds
31
32
  export const DEFAULT_POPUP_TIMEOUT_MS = 60000;
@@ -174,7 +175,11 @@ export type BrowserSystemOptions = SystemOptions & {
174
175
  serverTelemetryEnabled?: boolean;
175
176
  };
176
177
 
177
- /** @internal */
178
+ /**
179
+ * Options for configuring experimental features. These features do not follow
180
+ * semver and may be changed or removed without a major version bump. Use with caution.
181
+ * @public
182
+ */
178
183
  export type BrowserExperimentalOptions = {
179
184
  /**
180
185
  * Enables iframe timeout telemetry experiment for silent iframe bridge monitoring.
@@ -347,11 +352,16 @@ export function buildConfiguration(
347
352
  userInputSystem?.protocolMode !== ProtocolMode.OIDC &&
348
353
  userInputAuth?.OIDCOptions
349
354
  ) {
350
- const logger = new Logger(providedSystemOptions.loggerOptions);
355
+ const logger = new Logger(
356
+ providedSystemOptions.loggerOptions,
357
+ name,
358
+ version
359
+ );
351
360
  logger.warning(
352
361
  JSON.stringify(
353
362
  createClientConfigurationError(
354
- ClientConfigurationErrorCodes.cannotSetOIDCOptions
363
+ ClientConfigurationErrorCodes.cannotSetOIDCOptions,
364
+ ""
355
365
  )
356
366
  ),
357
367
  ""
@@ -365,7 +375,8 @@ export function buildConfiguration(
365
375
  providedSystemOptions?.allowPlatformBroker
366
376
  ) {
367
377
  throw createClientConfigurationError(
368
- ClientConfigurationErrorCodes.cannotAllowPlatformBroker
378
+ ClientConfigurationErrorCodes.cannotAllowPlatformBroker,
379
+ ""
369
380
  );
370
381
  }
371
382