@azure/msal-browser 5.23.0 → 5.24.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 (285) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  4. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +111 -27
  5. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +178 -67
  7. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
  8. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +61 -22
  9. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  10. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
  11. package/dist/cache/AccountManager.mjs +1 -1
  12. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  13. package/dist/cache/BrowserCacheManager.mjs +1 -1
  14. package/dist/cache/CacheHelpers.mjs +1 -1
  15. package/dist/cache/CacheKeys.mjs +1 -1
  16. package/dist/cache/CookieStorage.mjs +1 -1
  17. package/dist/cache/DatabaseStorage.mjs +1 -1
  18. package/dist/cache/EncryptedData.mjs +1 -1
  19. package/dist/cache/LocalStorage.mjs +97 -29
  20. package/dist/cache/LocalStorage.mjs.map +1 -1
  21. package/dist/cache/MemoryStorage.mjs +1 -1
  22. package/dist/cache/SessionStorage.mjs +1 -1
  23. package/dist/cache/TokenCache.mjs +1 -1
  24. package/dist/config/Configuration.mjs +1 -1
  25. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  26. package/dist/controllers/StandardController.mjs +10 -10
  27. package/dist/controllers/StandardController.mjs.map +1 -1
  28. package/dist/crypto/BrowserCrypto.mjs +1 -1
  29. package/dist/crypto/CryptoOps.mjs +1 -1
  30. package/dist/crypto/PkceGenerator.mjs +1 -1
  31. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  32. package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
  33. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  34. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  35. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  36. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  37. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  38. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +1 -1
  54. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.mjs +1 -1
  56. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +1 -1
  57. package/dist/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.mjs +1 -1
  58. package/dist/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.mjs +1 -1
  59. package/dist/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.mjs +1 -1
  60. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +1 -1
  61. package/dist/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.mjs +1 -1
  62. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
  63. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +1 -1
  64. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +1 -1
  65. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -1
  66. package/dist/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.mjs +1 -1
  67. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +1 -1
  68. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  69. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  70. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  71. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  72. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  73. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  74. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  75. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  76. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  77. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  78. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  79. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  80. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  81. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  82. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  83. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  84. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  85. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  86. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  87. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  88. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  89. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  90. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +1 -1
  91. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +1 -1
  92. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +1 -1
  93. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  94. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  95. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  96. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  97. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  98. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  99. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  100. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  101. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  102. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -1
  103. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +1 -1
  104. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +1 -1
  105. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  106. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
  107. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +1 -1
  108. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  109. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
  110. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -1
  111. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  112. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  113. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +1 -1
  114. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  115. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  116. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  117. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  118. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  119. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  120. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  121. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  122. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  123. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  124. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  125. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  126. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  127. package/dist/custom_auth/index.mjs +1 -1
  128. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  129. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  130. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  131. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  132. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  133. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  134. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  135. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  136. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  137. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  138. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  139. package/dist/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.mjs +1 -1
  140. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +1 -1
  141. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  142. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  143. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  144. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  145. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  146. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  147. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  148. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  149. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  150. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  151. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  152. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  153. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  154. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.mjs +1 -1
  155. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.mjs +1 -1
  156. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.mjs +1 -1
  157. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +1 -1
  158. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +1 -1
  159. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  160. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  161. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  162. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  163. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  164. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  165. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  166. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  167. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  168. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  169. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  170. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  171. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  172. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  173. package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.mjs +1 -1
  174. package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.mjs +1 -1
  175. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +1 -1
  176. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +1 -1
  177. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +1 -1
  178. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +1 -1
  179. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  180. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  181. package/dist/encode/Base64Decode.mjs +1 -1
  182. package/dist/encode/Base64Encode.mjs +1 -1
  183. package/dist/error/BrowserAuthError.mjs +1 -1
  184. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  185. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  186. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  187. package/dist/error/NativeAuthError.mjs +1 -1
  188. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  189. package/dist/error/NestedAppAuthError.mjs +1 -1
  190. package/dist/event/EventHandler.mjs +1 -1
  191. package/dist/event/EventMessage.mjs +1 -1
  192. package/dist/event/EventType.mjs +1 -1
  193. package/dist/index.mjs +1 -1
  194. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  195. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  196. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +14 -13
  197. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  198. package/dist/interaction_client/PopupClient.mjs +1 -1
  199. package/dist/interaction_client/RedirectClient.mjs +1 -1
  200. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  201. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  202. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  203. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  204. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  205. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  206. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  207. package/dist/log-strings-mapping.json +1348 -1336
  208. package/dist/naa/BridgeError.mjs +1 -1
  209. package/dist/naa/BridgeProxy.mjs +1 -1
  210. package/dist/naa/BridgeStatusCode.mjs +1 -1
  211. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  212. package/dist/navigation/NavigationClient.mjs +1 -1
  213. package/dist/network/FetchClient.mjs +1 -1
  214. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  215. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  216. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  217. package/dist/packageMetadata.mjs +2 -2
  218. package/dist/popup_relay/constants.mjs +1 -1
  219. package/dist/popup_relay/index.mjs +1 -1
  220. package/dist/popup_relay/relayClient.mjs +1 -1
  221. package/dist/protocol/Authorize.mjs +1 -1
  222. package/dist/redirect_bridge/index.mjs +1 -1
  223. package/dist/request/RequestHelpers.mjs +1 -1
  224. package/dist/response/ResponseHandler.mjs +1 -1
  225. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  226. package/dist/telemetry/BrowserPerformanceEvents.mjs +16 -2
  227. package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
  228. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  229. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  230. package/dist/utils/BrowserConstants.mjs +1 -1
  231. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  232. package/dist/utils/BrowserUtils.mjs +1 -1
  233. package/dist/utils/Helpers.mjs +1 -1
  234. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  235. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  236. package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
  237. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  238. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  239. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  240. package/dist/webBrokerBridge/index.mjs +1 -1
  241. package/lib/custom-auth-path/log-strings-mapping.json +23 -11
  242. package/lib/custom-auth-path/msal-custom-auth.cjs +540 -225
  243. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  244. package/lib/custom-auth-path/msal-custom-auth.js +540 -225
  245. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  246. package/lib/log-strings-mapping.json +23 -11
  247. package/lib/msal-browser.cjs +542 -227
  248. package/lib/msal-browser.cjs.map +1 -1
  249. package/lib/msal-browser.js +542 -227
  250. package/lib/msal-browser.js.map +1 -1
  251. package/lib/msal-browser.min.js +2 -2
  252. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  253. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  254. package/lib/popup-relay/msal-popup-relay.js +2 -2
  255. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  256. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  257. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  258. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  259. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  260. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  261. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  262. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
  263. package/package.json +3 -3
  264. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +177 -43
  265. package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +261 -110
  266. package/src/broker/nativeBroker/PlatformAuthProvider.ts +92 -37
  267. package/src/cache/LocalStorage.ts +135 -28
  268. package/src/controllers/StandardController.ts +17 -23
  269. package/src/interaction_client/PlatformAuthInteractionClient.ts +56 -15
  270. package/src/packageMetadata.ts +1 -1
  271. package/src/telemetry/BrowserPerformanceEvents.ts +20 -0
  272. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +2 -1
  273. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  274. package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts +3 -1
  275. package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
  276. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts +1 -1
  277. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  278. package/types/cache/LocalStorage.d.ts +4 -5
  279. package/types/cache/LocalStorage.d.ts.map +1 -1
  280. package/types/controllers/StandardController.d.ts.map +1 -1
  281. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  282. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  283. package/types/packageMetadata.d.ts +1 -1
  284. package/types/telemetry/BrowserPerformanceEvents.d.ts +13 -0
  285. package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v5.23.0 2026-09-23 */
1
+ /*! @azure/msal-browser v5.24.0 2026-10-02 */
2
2
  'use strict';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -6,7 +6,7 @@
6
6
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
7
7
  })(this, (function (exports) { 'use strict';
8
8
 
9
- /*! @azure/msal-common v16.14.1 2026-09-23 */
9
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
10
10
  /*
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
12
12
  * Licensed under the MIT License.
@@ -60,7 +60,7 @@
60
60
  const CLI_DATA = "clidata";
61
61
  const ATTRIBUTE_TOKENS = "attribute_tokens";
62
62
 
63
- /*! @azure/msal-common v16.14.1 2026-09-23 */
63
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
64
64
  /*
65
65
  * Copyright (c) Microsoft Corporation. All rights reserved.
66
66
  * Licensed under the MIT License.
@@ -299,7 +299,7 @@
299
299
  // Token renewal offset default in seconds
300
300
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
301
301
 
302
- /*! @azure/msal-common v16.14.1 2026-09-23 */
302
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
303
303
  /*
304
304
  * Copyright (c) Microsoft Corporation. All rights reserved.
305
305
  * Licensed under the MIT License.
@@ -328,7 +328,7 @@
328
328
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
329
329
  }
330
330
 
331
- /*! @azure/msal-common v16.14.1 2026-09-23 */
331
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
332
332
 
333
333
  /*
334
334
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -351,7 +351,7 @@
351
351
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
352
352
  }
353
353
 
354
- /*! @azure/msal-common v16.14.1 2026-09-23 */
354
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
355
355
  /*
356
356
  * Copyright (c) Microsoft Corporation. All rights reserved.
357
357
  * Licensed under the MIT License.
@@ -437,7 +437,7 @@
437
437
  userCanceled: userCanceled
438
438
  });
439
439
 
440
- /*! @azure/msal-common v16.14.1 2026-09-23 */
440
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
441
441
 
442
442
  /*
443
443
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -475,7 +475,7 @@
475
475
  };
476
476
  }
477
477
 
478
- /*! @azure/msal-common v16.14.1 2026-09-23 */
478
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
479
479
 
480
480
  /*
481
481
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -541,7 +541,7 @@
541
541
  return matches[2];
542
542
  }
543
543
 
544
- /*! @azure/msal-common v16.14.1 2026-09-23 */
544
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
545
545
 
546
546
  /*
547
547
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -629,7 +629,7 @@
629
629
  return updatedAccountInfo;
630
630
  }
631
631
 
632
- /*! @azure/msal-common v16.14.1 2026-09-23 */
632
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
633
633
  /*
634
634
  * Copyright (c) Microsoft Corporation. All rights reserved.
635
635
  * Licensed under the MIT License.
@@ -643,7 +643,7 @@
643
643
  Ciam: 3,
644
644
  };
645
645
 
646
- /*! @azure/msal-common v16.14.1 2026-09-23 */
646
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
647
647
  /*
648
648
  * Copyright (c) Microsoft Corporation. All rights reserved.
649
649
  * Licensed under the MIT License.
@@ -665,7 +665,7 @@
665
665
  return null;
666
666
  }
667
667
 
668
- /*! @azure/msal-common v16.14.1 2026-09-23 */
668
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
669
669
  /*
670
670
  * Copyright (c) Microsoft Corporation. All rights reserved.
671
671
  * Licensed under the MIT License.
@@ -689,7 +689,7 @@
689
689
  EAR: "EAR",
690
690
  };
691
691
 
692
- /*! @azure/msal-common v16.14.1 2026-09-23 */
692
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
693
693
  /**
694
694
  * Returns the AccountInfo interface for this account.
695
695
  * @internal
@@ -878,7 +878,7 @@
878
878
  entity.hasOwnProperty("authorityType"));
879
879
  }
880
880
 
881
- /*! @azure/msal-common v16.14.1 2026-09-23 */
881
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
882
882
  /*
883
883
  * Copyright (c) Microsoft Corporation. All rights reserved.
884
884
  * Licensed under the MIT License.
@@ -895,7 +895,7 @@
895
895
  unexpectedError: unexpectedError
896
896
  });
897
897
 
898
- /*! @azure/msal-common v16.14.1 2026-09-23 */
898
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
899
899
 
900
900
  /*
901
901
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -915,7 +915,7 @@
915
915
  return new ClientConfigurationError(errorCode, correlationId);
916
916
  }
917
917
 
918
- /*! @azure/msal-common v16.14.1 2026-09-23 */
918
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
919
919
  /*
920
920
  * Copyright (c) Microsoft Corporation. All rights reserved.
921
921
  * Licensed under the MIT License.
@@ -985,7 +985,7 @@
985
985
  urlParseError: urlParseError
986
986
  });
987
987
 
988
- /*! @azure/msal-common v16.14.1 2026-09-23 */
988
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
989
989
 
990
990
  /*
991
991
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1043,7 +1043,7 @@
1043
1043
  }
1044
1044
  }
1045
1045
 
1046
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1046
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1047
1047
  /*
1048
1048
  * Copyright (c) Microsoft Corporation. All rights reserved.
1049
1049
  * Licensed under the MIT License.
@@ -1055,7 +1055,7 @@
1055
1055
  response.hasOwnProperty("jwks_uri"));
1056
1056
  }
1057
1057
 
1058
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1058
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1059
1059
  /*
1060
1060
  * Copyright (c) Microsoft Corporation. All rights reserved.
1061
1061
  * Licensed under the MIT License.
@@ -1135,7 +1135,7 @@
1135
1135
  }
1136
1136
  }
1137
1137
 
1138
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1138
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1139
1139
 
1140
1140
  /*
1141
1141
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1293,7 +1293,7 @@
1293
1293
  }
1294
1294
  }
1295
1295
 
1296
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1296
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1297
1297
 
1298
1298
  /*
1299
1299
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1447,7 +1447,7 @@
1447
1447
  return null;
1448
1448
  }
1449
1449
 
1450
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1450
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1451
1451
  /*
1452
1452
  * Copyright (c) Microsoft Corporation. All rights reserved.
1453
1453
  * Licensed under the MIT License.
@@ -1465,7 +1465,7 @@
1465
1465
  AzureUsGovernment: "https://login.microsoftonline.us",
1466
1466
  };
1467
1467
 
1468
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1468
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1469
1469
  /*
1470
1470
  * Copyright (c) Microsoft Corporation. All rights reserved.
1471
1471
  * Licensed under the MIT License.
@@ -1475,7 +1475,7 @@
1475
1475
  response.hasOwnProperty("metadata"));
1476
1476
  }
1477
1477
 
1478
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1478
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1479
1479
  /*
1480
1480
  * Copyright (c) Microsoft Corporation. All rights reserved.
1481
1481
  * Licensed under the MIT License.
@@ -1485,7 +1485,7 @@
1485
1485
  response.hasOwnProperty("error_description"));
1486
1486
  }
1487
1487
 
1488
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1488
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1489
1489
  /*
1490
1490
  * Copyright (c) Microsoft Corporation. All rights reserved.
1491
1491
  * Licensed under the MIT License.
@@ -1556,7 +1556,7 @@
1556
1556
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1557
1557
  const SetUserData = "setUserData";
1558
1558
 
1559
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1559
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1560
1560
  /*
1561
1561
  * Copyright (c) Microsoft Corporation. All rights reserved.
1562
1562
  * Licensed under the MIT License.
@@ -1649,7 +1649,7 @@
1649
1649
  };
1650
1650
  };
1651
1651
 
1652
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1652
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1653
1653
 
1654
1654
  /*
1655
1655
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1760,7 +1760,7 @@
1760
1760
  },
1761
1761
  };
1762
1762
 
1763
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1763
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1764
1764
  /*
1765
1765
  * Copyright (c) Microsoft Corporation. All rights reserved.
1766
1766
  * Licensed under the MIT License.
@@ -1825,7 +1825,7 @@
1825
1825
  return cachedAtSec > nowSeconds();
1826
1826
  }
1827
1827
 
1828
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1828
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1829
1829
 
1830
1830
  /*
1831
1831
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2112,7 +2112,7 @@
2112
2112
  return [...attributeTokens].sort().join(" ");
2113
2113
  }
2114
2114
 
2115
- /*! @azure/msal-common v16.14.1 2026-09-23 */
2115
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2116
2116
 
2117
2117
  /*
2118
2118
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3080,7 +3080,7 @@
3080
3080
  };
3081
3081
  }
3082
3082
 
3083
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3083
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3084
3084
 
3085
3085
  /*
3086
3086
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3114,7 +3114,7 @@
3114
3114
  }
3115
3115
  }
3116
3116
 
3117
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3117
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3118
3118
 
3119
3119
  /*
3120
3120
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3310,7 +3310,7 @@
3310
3310
  }
3311
3311
  }
3312
3312
 
3313
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3313
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3314
3314
 
3315
3315
  /*
3316
3316
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3796,7 +3796,7 @@
3796
3796
  }
3797
3797
  }
3798
3798
 
3799
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3799
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3800
3800
 
3801
3801
  /*
3802
3802
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3918,7 +3918,7 @@
3918
3918
  }
3919
3919
  }
3920
3920
 
3921
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3921
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3922
3922
 
3923
3923
  /*
3924
3924
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3966,7 +3966,7 @@
3966
3966
  },
3967
3967
  };
3968
3968
 
3969
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3969
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3970
3970
 
3971
3971
  /*
3972
3972
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3989,7 +3989,7 @@
3989
3989
  },
3990
3990
  };
3991
3991
 
3992
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3992
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3993
3993
  /*
3994
3994
  * Copyright (c) Microsoft Corporation. All rights reserved.
3995
3995
  * Licensed under the MIT License.
@@ -4278,12 +4278,12 @@
4278
4278
  }
4279
4279
  }
4280
4280
 
4281
- /*! @azure/msal-common v16.14.1 2026-09-23 */
4281
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4282
4282
  /* eslint-disable header/header */
4283
4283
  const name$1 = "@azure/msal-common";
4284
- const version$1 = "16.14.1";
4284
+ const version$1 = "16.14.2";
4285
4285
 
4286
- /*! @azure/msal-common v16.14.1 2026-09-23 */
4286
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4287
4287
  /*
4288
4288
  * Copyright (c) Microsoft Corporation. All rights reserved.
4289
4289
  * Licensed under the MIT License.
@@ -4291,7 +4291,7 @@
4291
4291
  const cacheQuotaExceeded = "cache_quota_exceeded";
4292
4292
  const cacheErrorUnknown = "cache_error_unknown";
4293
4293
 
4294
- /*! @azure/msal-common v16.14.1 2026-09-23 */
4294
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4295
4295
 
4296
4296
  /*
4297
4297
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4329,7 +4329,7 @@
4329
4329
  }
4330
4330
  }
4331
4331
 
4332
- /*! @azure/msal-common v16.14.1 2026-09-23 */
4332
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4333
4333
 
4334
4334
  /*
4335
4335
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5517,7 +5517,7 @@
5517
5517
  }
5518
5518
  }
5519
5519
 
5520
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5520
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5521
5521
  /*
5522
5522
  * Copyright (c) Microsoft Corporation. All rights reserved.
5523
5523
  * Licensed under the MIT License.
@@ -5582,7 +5582,7 @@
5582
5582
  "fetchRetryCount",
5583
5583
  ]);
5584
5584
 
5585
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5585
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5586
5586
 
5587
5587
  /*
5588
5588
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5640,7 +5640,7 @@
5640
5640
  }
5641
5641
  }
5642
5642
 
5643
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5643
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5644
5644
 
5645
5645
  /*
5646
5646
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5738,7 +5738,7 @@
5738
5738
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5739
5739
  }
5740
5740
 
5741
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5741
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5742
5742
  /*
5743
5743
  * Copyright (c) Microsoft Corporation. All rights reserved.
5744
5744
  * Licensed under the MIT License.
@@ -5765,7 +5765,7 @@
5765
5765
  }
5766
5766
  }
5767
5767
 
5768
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5768
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5769
5769
 
5770
5770
  /*
5771
5771
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5786,7 +5786,7 @@
5786
5786
  return new JoseHeaderError(code, correlationId);
5787
5787
  }
5788
5788
 
5789
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5789
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5790
5790
  /*
5791
5791
  * Copyright (c) Microsoft Corporation. All rights reserved.
5792
5792
  * Licensed under the MIT License.
@@ -5811,7 +5811,7 @@
5811
5811
  return Object.getPrototypeOf(value) === proto;
5812
5812
  }
5813
5813
 
5814
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5814
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5815
5815
  /*
5816
5816
  * Copyright (c) Microsoft Corporation. All rights reserved.
5817
5817
  * Licensed under the MIT License.
@@ -5821,7 +5821,7 @@
5821
5821
  const missingJwkError = "missing_jwk_error";
5822
5822
  const invalidJwkError = "invalid_jwk_error";
5823
5823
 
5824
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5824
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5825
5825
 
5826
5826
  /*
5827
5827
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5887,7 +5887,7 @@
5887
5887
  }
5888
5888
  }
5889
5889
 
5890
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5890
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5891
5891
 
5892
5892
  /*
5893
5893
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5988,7 +5988,7 @@
5988
5988
  }
5989
5989
  }
5990
5990
 
5991
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5991
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5992
5992
 
5993
5993
  /*
5994
5994
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6133,7 +6133,7 @@
6133
6133
  }
6134
6134
  }
6135
6135
 
6136
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6136
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6137
6137
  /*
6138
6138
  * Copyright (c) Microsoft Corporation. All rights reserved.
6139
6139
  * Licensed under the MIT License.
@@ -6197,7 +6197,7 @@
6197
6197
  uiNotAllowed: uiNotAllowed
6198
6198
  });
6199
6199
 
6200
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6200
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6201
6201
 
6202
6202
  /*
6203
6203
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6264,7 +6264,7 @@
6264
6264
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
6265
6265
  }
6266
6266
 
6267
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6267
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6268
6268
 
6269
6269
  /*
6270
6270
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6283,7 +6283,7 @@
6283
6283
  }
6284
6284
  }
6285
6285
 
6286
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6286
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6287
6287
 
6288
6288
  /*
6289
6289
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6354,7 +6354,7 @@
6354
6354
  }
6355
6355
  }
6356
6356
 
6357
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6357
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6358
6358
 
6359
6359
  /*
6360
6360
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6782,7 +6782,7 @@
6782
6782
  return baseAccount;
6783
6783
  }
6784
6784
 
6785
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6785
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6786
6786
  /*
6787
6787
  * Copyright (c) Microsoft Corporation. All rights reserved.
6788
6788
  * Licensed under the MIT License.
@@ -6792,7 +6792,7 @@
6792
6792
  UPN: "UPN",
6793
6793
  };
6794
6794
 
6795
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6795
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6796
6796
  /*
6797
6797
  * Copyright (c) Microsoft Corporation. All rights reserved.
6798
6798
  * Licensed under the MIT License.
@@ -6811,7 +6811,7 @@
6811
6811
  }
6812
6812
  }
6813
6813
 
6814
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6814
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6815
6815
 
6816
6816
  /*
6817
6817
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6835,7 +6835,7 @@
6835
6835
  };
6836
6836
  }
6837
6837
 
6838
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6838
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6839
6839
 
6840
6840
  /*
6841
6841
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6921,7 +6921,7 @@
6921
6921
  }
6922
6922
  }
6923
6923
 
6924
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6924
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6925
6925
 
6926
6926
  /*
6927
6927
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6952,7 +6952,7 @@
6952
6952
  return new NetworkError(error, httpStatus, responseHeaders);
6953
6953
  }
6954
6954
 
6955
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6955
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6956
6956
 
6957
6957
  /*
6958
6958
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7085,7 +7085,7 @@
7085
7085
  return response;
7086
7086
  }
7087
7087
 
7088
- /*! @azure/msal-common v16.14.1 2026-09-23 */
7088
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
7089
7089
 
7090
7090
  /*
7091
7091
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7349,7 +7349,7 @@
7349
7349
  }
7350
7350
  }
7351
7351
 
7352
- /*! @azure/msal-common v16.14.1 2026-09-23 */
7352
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
7353
7353
 
7354
7354
  /*
7355
7355
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7576,7 +7576,7 @@
7576
7576
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7577
7577
  }
7578
7578
 
7579
- /*! @azure/msal-common v16.14.1 2026-09-23 */
7579
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
7580
7580
 
7581
7581
  /*
7582
7582
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8125,7 +8125,7 @@
8125
8125
  }
8126
8126
  }
8127
8127
 
8128
- /*! @azure/msal-common v16.14.1 2026-09-23 */
8128
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
8129
8129
 
8130
8130
  /*
8131
8131
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8284,6 +8284,7 @@
8284
8284
  addRedirectUri(parameters, request.redirectUri);
8285
8285
  }
8286
8286
  addScopes(parameters, request.scopes, request.correlationId, true, this.config.authOptions.authority.options.OIDCOptions?.defaultScopes);
8287
+ addResource(parameters, request.resource);
8287
8288
  addGrantType(parameters, GrantType.REFRESH_TOKEN_GRANT);
8288
8289
  addClientInfo(parameters);
8289
8290
  addLibraryInfo(parameters, this.config.libraryInfo);
@@ -8359,7 +8360,7 @@
8359
8360
  }
8360
8361
  }
8361
8362
 
8362
- /*! @azure/msal-common v16.14.1 2026-09-23 */
8363
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
8363
8364
 
8364
8365
  /*
8365
8366
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8652,7 +8653,7 @@
8652
8653
  clearNativeBrokerErrorCode() { }
8653
8654
  }
8654
8655
 
8655
- /*! @azure/msal-common v16.14.1 2026-09-23 */
8656
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
8656
8657
 
8657
8658
  /*
8658
8659
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8779,7 +8780,7 @@
8779
8780
  }
8780
8781
  }
8781
8782
 
8782
- /*! @azure/msal-common v16.14.1 2026-09-23 */
8783
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
8783
8784
 
8784
8785
  /*
8785
8786
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8795,7 +8796,7 @@
8795
8796
  },
8796
8797
  };
8797
8798
 
8798
- /*! @azure/msal-common v16.14.1 2026-09-23 */
8799
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
8799
8800
 
8800
8801
  /*
8801
8802
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8930,6 +8931,20 @@
8930
8931
  const HandleRedirectPromiseMeasurement = "handleRedirectPromise";
8931
8932
  const HandleNativeRedirectPromiseMeasurement = "handleNativeRedirectPromise";
8932
8933
  const NativeMessageHandlerHandshake = "nativeMessageHandlerHandshake";
8934
+ const NativeGenerateAuthResult = "nativeGenerateAuthResult";
8935
+ const PlatformAuthProviderDiscovery = "platformAuthProviderDiscovery";
8936
+ const PlatformAuthDOMCreateProvider = "platformAuthDOMCreateProvider";
8937
+ const PlatformAuthDOMGetSupportedContracts = "platformAuthDOMGetSupportedContracts";
8938
+ const PlatformAuthDOMInitializeRequest = "platformAuthDOMInitializeRequest";
8939
+ const PlatformAuthDOMGetToken = "platformAuthDOMGetToken";
8940
+ const PlatformAuthDOMValidateResponse = "platformAuthDOMValidateResponse";
8941
+ const PlatformAuthExtensionCreateProvider = "platformAuthExtensionCreateProvider";
8942
+ const PlatformAuthExtensionGetToken = "platformAuthExtensionGetToken";
8943
+ const PlatformAuthExtensionValidateResponse = "platformAuthExtensionValidateResponse";
8944
+ const PlatformAuthInteractionClientInitializeRequest = "platformAuthInteractionClientInitializeRequest";
8945
+ const PlatformAuthHandleNativeResponse = "platformAuthHandleNativeResponse";
8946
+ const PlatformAuthCacheAccount = "platformAuthCacheAccount";
8947
+ const PlatformAuthCacheNativeTokens = "platformAuthCacheNativeTokens";
8933
8948
  const RemoveHiddenIframe = "removeHiddenIframe";
8934
8949
  const ImportExistingCache = "importExistingCache";
8935
8950
  /**
@@ -11104,7 +11119,9 @@
11104
11119
  await invokeAsync(this.importExistingCache.bind(this), ImportExistingCache, this.logger, this.performanceClient, correlationId)(correlationId);
11105
11120
  // Register listener for cache updates in other tabs
11106
11121
  this.broadcast.addEventListener("message", (event) => {
11107
- this.updateCache(event, correlationId);
11122
+ this.updateCache(event, correlationId).catch(() => {
11123
+ this.logger.error("0ufnan", correlationId);
11124
+ });
11108
11125
  });
11109
11126
  this.initialized = true;
11110
11127
  }
@@ -11166,19 +11183,20 @@
11166
11183
  this.broadcast.postMessage({
11167
11184
  key: key,
11168
11185
  value: value,
11169
- context: this.getContext(key),
11186
+ context: this.getBroadcastContext(key),
11170
11187
  });
11171
11188
  }
11172
11189
  removeItem(key) {
11173
- if (this.memoryStorage.containsKey(key)) {
11174
- this.memoryStorage.removeItem(key);
11190
+ const itemExists = this.containsKey(key) || this.memoryStorage.containsKey(key);
11191
+ window.localStorage.removeItem(key);
11192
+ this.memoryStorage.removeItem(key);
11193
+ if (itemExists) {
11175
11194
  this.broadcast.postMessage({
11176
11195
  key: key,
11177
11196
  value: null,
11178
- context: this.getContext(key),
11197
+ context: this.getBroadcastContext(key),
11179
11198
  });
11180
11199
  }
11181
- window.localStorage.removeItem(key);
11182
11200
  }
11183
11201
  getKeys() {
11184
11202
  return Object.keys(window.localStorage);
@@ -11295,29 +11313,73 @@
11295
11313
  await Promise.all(promiseArr);
11296
11314
  return importedArr;
11297
11315
  }
11298
- /**
11299
- * Gets encryption context for a given cache entry. This is clientId for app specific entries, empty string for shared entries
11300
- * @param key
11301
- * @returns
11302
- */
11303
11316
  getContext(key) {
11304
- let context = "";
11305
- if (key.includes(this.clientId)) {
11306
- context = this.clientId; // Used to bind encryption key to this appId
11317
+ return key.includes(this.clientId) ? this.clientId : "";
11318
+ }
11319
+ getBroadcastContext(key) {
11320
+ const normalizedKey = key.toLowerCase();
11321
+ const keySegments = normalizedKey.split(CACHE_KEY_SEPARATOR);
11322
+ if (keySegments.length > 1) {
11323
+ return keySegments[4] === this.clientId.toLowerCase()
11324
+ ? this.clientId
11325
+ : "";
11326
+ }
11327
+ const credentialType = this.getCredentialType(normalizedKey);
11328
+ if (credentialType) {
11329
+ const ownerPrefix = `-${credentialType}-${this.clientId.toLowerCase()}-`;
11330
+ return normalizedKey.includes(ownerPrefix) ? this.clientId : "";
11331
+ }
11332
+ return normalizedKey.includes(this.clientId.toLowerCase())
11333
+ ? this.clientId
11334
+ : "";
11335
+ }
11336
+ getCredentialType(key) {
11337
+ const normalizedKey = key.toLowerCase();
11338
+ const keySegments = normalizedKey.split(CACHE_KEY_SEPARATOR);
11339
+ const structuredCredentialType = keySegments[3];
11340
+ return Object.values(CredentialType)
11341
+ .map((type) => type.toLowerCase())
11342
+ .find((type) => structuredCredentialType === type ||
11343
+ normalizedKey.includes(`-${type}-`));
11344
+ }
11345
+ isFamilyRefreshToken(key, credentialType) {
11346
+ if (credentialType !==
11347
+ CredentialType.REFRESH_TOKEN.toLowerCase()) {
11348
+ return false;
11307
11349
  }
11308
- return context;
11350
+ const normalizedKey = key.toLowerCase();
11351
+ const keySegments = normalizedKey.split(CACHE_KEY_SEPARATOR);
11352
+ return keySegments.length > 1
11353
+ ? keySegments[4] === THE_FAMILY_ID
11354
+ : normalizedKey.includes(`-${credentialType}-${THE_FAMILY_ID}-`);
11355
+ }
11356
+ isContextValid(key, context) {
11357
+ const credentialType = this.getCredentialType(key);
11358
+ const isFamilyRefreshToken = credentialType && this.isFamilyRefreshToken(key, credentialType);
11359
+ const isClientBoundCredential = !!credentialType && !isFamilyRefreshToken;
11360
+ return ((!isClientBoundCredential || !!context) &&
11361
+ context === this.getBroadcastContext(key));
11309
11362
  }
11310
- updateCache(event, correlationId) {
11363
+ async updateCache(event, correlationId) {
11311
11364
  this.logger.trace("17cxcm", correlationId);
11312
11365
  const perfMeasurement = this.performanceClient.startMeasurement(LocalStorageUpdated);
11313
11366
  perfMeasurement.add({ isBackground: true });
11314
- const { key, value, context } = event.data;
11315
- if (!key) {
11367
+ const key = event.data?.key;
11368
+ const context = event.data?.context;
11369
+ if (typeof key !== "string" || !key) {
11316
11370
  this.logger.error("0e10qr", correlationId);
11317
11371
  perfMeasurement.end({ success: false, errorCode: "noKey" });
11318
11372
  return;
11319
11373
  }
11320
- if (context && context !== this.clientId) {
11374
+ if (typeof context !== "string") {
11375
+ this.logger.error("16gtk4", correlationId);
11376
+ perfMeasurement.end({
11377
+ success: false,
11378
+ errorCode: "noContext",
11379
+ });
11380
+ return;
11381
+ }
11382
+ if (!this.isContextValid(key, context)) {
11321
11383
  this.logger.trace(`04rtdy ${context}`, correlationId);
11322
11384
  /*
11323
11385
  * Discarded rather than ended: this is expected routing, not a failure.
@@ -11335,15 +11397,36 @@
11335
11397
  perfMeasurement.discard();
11336
11398
  return;
11337
11399
  }
11338
- if (!value) {
11339
- this.memoryStorage.removeItem(key);
11340
- this.logger.verbose("04ypih", correlationId);
11400
+ const persistedValue = this.getItem(key);
11401
+ try {
11402
+ const value = await this.getItemFromEncryptedCache(key, correlationId);
11403
+ // A newer write or removal occurred while this entry was decrypted.
11404
+ if (this.getItem(key) !== persistedValue) {
11405
+ perfMeasurement.discard();
11406
+ return;
11407
+ }
11408
+ if (!value) {
11409
+ this.memoryStorage.removeItem(key);
11410
+ this.logger.verbose("04ypih", correlationId);
11411
+ }
11412
+ else {
11413
+ this.memoryStorage.setItem(key, value);
11414
+ this.logger.verbose("1vzsgt", correlationId);
11415
+ }
11416
+ perfMeasurement.end({ success: true });
11341
11417
  }
11342
- else {
11343
- this.memoryStorage.setItem(key, value);
11344
- this.logger.verbose("1vzsgt", correlationId);
11418
+ catch {
11419
+ if (this.getItem(key) !== persistedValue) {
11420
+ perfMeasurement.discard();
11421
+ return;
11422
+ }
11423
+ this.memoryStorage.removeItem(key);
11424
+ this.logger.error("0flmza", correlationId);
11425
+ perfMeasurement.end({
11426
+ success: false,
11427
+ errorCode: "cacheUpdateFailed",
11428
+ });
11345
11429
  }
11346
- perfMeasurement.end({ success: true });
11347
11430
  }
11348
11431
  }
11349
11432
 
@@ -11416,7 +11499,7 @@
11416
11499
 
11417
11500
  /* eslint-disable header/header */
11418
11501
  const name = "@azure/msal-browser";
11419
- const version = "5.23.0";
11502
+ const version = "5.24.0";
11420
11503
 
11421
11504
  /*
11422
11505
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -14000,7 +14083,7 @@
14000
14083
  // initialize native request (statically builds the request; does not contact the broker)
14001
14084
  let nativeRequest;
14002
14085
  try {
14003
- nativeRequest = await this.initializePlatformRequest(request);
14086
+ nativeRequest = await invokeAsync(this.initializePlatformRequest.bind(this), PlatformAuthInteractionClientInitializeRequest, this.logger, this.performanceClient, this.correlationId)(request);
14004
14087
  }
14005
14088
  catch (e) {
14006
14089
  /*
@@ -14047,7 +14130,7 @@
14047
14130
  // dispatch the request to the broker
14048
14131
  try {
14049
14132
  const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
14050
- const result = await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
14133
+ const result = await invokeAsync(this.handleNativeResponse.bind(this), PlatformAuthHandleNativeResponse, this.logger, this.performanceClient, this.correlationId)(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
14051
14134
  nativeATMeasurement.end({
14052
14135
  success: true,
14053
14136
  requestId: result.requestId,
@@ -14150,7 +14233,7 @@
14150
14233
  */
14151
14234
  async acquireTokenRedirect(request, rootMeasurement, options) {
14152
14235
  this.logger.trace("0luikq", this.correlationId);
14153
- const nativeRequest = await this.initializePlatformRequest(request);
14236
+ const nativeRequest = await invokeAsync(this.initializePlatformRequest.bind(this), PlatformAuthInteractionClientInitializeRequest, this.logger, this.performanceClient, this.correlationId)(request);
14154
14237
  const navigateToLoginRequestUrl = options?.navigateToLoginRequestUrl ?? true;
14155
14238
  try {
14156
14239
  await this.platformAuthProvider.sendMessage(nativeRequest);
@@ -14202,7 +14285,9 @@
14202
14285
  const cachedRequest = this.browserStorage.getCachedNativeRequest();
14203
14286
  if (!cachedRequest) {
14204
14287
  this.logger.verbose("0a6zjb", this.correlationId);
14205
- this.performanceClient?.addFields({ errorCode: "no_cached_request" }, this.correlationId);
14288
+ this.performanceClient?.addFields({
14289
+ errorCode: "no_cached_request",
14290
+ }, this.correlationId);
14206
14291
  return null;
14207
14292
  }
14208
14293
  /*
@@ -14218,7 +14303,7 @@
14218
14303
  try {
14219
14304
  this.logger.verbose("003x5a", this.correlationId);
14220
14305
  const response = await this.platformAuthProvider.sendMessage(request);
14221
- const authResult = await this.handleNativeResponse(response, request, reqTimestamp, storeInCache);
14306
+ const authResult = await invokeAsync(this.handleNativeResponse.bind(this), PlatformAuthHandleNativeResponse, this.logger, this.performanceClient, this.correlationId)(response, request, reqTimestamp, storeInCache);
14222
14307
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
14223
14308
  serverTelemetryManager.clearNativeBrokerErrorCode();
14224
14309
  return authResult;
@@ -14268,10 +14353,10 @@
14268
14353
  // Ensure expires_in is in number format
14269
14354
  response.expires_in = Number(response.expires_in);
14270
14355
  // generate authenticationResult
14271
- const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
14356
+ const result = await invokeAsync(this.generateAuthenticationResult.bind(this), NativeGenerateAuthResult, this.logger, this.performanceClient, this.correlationId)(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
14272
14357
  // cache accounts and tokens in the appropriate storage
14273
- await this.cacheAccount(baseAccount, isKmsi(idTokenClaims));
14274
- await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
14358
+ await invokeAsync(this.cacheAccount.bind(this), PlatformAuthCacheAccount, this.logger, this.performanceClient, this.correlationId)(baseAccount, isKmsi(idTokenClaims));
14359
+ await invokeAsync(this.cacheNativeTokens.bind(this), PlatformAuthCacheNativeTokens, this.logger, this.performanceClient, this.correlationId)(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
14275
14360
  storeInCache);
14276
14361
  return result;
14277
14362
  }
@@ -14523,8 +14608,7 @@
14523
14608
  * attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
14524
14609
  */
14525
14610
  const { scopes, claims, extraParametersNoCache, dpopNonce } = request;
14526
- const scopeSet = new ScopeSet(scopes || [], this.correlationId);
14527
- scopeSet.appendScopes(OIDC_DEFAULT_SCOPES$1);
14611
+ const scopeSet = new ScopeSet([...(scopes || []), ...OIDC_DEFAULT_SCOPES$1], this.correlationId);
14528
14612
  const mergedClaims = buildMergedClaims$1(claims, configClaims?.length ? configClaims : undefined);
14529
14613
  const hasAttributeTokens = !!request.attributeTokens?.length;
14530
14614
  this.performanceClient?.addFields({
@@ -15363,7 +15447,7 @@
15363
15447
  * Licensed under the MIT License.
15364
15448
  */
15365
15449
  class PlatformAuthExtensionHandler {
15366
- constructor(logger, handshakeTimeoutMs, performanceClient, extensionId) {
15450
+ constructor(logger, handshakeTimeoutMs, performanceClient, extensionId, correlationId) {
15367
15451
  this.logger = logger;
15368
15452
  this.handshakeTimeoutMs = handshakeTimeoutMs;
15369
15453
  this.extensionId = extensionId;
@@ -15372,7 +15456,8 @@
15372
15456
  this.messageChannel = new MessageChannel();
15373
15457
  this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound
15374
15458
  this.performanceClient = performanceClient;
15375
- this.handshakeEvent = this.performanceClient.startMeasurement(NativeMessageHandlerHandshake);
15459
+ this.correlationId = correlationId || createNewGuid();
15460
+ this.handshakeEvent = this.performanceClient.startMeasurement(NativeMessageHandlerHandshake, this.correlationId);
15376
15461
  this.platformAuthType =
15377
15462
  PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER;
15378
15463
  }
@@ -15381,29 +15466,51 @@
15381
15466
  * @param request
15382
15467
  */
15383
15468
  async sendMessage(request) {
15384
- this.logger.trace(`0on4p2 ${this.platformAuthType}`, request.correlationId);
15385
- // fall back to native calls
15386
- const extensionRequest = { ...request };
15387
- delete extensionRequest.resourceRequestMethod;
15388
- delete extensionRequest.resourceRequestUri;
15389
- const messageBody = {
15390
- method: NativeExtensionMethod.GetToken,
15391
- request: extensionRequest,
15392
- };
15393
- const req = {
15394
- channel: PlatformAuthConstants.CHANNEL_ID,
15395
- extensionId: this.extensionId,
15396
- responseId: createNewGuid(),
15397
- body: messageBody,
15398
- };
15399
- this.logger.trace(`1qadfi ${this.platformAuthType}`, request.correlationId);
15400
- this.logger.tracePii(`1xm533 ${this.platformAuthType} ${JSON.stringify(req)}`, request.correlationId);
15401
- this.messageChannel.port1.postMessage(req);
15402
- const response = await new Promise((resolve, reject) => {
15403
- this.resolvers.set(req.responseId, { resolve, reject });
15469
+ const correlationId = this.getCorrelationId(request.correlationId);
15470
+ const sendMessageMeasurement = this.performanceClient.startMeasurement(PlatformAuthExtensionGetToken, correlationId);
15471
+ sendMessageMeasurement.add({
15472
+ platformAuthProviderType: this.platformAuthType,
15404
15473
  });
15405
- const validatedResponse = this.validatePlatformBrokerResponse(response);
15406
- return validatedResponse;
15474
+ this.logger.trace(`0on4p2 ${this.platformAuthType}`, correlationId);
15475
+ try {
15476
+ // fall back to native calls
15477
+ const extensionRequest = { ...request };
15478
+ delete extensionRequest.resourceRequestMethod;
15479
+ delete extensionRequest.resourceRequestUri;
15480
+ const messageBody = {
15481
+ method: NativeExtensionMethod.GetToken,
15482
+ request: extensionRequest,
15483
+ };
15484
+ const req = {
15485
+ channel: PlatformAuthConstants.CHANNEL_ID,
15486
+ extensionId: this.extensionId,
15487
+ responseId: createNewGuid(),
15488
+ body: messageBody,
15489
+ };
15490
+ this.logger.trace(`1qadfi ${this.platformAuthType}`, correlationId);
15491
+ this.logger.tracePii(`1xm533 ${this.platformAuthType} ${JSON.stringify(req)}`, correlationId);
15492
+ this.messageChannel.port1.postMessage(req);
15493
+ const response = await new Promise((resolve, reject) => {
15494
+ this.resolvers.set(req.responseId, {
15495
+ resolve,
15496
+ reject,
15497
+ correlationId,
15498
+ });
15499
+ });
15500
+ const validatedResponse = this.validatePlatformBrokerResponse(response, correlationId);
15501
+ sendMessageMeasurement.end({
15502
+ success: true,
15503
+ platformAuthProviderType: this.platformAuthType,
15504
+ });
15505
+ return validatedResponse;
15506
+ }
15507
+ catch (e) {
15508
+ sendMessageMeasurement.end({
15509
+ success: false,
15510
+ platformAuthProviderType: this.platformAuthType,
15511
+ }, e);
15512
+ throw e;
15513
+ }
15407
15514
  }
15408
15515
  /**
15409
15516
  * Returns an instance of the MessageHandler that has successfully established a connection with an extension
@@ -15414,23 +15521,51 @@
15414
15521
  */
15415
15522
  static async createProvider(logger, handshakeTimeoutMs, performanceClient, correlationId) {
15416
15523
  logger.trace("15zfnw", correlationId);
15524
+ const createProviderMeasurement = performanceClient.startMeasurement(PlatformAuthExtensionCreateProvider, correlationId);
15417
15525
  try {
15418
- const preferredProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient, PlatformAuthConstants.PREFERRED_EXTENSION_ID);
15419
- await preferredProvider.sendHandshakeRequest(correlationId);
15526
+ const preferredProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient, PlatformAuthConstants.PREFERRED_EXTENSION_ID, correlationId);
15527
+ await preferredProvider.sendHandshakeRequest();
15528
+ createProviderMeasurement.add({
15529
+ platformAuthProviderAvailable: true,
15530
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
15531
+ });
15532
+ createProviderMeasurement.end({
15533
+ platformAuthProviderAvailable: true,
15534
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
15535
+ });
15420
15536
  return preferredProvider;
15421
15537
  }
15422
15538
  catch (e) {
15423
15539
  // If preferred extension fails for whatever reason, fallback to using any installed extension
15424
- const backupProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient);
15425
- await backupProvider.sendHandshakeRequest(correlationId);
15426
- return backupProvider;
15540
+ try {
15541
+ const backupProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient, undefined, correlationId);
15542
+ await backupProvider.sendHandshakeRequest();
15543
+ createProviderMeasurement.add({
15544
+ platformAuthProviderAvailable: true,
15545
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
15546
+ });
15547
+ createProviderMeasurement.end({
15548
+ platformAuthProviderAvailable: true,
15549
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
15550
+ });
15551
+ return backupProvider;
15552
+ }
15553
+ catch (backupError) {
15554
+ createProviderMeasurement.add({
15555
+ platformAuthProviderAvailable: false,
15556
+ });
15557
+ createProviderMeasurement.end({
15558
+ platformAuthProviderAvailable: false,
15559
+ }, backupError);
15560
+ throw backupError;
15561
+ }
15427
15562
  }
15428
15563
  }
15429
15564
  /**
15430
15565
  * Send handshake request helper.
15431
15566
  */
15432
- async sendHandshakeRequest(correlationId) {
15433
- this.logger.trace(`1dpg9o ${this.platformAuthType}`, correlationId);
15567
+ async sendHandshakeRequest() {
15568
+ this.logger.trace(`1dpg9o ${this.platformAuthType}`, this.correlationId);
15434
15569
  // Register this event listener before sending handshake
15435
15570
  window.addEventListener("message", this.windowListener, false); // false is important, because content script message processing should work first
15436
15571
  const req = {
@@ -15444,13 +15579,18 @@
15444
15579
  this.handshakeEvent.add({
15445
15580
  extensionId: this.extensionId,
15446
15581
  extensionHandshakeTimeoutMs: this.handshakeTimeoutMs,
15582
+ platformAuthRequestCorrelationId: this.correlationId,
15447
15583
  });
15448
15584
  this.messageChannel.port1.onmessage = (event) => {
15449
15585
  this.onChannelMessage(event);
15450
15586
  };
15451
15587
  window.postMessage(req, window.origin, [this.messageChannel.port2]);
15452
15588
  return new Promise((resolve, reject) => {
15453
- this.handshakeResolvers.set(req.responseId, { resolve, reject });
15589
+ this.handshakeResolvers.set(req.responseId, {
15590
+ resolve,
15591
+ reject,
15592
+ correlationId: this.correlationId,
15593
+ });
15454
15594
  this.timeoutId = window.setTimeout(() => {
15455
15595
  /*
15456
15596
  * Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.
@@ -15459,11 +15599,14 @@
15459
15599
  window.removeEventListener("message", this.windowListener, false);
15460
15600
  this.messageChannel.port1.close();
15461
15601
  this.messageChannel.port2.close();
15602
+ this.handshakeEvent.add({
15603
+ extensionHandshakeTimedOut: true,
15604
+ });
15462
15605
  this.handshakeEvent.end({
15463
15606
  extensionHandshakeTimedOut: true,
15464
15607
  success: false,
15465
15608
  });
15466
- reject(createBrowserAuthError(nativeHandshakeTimeout, ""));
15609
+ reject(createBrowserAuthError(nativeHandshakeTimeout, this.correlationId));
15467
15610
  this.handshakeResolvers.delete(req.responseId);
15468
15611
  }, this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here
15469
15612
  });
@@ -15473,7 +15616,7 @@
15473
15616
  * @param event
15474
15617
  */
15475
15618
  onWindowMessage(event) {
15476
- const correlationId = createGuid();
15619
+ let correlationId = createGuid();
15477
15620
  this.logger.trace(`0jpn5u ${this.platformAuthType}`, correlationId);
15478
15621
  // We only accept messages from ourselves
15479
15622
  if (event.source !== window) {
@@ -15497,6 +15640,7 @@
15497
15640
  this.logger.trace(`07buhm ${this.platformAuthType} ${request.responseId}`, correlationId);
15498
15641
  return;
15499
15642
  }
15643
+ correlationId = handshakeResolver.correlationId;
15500
15644
  // If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed
15501
15645
  this.logger.verbose(request.extensionId
15502
15646
  ? `0xrkug ${request.extensionId}`
@@ -15505,11 +15649,15 @@
15505
15649
  this.messageChannel.port1.close();
15506
15650
  this.messageChannel.port2.close();
15507
15651
  window.removeEventListener("message", this.windowListener, false);
15652
+ this.handshakeEvent.add({
15653
+ extensionInstalled: false,
15654
+ });
15508
15655
  this.handshakeEvent.end({
15509
15656
  success: false,
15510
15657
  extensionInstalled: false,
15511
15658
  });
15512
- handshakeResolver.reject(createBrowserAuthError(nativeExtensionNotInstalled, ""));
15659
+ handshakeResolver.reject(createBrowserAuthError(nativeExtensionNotInstalled, correlationId));
15660
+ this.handshakeResolvers.delete(request.responseId);
15513
15661
  }
15514
15662
  }
15515
15663
  /**
@@ -15517,36 +15665,47 @@
15517
15665
  * @param event
15518
15666
  */
15519
15667
  onChannelMessage(event) {
15520
- const correlationId = createGuid();
15521
- this.logger.trace(`1py8yf ${this.platformAuthType}`, correlationId);
15522
15668
  const request = event.data;
15523
- const resolver = this.resolvers.get(request.responseId);
15524
- const handshakeResolver = this.handshakeResolvers.get(request.responseId);
15669
+ const responseId = request?.responseId;
15670
+ const resolver = responseId
15671
+ ? this.resolvers.get(responseId)
15672
+ : undefined;
15673
+ const handshakeResolver = responseId
15674
+ ? this.handshakeResolvers.get(responseId)
15675
+ : undefined;
15676
+ const correlationId = resolver?.correlationId ||
15677
+ handshakeResolver?.correlationId ||
15678
+ createGuid();
15679
+ this.logger.trace(`1py8yf ${this.platformAuthType}`, correlationId);
15525
15680
  try {
15526
15681
  const method = request.body.method;
15527
15682
  if (method === NativeExtensionMethod.Response) {
15528
15683
  if (!resolver) {
15529
15684
  return;
15530
15685
  }
15531
- const response = request.body.response;
15532
- this.logger.trace(`19hpgm ${this.platformAuthType}`, correlationId);
15533
- this.logger.tracePii(`179a24 ${this.platformAuthType} ${JSON.stringify(response)}`, correlationId);
15534
- if (response.status !== "Success") {
15535
- resolver.reject(createNativeAuthError(response.code, correlationId, response.description, response.ext));
15536
- }
15537
- else if (response.result) {
15538
- if (response.result["code"] &&
15539
- response.result["description"]) {
15540
- resolver.reject(createNativeAuthError(response.result["code"], correlationId, response.result["description"], response.result["ext"]));
15686
+ try {
15687
+ const response = request.body.response;
15688
+ this.logger.trace(`19hpgm ${this.platformAuthType}`, correlationId);
15689
+ this.logger.tracePii(`179a24 ${this.platformAuthType} ${JSON.stringify(response)}`, correlationId);
15690
+ if (response.status !== "Success") {
15691
+ resolver.reject(createNativeAuthError(response.code, correlationId, response.description, response.ext));
15692
+ }
15693
+ else if (response.result) {
15694
+ if (response.result["code"] &&
15695
+ response.result["description"]) {
15696
+ resolver.reject(createNativeAuthError(response.result["code"], correlationId, response.result["description"], response.result["ext"]));
15697
+ }
15698
+ else {
15699
+ resolver.resolve(response.result);
15700
+ }
15541
15701
  }
15542
15702
  else {
15543
- resolver.resolve(response.result);
15703
+ throw createAuthError(unexpectedError, correlationId, "Event does not contain result.");
15544
15704
  }
15545
15705
  }
15546
- else {
15547
- throw createAuthError(unexpectedError, correlationId, "Event does not contain result.");
15706
+ finally {
15707
+ this.resolvers.delete(request.responseId);
15548
15708
  }
15549
- this.resolvers.delete(request.responseId);
15550
15709
  }
15551
15710
  else if (method === NativeExtensionMethod.HandshakeResponse) {
15552
15711
  if (!handshakeResolver) {
@@ -15556,25 +15715,46 @@
15556
15715
  clearTimeout(this.timeoutId); // Clear setTimeout
15557
15716
  window.removeEventListener("message", this.windowListener, false); // Remove 'No extension' listener
15558
15717
  this.extensionId = request.extensionId;
15559
- this.extensionVersion = request.body.version;
15718
+ this.extensionVersion = request.body.version?.toString();
15560
15719
  this.logger.verbose(`0yf5ib ${this.platformAuthType} ${this.extensionId}`, correlationId);
15720
+ this.handshakeEvent.add({
15721
+ extensionId: this.extensionId,
15722
+ extensionVersion: this.extensionVersion,
15723
+ extensionInstalled: true,
15724
+ });
15561
15725
  this.handshakeEvent.end({
15726
+ extensionId: this.extensionId,
15727
+ extensionVersion: this.extensionVersion,
15562
15728
  extensionInstalled: true,
15563
15729
  success: true,
15564
15730
  });
15565
15731
  handshakeResolver.resolve();
15566
15732
  this.handshakeResolvers.delete(request.responseId);
15567
15733
  }
15568
- // Do nothing if method is not Response or HandshakeResponse
15734
+ else if (resolver) {
15735
+ this.resolvers.delete(request.responseId);
15736
+ resolver.reject(createAuthError(unexpectedError, correlationId, "Extension response contains an unexpected method."));
15737
+ }
15569
15738
  }
15570
15739
  catch (err) {
15571
15740
  this.logger.error("0xf978", correlationId);
15572
15741
  this.logger.errorPii(`04i99o ${err}`, correlationId);
15573
15742
  this.logger.errorPii(`0xdvsy ${event}`, correlationId);
15574
15743
  if (resolver) {
15575
- resolver.reject(err);
15744
+ this.resolvers.delete(responseId);
15745
+ resolver.reject(err instanceof AuthError
15746
+ ? err
15747
+ : createAuthError(unexpectedError, correlationId, "Unable to parse extension response."));
15576
15748
  }
15577
15749
  else if (handshakeResolver) {
15750
+ clearTimeout(this.timeoutId);
15751
+ window.removeEventListener("message", this.windowListener, false);
15752
+ this.messageChannel.port1.close();
15753
+ this.messageChannel.port2.close();
15754
+ this.handshakeEvent.end({
15755
+ success: false,
15756
+ });
15757
+ this.handshakeResolvers.delete(responseId);
15578
15758
  handshakeResolver.reject(err);
15579
15759
  }
15580
15760
  }
@@ -15583,19 +15763,34 @@
15583
15763
  * Validates native platform response before processing
15584
15764
  * @param response
15585
15765
  */
15586
- validatePlatformBrokerResponse(response) {
15587
- if (response.hasOwnProperty("access_token") &&
15588
- response.hasOwnProperty("id_token") &&
15589
- response.hasOwnProperty("client_info") &&
15590
- response.hasOwnProperty("account") &&
15591
- response.hasOwnProperty("scope") &&
15592
- response.hasOwnProperty("expires_in")) {
15766
+ validatePlatformBrokerResponse(response, correlationId) {
15767
+ const responseCorrelationId = this.getCorrelationId(correlationId);
15768
+ const validationMeasurement = this.performanceClient.startMeasurement(PlatformAuthExtensionValidateResponse, responseCorrelationId);
15769
+ if (response &&
15770
+ Object.prototype.hasOwnProperty.call(response, "access_token") &&
15771
+ Object.prototype.hasOwnProperty.call(response, "id_token") &&
15772
+ Object.prototype.hasOwnProperty.call(response, "client_info") &&
15773
+ Object.prototype.hasOwnProperty.call(response, "account") &&
15774
+ Object.prototype.hasOwnProperty.call(response, "scope") &&
15775
+ Object.prototype.hasOwnProperty.call(response, "expires_in")) {
15776
+ validationMeasurement.end({
15777
+ success: true,
15778
+ platformAuthProviderType: this.platformAuthType,
15779
+ });
15593
15780
  return response;
15594
15781
  }
15595
15782
  else {
15596
- throw createAuthError(unexpectedError, "", "Response missing expected properties.");
15783
+ const error = createAuthError(unexpectedError, responseCorrelationId, "Response missing expected properties.");
15784
+ validationMeasurement.end({
15785
+ success: false,
15786
+ platformAuthProviderType: this.platformAuthType,
15787
+ }, error);
15788
+ throw error;
15597
15789
  }
15598
15790
  }
15791
+ getCorrelationId(correlationId) {
15792
+ return correlationId || this.correlationId;
15793
+ }
15599
15794
  /**
15600
15795
  * Returns the Id for the browser extension this handler is communicating with
15601
15796
  * @returns
@@ -15633,17 +15828,49 @@
15633
15828
  }
15634
15829
  static async createProvider(logger, performanceClient, correlationId) {
15635
15830
  logger.trace("12mj4a", correlationId);
15636
- // @ts-ignore
15637
- if (window.navigator?.platformAuthentication) {
15638
- const supportedContracts =
15639
- // @ts-ignore
15640
- await window.navigator.platformAuthentication.getSupportedContracts(PlatformAuthConstants.MICROSOFT_ENTRA_BROKERID);
15641
- if (supportedContracts?.includes(PlatformAuthConstants.PLATFORM_DOM_APIS)) {
15831
+ const createProviderMeasurement = performanceClient.startMeasurement(PlatformAuthDOMCreateProvider, correlationId);
15832
+ try {
15833
+ const platformAuthentication = window.navigator.platformAuthentication;
15834
+ if (!platformAuthentication) {
15835
+ createProviderMeasurement.add({
15836
+ platformAuthProviderAvailable: false,
15837
+ });
15838
+ createProviderMeasurement.end({
15839
+ platformAuthProviderAvailable: false,
15840
+ });
15841
+ return undefined;
15842
+ }
15843
+ const supportedContracts = (await invokeAsync(platformAuthentication.getSupportedContracts.bind(platformAuthentication), PlatformAuthDOMGetSupportedContracts, logger, performanceClient, correlationId)(PlatformAuthConstants.MICROSOFT_ENTRA_BROKERID));
15844
+ const contractSupported = supportedContracts?.includes(PlatformAuthConstants.PLATFORM_DOM_APIS);
15845
+ if (contractSupported) {
15642
15846
  logger.trace("1h5q1r", correlationId);
15847
+ createProviderMeasurement.add({
15848
+ platformAuthProviderAvailable: true,
15849
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_DOM_PROVIDER,
15850
+ });
15851
+ createProviderMeasurement.end({
15852
+ platformAuthProviderAvailable: true,
15853
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_DOM_PROVIDER,
15854
+ });
15643
15855
  return new PlatformAuthDOMHandler(logger, performanceClient, correlationId);
15644
15856
  }
15857
+ createProviderMeasurement.add({
15858
+ platformAuthProviderAvailable: false,
15859
+ });
15860
+ createProviderMeasurement.end({
15861
+ platformAuthProviderAvailable: false,
15862
+ });
15863
+ return undefined;
15864
+ }
15865
+ catch (e) {
15866
+ createProviderMeasurement.add({
15867
+ platformAuthProviderAvailable: false,
15868
+ });
15869
+ createProviderMeasurement.end({
15870
+ platformAuthProviderAvailable: false,
15871
+ }, e);
15872
+ throw e;
15645
15873
  }
15646
- return undefined;
15647
15874
  }
15648
15875
  /**
15649
15876
  * Returns the Id for the broker extension this handler is communicating with
@@ -15664,31 +15891,46 @@
15664
15891
  * @returns
15665
15892
  */
15666
15893
  async sendMessage(request) {
15667
- this.logger.trace(`02bcil ${this.platformAuthType}`, request.correlationId);
15894
+ const correlationId = this.getCorrelationId(request.correlationId);
15895
+ const sendMessageMeasurement = this.performanceClient.startMeasurement(PlatformAuthDOMGetToken, correlationId);
15896
+ sendMessageMeasurement.add({
15897
+ platformAuthProviderType: this.platformAuthType,
15898
+ });
15899
+ this.logger.trace(`02bcil ${this.platformAuthType}`, correlationId);
15668
15900
  try {
15669
- const platformDOMRequest = this.initializePlatformDOMRequest(request);
15901
+ const platformDOMRequest = invoke(this.initializePlatformDOMRequest.bind(this), PlatformAuthDOMInitializeRequest, this.logger, this.performanceClient, correlationId)(request);
15670
15902
  const response =
15671
15903
  // @ts-ignore
15672
15904
  await window.navigator.platformAuthentication.executeGetToken(platformDOMRequest);
15673
- return this.validatePlatformBrokerResponse(response, request.correlationId);
15905
+ const validatedResponse = this.validatePlatformBrokerResponse(response, correlationId);
15906
+ sendMessageMeasurement.end({
15907
+ success: true,
15908
+ platformAuthProviderType: this.platformAuthType,
15909
+ });
15910
+ return validatedResponse;
15674
15911
  }
15675
15912
  catch (e) {
15676
- this.logger.error(`11im7g ${this.platformAuthType}`, request.correlationId);
15913
+ this.logger.error(`11im7g ${this.platformAuthType}`, correlationId);
15914
+ sendMessageMeasurement.end({
15915
+ success: false,
15916
+ platformAuthProviderType: this.platformAuthType,
15917
+ }, e);
15677
15918
  throw e;
15678
15919
  }
15679
15920
  }
15680
15921
  initializePlatformDOMRequest(request) {
15681
- this.logger.trace(`15d6yv ${this.platformAuthType}`, request.correlationId);
15682
15922
  const { accountId, clientId, authority, scope, redirectUri, correlationId, state, preferBinding, enclave, reqCnf, extraParametersNoCache, extraParameters, ...remainingProperties } = request;
15923
+ const requestCorrelationId = this.getCorrelationId(correlationId);
15924
+ this.logger.trace(`15d6yv ${this.platformAuthType}`, requestCorrelationId);
15683
15925
  delete remainingProperties.resourceRequestMethod;
15684
15926
  delete remainingProperties.resourceRequestUri;
15685
- const validExtraParameters = this.getDOMExtraParams(remainingProperties, correlationId);
15927
+ const validExtraParameters = this.getDOMExtraParams(remainingProperties, requestCorrelationId);
15686
15928
  const platformDOMRequest = {
15687
15929
  accountId: accountId,
15688
15930
  brokerId: this.getExtensionId(),
15689
15931
  authority: authority,
15690
15932
  clientId: clientId,
15691
- correlationId: correlationId || this.correlationId,
15933
+ correlationId: requestCorrelationId,
15692
15934
  extraParameters: {
15693
15935
  ...extraParameters,
15694
15936
  ...validExtraParameters,
@@ -15705,32 +15947,68 @@
15705
15947
  return platformDOMRequest;
15706
15948
  }
15707
15949
  validatePlatformBrokerResponse(response, correlationId) {
15708
- if (response.hasOwnProperty("isSuccess")) {
15709
- if (response.hasOwnProperty("accessToken") &&
15710
- response.hasOwnProperty("idToken") &&
15711
- response.hasOwnProperty("clientInfo") &&
15712
- response.hasOwnProperty("account") &&
15713
- response.hasOwnProperty("scopes") &&
15714
- response.hasOwnProperty("expiresIn")) {
15950
+ const validationMeasurement = this.performanceClient.startMeasurement(PlatformAuthDOMValidateResponse, correlationId);
15951
+ const requiredKeys = [
15952
+ "accessToken",
15953
+ "idToken",
15954
+ "clientInfo",
15955
+ "account",
15956
+ "scopes",
15957
+ "expiresIn",
15958
+ ];
15959
+ const isValid = response &&
15960
+ requiredKeys.every((key) => Object.prototype.hasOwnProperty.call(response, key));
15961
+ if (response &&
15962
+ Object.prototype.hasOwnProperty.call(response, "isSuccess")) {
15963
+ if (isValid) {
15715
15964
  this.logger.trace(`0h4vei ${this.platformAuthType}`, correlationId);
15716
- return this.convertToPlatformBrokerResponse(response, correlationId);
15965
+ try {
15966
+ const validatedResponse = this.convertToPlatformBrokerResponse(response, correlationId);
15967
+ validationMeasurement.end({
15968
+ success: true,
15969
+ platformAuthProviderType: this.platformAuthType,
15970
+ });
15971
+ return validatedResponse;
15972
+ }
15973
+ catch (e) {
15974
+ validationMeasurement.end({
15975
+ success: false,
15976
+ platformAuthProviderType: this.platformAuthType,
15977
+ }, e);
15978
+ throw e;
15979
+ }
15717
15980
  }
15718
- else if (response.hasOwnProperty("error")) {
15981
+ else if (Object.prototype.hasOwnProperty.call(response, "error")) {
15719
15982
  const errorResponse = response;
15720
15983
  if (errorResponse.isSuccess === false &&
15721
15984
  errorResponse.error &&
15722
15985
  errorResponse.error.code) {
15723
15986
  this.logger.trace(`0g92vm ${this.platformAuthType}`, correlationId);
15724
- throw createNativeAuthError(errorResponse.error.code, correlationId, errorResponse.error.description, {
15987
+ const nativeAuthError = createNativeAuthError(errorResponse.error.code, correlationId, errorResponse.error.description, {
15725
15988
  error: parseInt(errorResponse.error.errorCode),
15726
15989
  protocol_error: errorResponse.error.protocolError,
15727
15990
  status: errorResponse.error.status,
15728
15991
  properties: errorResponse.error.properties,
15729
15992
  });
15993
+ validationMeasurement.end({
15994
+ success: false,
15995
+ platformAuthProviderType: this.platformAuthType,
15996
+ brokerErrorName: errorResponse.error.code,
15997
+ brokerErrorCode: errorResponse.error.errorCode,
15998
+ }, nativeAuthError);
15999
+ throw nativeAuthError;
15730
16000
  }
15731
16001
  }
15732
16002
  }
15733
- throw createAuthError(unexpectedError, correlationId, "Response missing expected properties.");
16003
+ const error = createAuthError(unexpectedError, correlationId, "Response missing expected properties.");
16004
+ validationMeasurement.end({
16005
+ success: false,
16006
+ platformAuthProviderType: this.platformAuthType,
16007
+ }, error);
16008
+ throw error;
16009
+ }
16010
+ getCorrelationId(correlationId) {
16011
+ return correlationId || this.correlationId;
15734
16012
  }
15735
16013
  convertToPlatformBrokerResponse(response, correlationId) {
15736
16014
  this.logger.trace(`14913t ${this.platformAuthType}`, correlationId);
@@ -15809,26 +16087,55 @@
15809
16087
  }
15810
16088
  async function getPlatformAuthProvider(logger, performanceClient, correlationId, nativeBrokerHandshakeTimeout, enablePlatformBrokerDOMSupport) {
15811
16089
  logger.trace("134j0v", correlationId);
16090
+ const discoveryMeasurement = performanceClient.startMeasurement(PlatformAuthProviderDiscovery, correlationId);
15812
16091
  logger.trace(`04c81g ${enablePlatformBrokerDOMSupport}`, correlationId);
15813
16092
  let platformAuthProvider;
15814
16093
  try {
15815
16094
  if (enablePlatformBrokerDOMSupport) {
15816
16095
  // Check if DOM platform API is supported first
15817
- platformAuthProvider = await PlatformAuthDOMHandler.createProvider(logger, performanceClient, correlationId);
16096
+ try {
16097
+ platformAuthProvider =
16098
+ await PlatformAuthDOMHandler.createProvider(logger, performanceClient, correlationId);
16099
+ }
16100
+ catch (e) {
16101
+ logger.trace("1ij09j", correlationId);
16102
+ }
16103
+ if (platformAuthProvider) {
16104
+ discoveryMeasurement.add({
16105
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_DOM_PROVIDER,
16106
+ });
16107
+ discoveryMeasurement.end({
16108
+ success: true,
16109
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_DOM_PROVIDER,
16110
+ });
16111
+ return platformAuthProvider;
16112
+ }
15818
16113
  }
15819
- if (!platformAuthProvider) {
15820
- logger.trace("0l3na8", correlationId);
15821
- /*
15822
- * If DOM APIs are not available, check if browser extension is available.
15823
- * Platform authentication via DOM APIs is preferred over extension APIs.
15824
- */
15825
- platformAuthProvider =
15826
- await PlatformAuthExtensionHandler.createProvider(logger, nativeBrokerHandshakeTimeout ||
15827
- DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, performanceClient, correlationId);
16114
+ logger.trace("0l3na8", correlationId);
16115
+ /*
16116
+ * If DOM APIs are not available, check if browser extension is available.
16117
+ * Platform authentication via DOM APIs is preferred over extension APIs.
16118
+ */
16119
+ platformAuthProvider =
16120
+ await PlatformAuthExtensionHandler.createProvider(logger, nativeBrokerHandshakeTimeout ||
16121
+ DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, performanceClient, correlationId);
16122
+ if (platformAuthProvider) {
16123
+ discoveryMeasurement.add({
16124
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
16125
+ });
15828
16126
  }
16127
+ discoveryMeasurement.end({
16128
+ success: !!platformAuthProvider,
16129
+ platformAuthProviderType: platformAuthProvider
16130
+ ? PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER
16131
+ : undefined,
16132
+ });
15829
16133
  }
15830
16134
  catch (e) {
15831
16135
  logger.trace("0icbd7", e);
16136
+ discoveryMeasurement.end({
16137
+ success: false,
16138
+ }, e);
15832
16139
  }
15833
16140
  return platformAuthProvider;
15834
16141
  }
@@ -15840,8 +16147,22 @@
15840
16147
  * @param platformAuthProvider
15841
16148
  * @param authenticationScheme
15842
16149
  */
15843
- function isPlatformAuthAllowed(config, logger, correlationId, platformAuthProvider, authenticationScheme) {
16150
+ function isPlatformAuthAllowed(config, logger, correlationId, platformAuthProvider, authenticationScheme, performanceClient) {
15844
16151
  logger.trace("0uko3r", correlationId);
16152
+ const schemeSupported = !authenticationScheme ||
16153
+ authenticationScheme === AuthenticationScheme$1.BEARER ||
16154
+ authenticationScheme === AuthenticationScheme$1.POP;
16155
+ const fields = {
16156
+ allowPlatformBroker: config.system.allowPlatformBroker,
16157
+ ...(config.system.allowPlatformBroker && {
16158
+ platformAuthProviderType: platformAuthProvider instanceof PlatformAuthDOMHandler
16159
+ ? PlatformAuthConstants.PLATFORM_DOM_PROVIDER
16160
+ : platformAuthProvider
16161
+ ? PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER
16162
+ : undefined,
16163
+ }),
16164
+ };
16165
+ performanceClient?.addFields(fields, correlationId);
15845
16166
  // throw an error if allowPlatformBroker is not enabled and allowPlatformBrokerWithDOM is enabled
15846
16167
  if (!config.system.allowPlatformBroker &&
15847
16168
  config.experimental.allowPlatformBrokerWithDOM) {
@@ -15857,17 +16178,11 @@
15857
16178
  // Platform broker auth providers are not available
15858
16179
  return false;
15859
16180
  }
15860
- if (authenticationScheme) {
15861
- switch (authenticationScheme) {
15862
- case AuthenticationScheme$1.BEARER:
15863
- case AuthenticationScheme$1.POP:
15864
- logger.trace("18tev1", correlationId);
15865
- return true;
15866
- default:
15867
- logger.trace("1dd2nh", correlationId);
15868
- return false;
15869
- }
16181
+ if (!schemeSupported) {
16182
+ logger.trace("1dd2nh", correlationId);
16183
+ return false;
15870
16184
  }
16185
+ logger.trace("18tev1", correlationId);
15871
16186
  return true;
15872
16187
  }
15873
16188
 
@@ -17363,6 +17678,9 @@
17363
17678
  this.hybridAuthCodeResponses = new Map();
17364
17679
  // Initialize performance client
17365
17680
  this.performanceClient = this.config.telemetry.client;
17681
+ this.performanceClient.addGlobalFields({
17682
+ allowPlatformBroker: this.config.system.allowPlatformBroker,
17683
+ });
17366
17684
  // Initialize environment-specific crypto and token-binding services.
17367
17685
  if (this.isBrowserEnvironment) {
17368
17686
  this.browserCrypto = new CryptoOps(this.logger, this.performanceClient);
@@ -17623,9 +17941,9 @@
17623
17941
  enforceResourceParameter(this.config.auth.isMcp, request);
17624
17942
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, correlationId, exports.InteractionType.Redirect, request);
17625
17943
  let result;
17626
- if (this.platformAuthProvider &&
17627
- this.canUsePlatformBroker(request)) {
17628
- const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId, this.tokenBindingKeyManager);
17944
+ const platformAuthProvider = this.platformAuthProvider;
17945
+ if (this.canUsePlatformBroker(request) && platformAuthProvider) {
17946
+ const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId, this.tokenBindingKeyManager);
17629
17947
  result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
17630
17948
  if (e instanceof NativeAuthError &&
17631
17949
  isFatalNativeAuthError(e)) {
@@ -18310,11 +18628,8 @@
18310
18628
  canUsePlatformBroker(request, accountId) {
18311
18629
  const correlationId = this.getRequestCorrelationId(request);
18312
18630
  this.logger.trace("1n9lbl", correlationId);
18313
- if (!this.platformAuthProvider) {
18314
- this.logger.trace("0vnu11", correlationId);
18315
- return false;
18316
- }
18317
- if (!isPlatformAuthAllowed(this.config, this.logger, correlationId, this.platformAuthProvider, request.authenticationScheme)) {
18631
+ const platformAuthAllowed = isPlatformAuthAllowed(this.config, this.logger, correlationId, this.platformAuthProvider, request.authenticationScheme, this.performanceClient);
18632
+ if (!platformAuthAllowed) {
18318
18633
  this.logger.trace("0yoy1g", correlationId);
18319
18634
  return false;
18320
18635
  }
@@ -18706,7 +19021,7 @@
18706
19021
  */
18707
19022
  async acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy) {
18708
19023
  // if the cache policy is set to access_token only, we should not be hitting the native layer yet
18709
- if (isPlatformAuthAllowed(this.config, this.logger, silentRequest.correlationId, this.platformAuthProvider, silentRequest.authenticationScheme) &&
19024
+ if (isPlatformAuthAllowed(this.config, this.logger, silentRequest.correlationId, this.platformAuthProvider, silentRequest.authenticationScheme, this.performanceClient) &&
18710
19025
  silentRequest.account.nativeAccountId) {
18711
19026
  this.logger.verbose("0sczo4", silentRequest.correlationId);
18712
19027
  this.performanceClient.addFields({ isPlatformBrokerRequest: true }, silentRequest.correlationId);