@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.msalCustomAuth = {}));
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.
@@ -294,7 +294,7 @@
294
294
  // Token renewal offset default in seconds
295
295
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
296
296
 
297
- /*! @azure/msal-common v16.14.1 2026-09-23 */
297
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
298
298
  /*
299
299
  * Copyright (c) Microsoft Corporation. All rights reserved.
300
300
  * Licensed under the MIT License.
@@ -323,7 +323,7 @@
323
323
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
324
324
  }
325
325
 
326
- /*! @azure/msal-common v16.14.1 2026-09-23 */
326
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
327
327
 
328
328
  /*
329
329
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -346,7 +346,7 @@
346
346
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
347
347
  }
348
348
 
349
- /*! @azure/msal-common v16.14.1 2026-09-23 */
349
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
350
350
  /*
351
351
  * Copyright (c) Microsoft Corporation. All rights reserved.
352
352
  * Licensed under the MIT License.
@@ -384,7 +384,7 @@
384
384
  const resourceParameterRequired = "resource_parameter_required";
385
385
  const misplacedResourceParam = "misplaced_resource_parameter";
386
386
 
387
- /*! @azure/msal-common v16.14.1 2026-09-23 */
387
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
388
388
 
389
389
  /*
390
390
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -422,7 +422,7 @@
422
422
  };
423
423
  }
424
424
 
425
- /*! @azure/msal-common v16.14.1 2026-09-23 */
425
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
426
426
 
427
427
  /*
428
428
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -488,7 +488,7 @@
488
488
  return matches[2];
489
489
  }
490
490
 
491
- /*! @azure/msal-common v16.14.1 2026-09-23 */
491
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
492
492
 
493
493
  /*
494
494
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -576,7 +576,7 @@
576
576
  return updatedAccountInfo;
577
577
  }
578
578
 
579
- /*! @azure/msal-common v16.14.1 2026-09-23 */
579
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
580
580
  /*
581
581
  * Copyright (c) Microsoft Corporation. All rights reserved.
582
582
  * Licensed under the MIT License.
@@ -590,7 +590,7 @@
590
590
  Ciam: 3,
591
591
  };
592
592
 
593
- /*! @azure/msal-common v16.14.1 2026-09-23 */
593
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
594
594
  /*
595
595
  * Copyright (c) Microsoft Corporation. All rights reserved.
596
596
  * Licensed under the MIT License.
@@ -612,7 +612,7 @@
612
612
  return null;
613
613
  }
614
614
 
615
- /*! @azure/msal-common v16.14.1 2026-09-23 */
615
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
616
616
  /*
617
617
  * Copyright (c) Microsoft Corporation. All rights reserved.
618
618
  * Licensed under the MIT License.
@@ -636,7 +636,7 @@
636
636
  EAR: "EAR",
637
637
  };
638
638
 
639
- /*! @azure/msal-common v16.14.1 2026-09-23 */
639
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
640
640
  /**
641
641
  * Returns the AccountInfo interface for this account.
642
642
  * @internal
@@ -825,7 +825,7 @@
825
825
  entity.hasOwnProperty("authorityType"));
826
826
  }
827
827
 
828
- /*! @azure/msal-common v16.14.1 2026-09-23 */
828
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
829
829
  /*
830
830
  * Copyright (c) Microsoft Corporation. All rights reserved.
831
831
  * Licensed under the MIT License.
@@ -835,7 +835,7 @@
835
835
  */
836
836
  const unexpectedError = "unexpected_error";
837
837
 
838
- /*! @azure/msal-common v16.14.1 2026-09-23 */
838
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
839
839
 
840
840
  /*
841
841
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -855,7 +855,7 @@
855
855
  return new ClientConfigurationError(errorCode, correlationId);
856
856
  }
857
857
 
858
- /*! @azure/msal-common v16.14.1 2026-09-23 */
858
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
859
859
  /*
860
860
  * Copyright (c) Microsoft Corporation. All rights reserved.
861
861
  * Licensed under the MIT License.
@@ -886,7 +886,7 @@
886
886
  const invalidDpopNonce = "invalid_dpop_nonce";
887
887
  const dpopMissingResourceContext = "dpop_missing_resource_context";
888
888
 
889
- /*! @azure/msal-common v16.14.1 2026-09-23 */
889
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
890
890
  /*
891
891
  * Copyright (c) Microsoft Corporation. All rights reserved.
892
892
  * Licensed under the MIT License.
@@ -898,7 +898,7 @@
898
898
  response.hasOwnProperty("jwks_uri"));
899
899
  }
900
900
 
901
- /*! @azure/msal-common v16.14.1 2026-09-23 */
901
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
902
902
  /*
903
903
  * Copyright (c) Microsoft Corporation. All rights reserved.
904
904
  * Licensed under the MIT License.
@@ -978,7 +978,7 @@
978
978
  }
979
979
  }
980
980
 
981
- /*! @azure/msal-common v16.14.1 2026-09-23 */
981
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
982
982
 
983
983
  /*
984
984
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1136,7 +1136,7 @@
1136
1136
  }
1137
1137
  }
1138
1138
 
1139
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1139
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1140
1140
 
1141
1141
  /*
1142
1142
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1290,7 +1290,7 @@
1290
1290
  return null;
1291
1291
  }
1292
1292
 
1293
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1293
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1294
1294
  /*
1295
1295
  * Copyright (c) Microsoft Corporation. All rights reserved.
1296
1296
  * Licensed under the MIT License.
@@ -1299,7 +1299,7 @@
1299
1299
  // AzureCloudInstance is not specified.
1300
1300
  None: "none"};
1301
1301
 
1302
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1302
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1303
1303
  /*
1304
1304
  * Copyright (c) Microsoft Corporation. All rights reserved.
1305
1305
  * Licensed under the MIT License.
@@ -1309,7 +1309,7 @@
1309
1309
  response.hasOwnProperty("metadata"));
1310
1310
  }
1311
1311
 
1312
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1312
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1313
1313
  /*
1314
1314
  * Copyright (c) Microsoft Corporation. All rights reserved.
1315
1315
  * Licensed under the MIT License.
@@ -1319,7 +1319,7 @@
1319
1319
  response.hasOwnProperty("error_description"));
1320
1320
  }
1321
1321
 
1322
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1322
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1323
1323
  /*
1324
1324
  * Copyright (c) Microsoft Corporation. All rights reserved.
1325
1325
  * Licensed under the MIT License.
@@ -1390,7 +1390,7 @@
1390
1390
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1391
1391
  const SetUserData = "setUserData";
1392
1392
 
1393
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1393
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1394
1394
  /*
1395
1395
  * Copyright (c) Microsoft Corporation. All rights reserved.
1396
1396
  * Licensed under the MIT License.
@@ -1483,7 +1483,7 @@
1483
1483
  };
1484
1484
  };
1485
1485
 
1486
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1486
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1487
1487
 
1488
1488
  /*
1489
1489
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1594,7 +1594,7 @@
1594
1594
  },
1595
1595
  };
1596
1596
 
1597
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1597
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1598
1598
  /*
1599
1599
  * Copyright (c) Microsoft Corporation. All rights reserved.
1600
1600
  * Licensed under the MIT License.
@@ -1659,7 +1659,7 @@
1659
1659
  return cachedAtSec > nowSeconds();
1660
1660
  }
1661
1661
 
1662
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1662
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1663
1663
 
1664
1664
  /*
1665
1665
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1946,7 +1946,7 @@
1946
1946
  return [...attributeTokens].sort().join(" ");
1947
1947
  }
1948
1948
 
1949
- /*! @azure/msal-common v16.14.1 2026-09-23 */
1949
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
1950
1950
 
1951
1951
  /*
1952
1952
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2914,7 +2914,7 @@
2914
2914
  };
2915
2915
  }
2916
2916
 
2917
- /*! @azure/msal-common v16.14.1 2026-09-23 */
2917
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2918
2918
 
2919
2919
  /*
2920
2920
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2948,7 +2948,7 @@
2948
2948
  }
2949
2949
  }
2950
2950
 
2951
- /*! @azure/msal-common v16.14.1 2026-09-23 */
2951
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
2952
2952
 
2953
2953
  /*
2954
2954
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3144,7 +3144,7 @@
3144
3144
  }
3145
3145
  }
3146
3146
 
3147
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3147
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3148
3148
 
3149
3149
  /*
3150
3150
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3630,7 +3630,7 @@
3630
3630
  }
3631
3631
  }
3632
3632
 
3633
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3633
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3634
3634
 
3635
3635
  /*
3636
3636
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3752,7 +3752,7 @@
3752
3752
  }
3753
3753
  }
3754
3754
 
3755
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3755
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3756
3756
 
3757
3757
  /*
3758
3758
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3800,7 +3800,7 @@
3800
3800
  },
3801
3801
  };
3802
3802
 
3803
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3803
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3804
3804
 
3805
3805
  /*
3806
3806
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3823,7 +3823,7 @@
3823
3823
  },
3824
3824
  };
3825
3825
 
3826
- /*! @azure/msal-common v16.14.1 2026-09-23 */
3826
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
3827
3827
  /*
3828
3828
  * Copyright (c) Microsoft Corporation. All rights reserved.
3829
3829
  * Licensed under the MIT License.
@@ -4098,12 +4098,12 @@
4098
4098
  }
4099
4099
  }
4100
4100
 
4101
- /*! @azure/msal-common v16.14.1 2026-09-23 */
4101
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4102
4102
  /* eslint-disable header/header */
4103
4103
  const name$1 = "@azure/msal-common";
4104
- const version$1 = "16.14.1";
4104
+ const version$1 = "16.14.2";
4105
4105
 
4106
- /*! @azure/msal-common v16.14.1 2026-09-23 */
4106
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4107
4107
  /*
4108
4108
  * Copyright (c) Microsoft Corporation. All rights reserved.
4109
4109
  * Licensed under the MIT License.
@@ -4111,7 +4111,7 @@
4111
4111
  const cacheQuotaExceeded = "cache_quota_exceeded";
4112
4112
  const cacheErrorUnknown = "cache_error_unknown";
4113
4113
 
4114
- /*! @azure/msal-common v16.14.1 2026-09-23 */
4114
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4115
4115
 
4116
4116
  /*
4117
4117
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4149,7 +4149,7 @@
4149
4149
  }
4150
4150
  }
4151
4151
 
4152
- /*! @azure/msal-common v16.14.1 2026-09-23 */
4152
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
4153
4153
 
4154
4154
  /*
4155
4155
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5336,7 +5336,7 @@
5336
5336
  }
5337
5337
  }
5338
5338
 
5339
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5339
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5340
5340
  /*
5341
5341
  * Copyright (c) Microsoft Corporation. All rights reserved.
5342
5342
  * Licensed under the MIT License.
@@ -5350,7 +5350,7 @@
5350
5350
  const PerformanceEventStatus = {
5351
5351
  InProgress: 1};
5352
5352
 
5353
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5353
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5354
5354
 
5355
5355
  /*
5356
5356
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5408,7 +5408,7 @@
5408
5408
  }
5409
5409
  }
5410
5410
 
5411
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5411
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5412
5412
 
5413
5413
  /*
5414
5414
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5506,7 +5506,7 @@
5506
5506
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5507
5507
  }
5508
5508
 
5509
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5509
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5510
5510
  /*
5511
5511
  * Copyright (c) Microsoft Corporation. All rights reserved.
5512
5512
  * Licensed under the MIT License.
@@ -5533,7 +5533,7 @@
5533
5533
  }
5534
5534
  }
5535
5535
 
5536
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5536
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5537
5537
 
5538
5538
  /*
5539
5539
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5554,7 +5554,7 @@
5554
5554
  return new JoseHeaderError(code, correlationId);
5555
5555
  }
5556
5556
 
5557
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5557
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5558
5558
  /*
5559
5559
  * Copyright (c) Microsoft Corporation. All rights reserved.
5560
5560
  * Licensed under the MIT License.
@@ -5579,7 +5579,7 @@
5579
5579
  return Object.getPrototypeOf(value) === proto;
5580
5580
  }
5581
5581
 
5582
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5582
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5583
5583
  /*
5584
5584
  * Copyright (c) Microsoft Corporation. All rights reserved.
5585
5585
  * Licensed under the MIT License.
@@ -5589,7 +5589,7 @@
5589
5589
  const missingJwkError = "missing_jwk_error";
5590
5590
  const invalidJwkError = "invalid_jwk_error";
5591
5591
 
5592
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5592
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5593
5593
 
5594
5594
  /*
5595
5595
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5655,7 +5655,7 @@
5655
5655
  }
5656
5656
  }
5657
5657
 
5658
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5658
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5659
5659
 
5660
5660
  /*
5661
5661
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5756,7 +5756,7 @@
5756
5756
  }
5757
5757
  }
5758
5758
 
5759
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5759
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5760
5760
 
5761
5761
  /*
5762
5762
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5901,7 +5901,7 @@
5901
5901
  }
5902
5902
  }
5903
5903
 
5904
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5904
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5905
5905
  /*
5906
5906
  * Copyright (c) Microsoft Corporation. All rights reserved.
5907
5907
  * Licensed under the MIT License.
@@ -5952,7 +5952,7 @@
5952
5952
  */
5953
5953
  const interruptedUser = "interrupted_user";
5954
5954
 
5955
- /*! @azure/msal-common v16.14.1 2026-09-23 */
5955
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
5956
5956
 
5957
5957
  /*
5958
5958
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6019,7 +6019,7 @@
6019
6019
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
6020
6020
  }
6021
6021
 
6022
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6022
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6023
6023
 
6024
6024
  /*
6025
6025
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6038,7 +6038,7 @@
6038
6038
  }
6039
6039
  }
6040
6040
 
6041
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6041
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6042
6042
 
6043
6043
  /*
6044
6044
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6109,7 +6109,7 @@
6109
6109
  }
6110
6110
  }
6111
6111
 
6112
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6112
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6113
6113
 
6114
6114
  /*
6115
6115
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6537,7 +6537,7 @@
6537
6537
  return baseAccount;
6538
6538
  }
6539
6539
 
6540
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6540
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6541
6541
  /*
6542
6542
  * Copyright (c) Microsoft Corporation. All rights reserved.
6543
6543
  * Licensed under the MIT License.
@@ -6547,7 +6547,7 @@
6547
6547
  UPN: "UPN",
6548
6548
  };
6549
6549
 
6550
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6550
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6551
6551
  /*
6552
6552
  * Copyright (c) Microsoft Corporation. All rights reserved.
6553
6553
  * Licensed under the MIT License.
@@ -6566,7 +6566,7 @@
6566
6566
  }
6567
6567
  }
6568
6568
 
6569
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6569
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6570
6570
 
6571
6571
  /*
6572
6572
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6590,7 +6590,7 @@
6590
6590
  };
6591
6591
  }
6592
6592
 
6593
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6593
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6594
6594
 
6595
6595
  /*
6596
6596
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6676,7 +6676,7 @@
6676
6676
  }
6677
6677
  }
6678
6678
 
6679
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6679
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6680
6680
 
6681
6681
  /*
6682
6682
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6707,7 +6707,7 @@
6707
6707
  return new NetworkError(error, httpStatus, responseHeaders);
6708
6708
  }
6709
6709
 
6710
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6710
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6711
6711
 
6712
6712
  /*
6713
6713
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6840,7 +6840,7 @@
6840
6840
  return response;
6841
6841
  }
6842
6842
 
6843
- /*! @azure/msal-common v16.14.1 2026-09-23 */
6843
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
6844
6844
 
6845
6845
  /*
6846
6846
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7104,7 +7104,7 @@
7104
7104
  }
7105
7105
  }
7106
7106
 
7107
- /*! @azure/msal-common v16.14.1 2026-09-23 */
7107
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
7108
7108
 
7109
7109
  /*
7110
7110
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7331,7 +7331,7 @@
7331
7331
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7332
7332
  }
7333
7333
 
7334
- /*! @azure/msal-common v16.14.1 2026-09-23 */
7334
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
7335
7335
 
7336
7336
  /*
7337
7337
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7490,6 +7490,7 @@
7490
7490
  addRedirectUri(parameters, request.redirectUri);
7491
7491
  }
7492
7492
  addScopes(parameters, request.scopes, request.correlationId, true, this.config.authOptions.authority.options.OIDCOptions?.defaultScopes);
7493
+ addResource(parameters, request.resource);
7493
7494
  addGrantType(parameters, GrantType$1.REFRESH_TOKEN_GRANT);
7494
7495
  addClientInfo(parameters);
7495
7496
  addLibraryInfo(parameters, this.config.libraryInfo);
@@ -7565,7 +7566,7 @@
7565
7566
  }
7566
7567
  }
7567
7568
 
7568
- /*! @azure/msal-common v16.14.1 2026-09-23 */
7569
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
7569
7570
 
7570
7571
  /*
7571
7572
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7858,7 +7859,7 @@
7858
7859
  clearNativeBrokerErrorCode() { }
7859
7860
  }
7860
7861
 
7861
- /*! @azure/msal-common v16.14.1 2026-09-23 */
7862
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
7862
7863
 
7863
7864
  /*
7864
7865
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7985,7 +7986,7 @@
7985
7986
  }
7986
7987
  }
7987
7988
 
7988
- /*! @azure/msal-common v16.14.1 2026-09-23 */
7989
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
7989
7990
 
7990
7991
  /*
7991
7992
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8001,7 +8002,7 @@
8001
8002
  },
8002
8003
  };
8003
8004
 
8004
- /*! @azure/msal-common v16.14.1 2026-09-23 */
8005
+ /*! @azure/msal-common v16.14.2 2026-10-02 */
8005
8006
 
8006
8007
  /*
8007
8008
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8430,7 +8431,7 @@
8430
8431
 
8431
8432
  /* eslint-disable header/header */
8432
8433
  const name = "@azure/msal-browser";
8433
- const version = "5.23.0";
8434
+ const version = "5.24.0";
8434
8435
 
8435
8436
  /*
8436
8437
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9042,6 +9043,20 @@
9042
9043
  const HandleRedirectPromiseMeasurement = "handleRedirectPromise";
9043
9044
  const HandleNativeRedirectPromiseMeasurement = "handleNativeRedirectPromise";
9044
9045
  const NativeMessageHandlerHandshake = "nativeMessageHandlerHandshake";
9046
+ const NativeGenerateAuthResult = "nativeGenerateAuthResult";
9047
+ const PlatformAuthProviderDiscovery = "platformAuthProviderDiscovery";
9048
+ const PlatformAuthDOMCreateProvider = "platformAuthDOMCreateProvider";
9049
+ const PlatformAuthDOMGetSupportedContracts = "platformAuthDOMGetSupportedContracts";
9050
+ const PlatformAuthDOMInitializeRequest = "platformAuthDOMInitializeRequest";
9051
+ const PlatformAuthDOMGetToken = "platformAuthDOMGetToken";
9052
+ const PlatformAuthDOMValidateResponse = "platformAuthDOMValidateResponse";
9053
+ const PlatformAuthExtensionCreateProvider = "platformAuthExtensionCreateProvider";
9054
+ const PlatformAuthExtensionGetToken = "platformAuthExtensionGetToken";
9055
+ const PlatformAuthExtensionValidateResponse = "platformAuthExtensionValidateResponse";
9056
+ const PlatformAuthInteractionClientInitializeRequest = "platformAuthInteractionClientInitializeRequest";
9057
+ const PlatformAuthHandleNativeResponse = "platformAuthHandleNativeResponse";
9058
+ const PlatformAuthCacheAccount = "platformAuthCacheAccount";
9059
+ const PlatformAuthCacheNativeTokens = "platformAuthCacheNativeTokens";
9045
9060
  const RemoveHiddenIframe = "removeHiddenIframe";
9046
9061
  const ImportExistingCache = "importExistingCache";
9047
9062
  /**
@@ -18048,7 +18063,9 @@
18048
18063
  await invokeAsync(this.importExistingCache.bind(this), ImportExistingCache, this.logger, this.performanceClient, correlationId)(correlationId);
18049
18064
  // Register listener for cache updates in other tabs
18050
18065
  this.broadcast.addEventListener("message", (event) => {
18051
- this.updateCache(event, correlationId);
18066
+ this.updateCache(event, correlationId).catch(() => {
18067
+ this.logger.error("Failed to process cache update broadcast", correlationId);
18068
+ });
18052
18069
  });
18053
18070
  this.initialized = true;
18054
18071
  }
@@ -18110,19 +18127,20 @@
18110
18127
  this.broadcast.postMessage({
18111
18128
  key: key,
18112
18129
  value: value,
18113
- context: this.getContext(key),
18130
+ context: this.getBroadcastContext(key),
18114
18131
  });
18115
18132
  }
18116
18133
  removeItem(key) {
18117
- if (this.memoryStorage.containsKey(key)) {
18118
- this.memoryStorage.removeItem(key);
18134
+ const itemExists = this.containsKey(key) || this.memoryStorage.containsKey(key);
18135
+ window.localStorage.removeItem(key);
18136
+ this.memoryStorage.removeItem(key);
18137
+ if (itemExists) {
18119
18138
  this.broadcast.postMessage({
18120
18139
  key: key,
18121
18140
  value: null,
18122
- context: this.getContext(key),
18141
+ context: this.getBroadcastContext(key),
18123
18142
  });
18124
18143
  }
18125
- window.localStorage.removeItem(key);
18126
18144
  }
18127
18145
  getKeys() {
18128
18146
  return Object.keys(window.localStorage);
@@ -18239,29 +18257,73 @@
18239
18257
  await Promise.all(promiseArr);
18240
18258
  return importedArr;
18241
18259
  }
18242
- /**
18243
- * Gets encryption context for a given cache entry. This is clientId for app specific entries, empty string for shared entries
18244
- * @param key
18245
- * @returns
18246
- */
18247
18260
  getContext(key) {
18248
- let context = "";
18249
- if (key.includes(this.clientId)) {
18250
- context = this.clientId; // Used to bind encryption key to this appId
18261
+ return key.includes(this.clientId) ? this.clientId : "";
18262
+ }
18263
+ getBroadcastContext(key) {
18264
+ const normalizedKey = key.toLowerCase();
18265
+ const keySegments = normalizedKey.split(CACHE_KEY_SEPARATOR);
18266
+ if (keySegments.length > 1) {
18267
+ return keySegments[4] === this.clientId.toLowerCase()
18268
+ ? this.clientId
18269
+ : "";
18270
+ }
18271
+ const credentialType = this.getCredentialType(normalizedKey);
18272
+ if (credentialType) {
18273
+ const ownerPrefix = `-${credentialType}-${this.clientId.toLowerCase()}-`;
18274
+ return normalizedKey.includes(ownerPrefix) ? this.clientId : "";
18275
+ }
18276
+ return normalizedKey.includes(this.clientId.toLowerCase())
18277
+ ? this.clientId
18278
+ : "";
18279
+ }
18280
+ getCredentialType(key) {
18281
+ const normalizedKey = key.toLowerCase();
18282
+ const keySegments = normalizedKey.split(CACHE_KEY_SEPARATOR);
18283
+ const structuredCredentialType = keySegments[3];
18284
+ return Object.values(CredentialType)
18285
+ .map((type) => type.toLowerCase())
18286
+ .find((type) => structuredCredentialType === type ||
18287
+ normalizedKey.includes(`-${type}-`));
18288
+ }
18289
+ isFamilyRefreshToken(key, credentialType) {
18290
+ if (credentialType !==
18291
+ CredentialType.REFRESH_TOKEN.toLowerCase()) {
18292
+ return false;
18251
18293
  }
18252
- return context;
18294
+ const normalizedKey = key.toLowerCase();
18295
+ const keySegments = normalizedKey.split(CACHE_KEY_SEPARATOR);
18296
+ return keySegments.length > 1
18297
+ ? keySegments[4] === THE_FAMILY_ID
18298
+ : normalizedKey.includes(`-${credentialType}-${THE_FAMILY_ID}-`);
18299
+ }
18300
+ isContextValid(key, context) {
18301
+ const credentialType = this.getCredentialType(key);
18302
+ const isFamilyRefreshToken = credentialType && this.isFamilyRefreshToken(key, credentialType);
18303
+ const isClientBoundCredential = !!credentialType && !isFamilyRefreshToken;
18304
+ return ((!isClientBoundCredential || !!context) &&
18305
+ context === this.getBroadcastContext(key));
18253
18306
  }
18254
- updateCache(event, correlationId) {
18307
+ async updateCache(event, correlationId) {
18255
18308
  this.logger.trace("Updating internal cache from broadcast event", correlationId);
18256
18309
  const perfMeasurement = this.performanceClient.startMeasurement(LocalStorageUpdated);
18257
18310
  perfMeasurement.add({ isBackground: true });
18258
- const { key, value, context } = event.data;
18259
- if (!key) {
18311
+ const key = event.data?.key;
18312
+ const context = event.data?.context;
18313
+ if (typeof key !== "string" || !key) {
18260
18314
  this.logger.error("Broadcast event missing key", correlationId);
18261
18315
  perfMeasurement.end({ success: false, errorCode: "noKey" });
18262
18316
  return;
18263
18317
  }
18264
- if (context && context !== this.clientId) {
18318
+ if (typeof context !== "string") {
18319
+ this.logger.error("Broadcast event missing cache context", correlationId);
18320
+ perfMeasurement.end({
18321
+ success: false,
18322
+ errorCode: "noContext",
18323
+ });
18324
+ return;
18325
+ }
18326
+ if (!this.isContextValid(key, context)) {
18265
18327
  this.logger.trace(`Ignoring broadcast event from clientId: '${context}'`, correlationId);
18266
18328
  /*
18267
18329
  * Discarded rather than ended: this is expected routing, not a failure.
@@ -18279,15 +18341,36 @@
18279
18341
  perfMeasurement.discard();
18280
18342
  return;
18281
18343
  }
18282
- if (!value) {
18283
- this.memoryStorage.removeItem(key);
18284
- this.logger.verbose("Removed item from internal cache", correlationId);
18344
+ const persistedValue = this.getItem(key);
18345
+ try {
18346
+ const value = await this.getItemFromEncryptedCache(key, correlationId);
18347
+ // A newer write or removal occurred while this entry was decrypted.
18348
+ if (this.getItem(key) !== persistedValue) {
18349
+ perfMeasurement.discard();
18350
+ return;
18351
+ }
18352
+ if (!value) {
18353
+ this.memoryStorage.removeItem(key);
18354
+ this.logger.verbose("Removed item from internal cache", correlationId);
18355
+ }
18356
+ else {
18357
+ this.memoryStorage.setItem(key, value);
18358
+ this.logger.verbose("Updated item in internal cache", correlationId);
18359
+ }
18360
+ perfMeasurement.end({ success: true });
18285
18361
  }
18286
- else {
18287
- this.memoryStorage.setItem(key, value);
18288
- this.logger.verbose("Updated item in internal cache", correlationId);
18362
+ catch {
18363
+ if (this.getItem(key) !== persistedValue) {
18364
+ perfMeasurement.discard();
18365
+ return;
18366
+ }
18367
+ this.memoryStorage.removeItem(key);
18368
+ this.logger.error("Failed to update internal cache from persistent storage", correlationId);
18369
+ perfMeasurement.end({
18370
+ success: false,
18371
+ errorCode: "cacheUpdateFailed",
18372
+ });
18289
18373
  }
18290
- perfMeasurement.end({ success: true });
18291
18374
  }
18292
18375
  }
18293
18376
 
@@ -20457,7 +20540,7 @@
20457
20540
  // initialize native request (statically builds the request; does not contact the broker)
20458
20541
  let nativeRequest;
20459
20542
  try {
20460
- nativeRequest = await this.initializePlatformRequest(request);
20543
+ nativeRequest = await invokeAsync(this.initializePlatformRequest.bind(this), PlatformAuthInteractionClientInitializeRequest, this.logger, this.performanceClient, this.correlationId)(request);
20461
20544
  }
20462
20545
  catch (e) {
20463
20546
  /*
@@ -20504,7 +20587,7 @@
20504
20587
  // dispatch the request to the broker
20505
20588
  try {
20506
20589
  const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
20507
- const result = await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
20590
+ const result = await invokeAsync(this.handleNativeResponse.bind(this), PlatformAuthHandleNativeResponse, this.logger, this.performanceClient, this.correlationId)(validatedResponse, nativeRequest, reqTimestamp, request.storeInCache);
20508
20591
  nativeATMeasurement.end({
20509
20592
  success: true,
20510
20593
  requestId: result.requestId,
@@ -20607,7 +20690,7 @@
20607
20690
  */
20608
20691
  async acquireTokenRedirect(request, rootMeasurement, options) {
20609
20692
  this.logger.trace("NativeInteractionClient - acquireTokenRedirect called.", this.correlationId);
20610
- const nativeRequest = await this.initializePlatformRequest(request);
20693
+ const nativeRequest = await invokeAsync(this.initializePlatformRequest.bind(this), PlatformAuthInteractionClientInitializeRequest, this.logger, this.performanceClient, this.correlationId)(request);
20611
20694
  const navigateToLoginRequestUrl = options?.navigateToLoginRequestUrl ?? true;
20612
20695
  try {
20613
20696
  await this.platformAuthProvider.sendMessage(nativeRequest);
@@ -20659,7 +20742,9 @@
20659
20742
  const cachedRequest = this.browserStorage.getCachedNativeRequest();
20660
20743
  if (!cachedRequest) {
20661
20744
  this.logger.verbose("NativeInteractionClient - handleRedirectPromise called but there is no cached request, returning null.", this.correlationId);
20662
- this.performanceClient?.addFields({ errorCode: "no_cached_request" }, this.correlationId);
20745
+ this.performanceClient?.addFields({
20746
+ errorCode: "no_cached_request",
20747
+ }, this.correlationId);
20663
20748
  return null;
20664
20749
  }
20665
20750
  /*
@@ -20675,7 +20760,7 @@
20675
20760
  try {
20676
20761
  this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.", this.correlationId);
20677
20762
  const response = await this.platformAuthProvider.sendMessage(request);
20678
- const authResult = await this.handleNativeResponse(response, request, reqTimestamp, storeInCache);
20763
+ const authResult = await invokeAsync(this.handleNativeResponse.bind(this), PlatformAuthHandleNativeResponse, this.logger, this.performanceClient, this.correlationId)(response, request, reqTimestamp, storeInCache);
20679
20764
  const serverTelemetryManager = initializeServerTelemetryManager(this.apiId, this.config.auth.clientId, this.correlationId, this.browserStorage, this.logger, undefined, this.config.system.serverTelemetryEnabled);
20680
20765
  serverTelemetryManager.clearNativeBrokerErrorCode();
20681
20766
  return authResult;
@@ -20725,10 +20810,10 @@
20725
20810
  // Ensure expires_in is in number format
20726
20811
  response.expires_in = Number(response.expires_in);
20727
20812
  // generate authenticationResult
20728
- const result = await this.generateAuthenticationResult(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
20813
+ const result = await invokeAsync(this.generateAuthenticationResult.bind(this), NativeGenerateAuthResult, this.logger, this.performanceClient, this.correlationId)(response, request, idTokenClaims, baseAccount, authority.canonicalAuthority, reqTimestamp);
20729
20814
  // cache accounts and tokens in the appropriate storage
20730
- await this.cacheAccount(baseAccount, isKmsi(idTokenClaims));
20731
- await this.cacheNativeTokens(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
20815
+ await invokeAsync(this.cacheAccount.bind(this), PlatformAuthCacheAccount, this.logger, this.performanceClient, this.correlationId)(baseAccount, isKmsi(idTokenClaims));
20816
+ await invokeAsync(this.cacheNativeTokens.bind(this), PlatformAuthCacheNativeTokens, this.logger, this.performanceClient, this.correlationId)(response, request, homeAccountIdentifier, idTokenClaims, result.tenantId, reqTimestamp, authority.getPreferredCache(), // environment
20732
20817
  storeInCache);
20733
20818
  return result;
20734
20819
  }
@@ -20980,8 +21065,7 @@
20980
21065
  * attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
20981
21066
  */
20982
21067
  const { scopes, claims, extraParametersNoCache, dpopNonce } = request;
20983
- const scopeSet = new ScopeSet(scopes || [], this.correlationId);
20984
- scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);
21068
+ const scopeSet = new ScopeSet([...(scopes || []), ...OIDC_DEFAULT_SCOPES], this.correlationId);
20985
21069
  const mergedClaims = buildMergedClaims(claims, configClaims?.length ? configClaims : undefined);
20986
21070
  const hasAttributeTokens = !!request.attributeTokens?.length;
20987
21071
  this.performanceClient?.addFields({
@@ -21820,7 +21904,7 @@
21820
21904
  * Licensed under the MIT License.
21821
21905
  */
21822
21906
  class PlatformAuthExtensionHandler {
21823
- constructor(logger, handshakeTimeoutMs, performanceClient, extensionId) {
21907
+ constructor(logger, handshakeTimeoutMs, performanceClient, extensionId, correlationId) {
21824
21908
  this.logger = logger;
21825
21909
  this.handshakeTimeoutMs = handshakeTimeoutMs;
21826
21910
  this.extensionId = extensionId;
@@ -21829,7 +21913,8 @@
21829
21913
  this.messageChannel = new MessageChannel();
21830
21914
  this.windowListener = this.onWindowMessage.bind(this); // Window event callback doesn't have access to 'this' unless it's bound
21831
21915
  this.performanceClient = performanceClient;
21832
- this.handshakeEvent = this.performanceClient.startMeasurement(NativeMessageHandlerHandshake);
21916
+ this.correlationId = correlationId || createNewGuid();
21917
+ this.handshakeEvent = this.performanceClient.startMeasurement(NativeMessageHandlerHandshake, this.correlationId);
21833
21918
  this.platformAuthType =
21834
21919
  PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER;
21835
21920
  }
@@ -21838,29 +21923,51 @@
21838
21923
  * @param request
21839
21924
  */
21840
21925
  async sendMessage(request) {
21841
- this.logger.trace(`'${this.platformAuthType}' - sendMessage called.`, request.correlationId);
21842
- // fall back to native calls
21843
- const extensionRequest = { ...request };
21844
- delete extensionRequest.resourceRequestMethod;
21845
- delete extensionRequest.resourceRequestUri;
21846
- const messageBody = {
21847
- method: NativeExtensionMethod.GetToken,
21848
- request: extensionRequest,
21849
- };
21850
- const req = {
21851
- channel: PlatformAuthConstants.CHANNEL_ID,
21852
- extensionId: this.extensionId,
21853
- responseId: createNewGuid(),
21854
- body: messageBody,
21855
- };
21856
- this.logger.trace(`'${this.platformAuthType}' - Sending request to browser extension`, request.correlationId);
21857
- this.logger.tracePii(`'${this.platformAuthType}' - Sending request to browser extension: '${JSON.stringify(req)}'`, request.correlationId);
21858
- this.messageChannel.port1.postMessage(req);
21859
- const response = await new Promise((resolve, reject) => {
21860
- this.resolvers.set(req.responseId, { resolve, reject });
21926
+ const correlationId = this.getCorrelationId(request.correlationId);
21927
+ const sendMessageMeasurement = this.performanceClient.startMeasurement(PlatformAuthExtensionGetToken, correlationId);
21928
+ sendMessageMeasurement.add({
21929
+ platformAuthProviderType: this.platformAuthType,
21861
21930
  });
21862
- const validatedResponse = this.validatePlatformBrokerResponse(response);
21863
- return validatedResponse;
21931
+ this.logger.trace(`'${this.platformAuthType}' - sendMessage called.`, correlationId);
21932
+ try {
21933
+ // fall back to native calls
21934
+ const extensionRequest = { ...request };
21935
+ delete extensionRequest.resourceRequestMethod;
21936
+ delete extensionRequest.resourceRequestUri;
21937
+ const messageBody = {
21938
+ method: NativeExtensionMethod.GetToken,
21939
+ request: extensionRequest,
21940
+ };
21941
+ const req = {
21942
+ channel: PlatformAuthConstants.CHANNEL_ID,
21943
+ extensionId: this.extensionId,
21944
+ responseId: createNewGuid(),
21945
+ body: messageBody,
21946
+ };
21947
+ this.logger.trace(`'${this.platformAuthType}' - Sending request to browser extension`, correlationId);
21948
+ this.logger.tracePii(`'${this.platformAuthType}' - Sending request to browser extension: '${JSON.stringify(req)}'`, correlationId);
21949
+ this.messageChannel.port1.postMessage(req);
21950
+ const response = await new Promise((resolve, reject) => {
21951
+ this.resolvers.set(req.responseId, {
21952
+ resolve,
21953
+ reject,
21954
+ correlationId,
21955
+ });
21956
+ });
21957
+ const validatedResponse = this.validatePlatformBrokerResponse(response, correlationId);
21958
+ sendMessageMeasurement.end({
21959
+ success: true,
21960
+ platformAuthProviderType: this.platformAuthType,
21961
+ });
21962
+ return validatedResponse;
21963
+ }
21964
+ catch (e) {
21965
+ sendMessageMeasurement.end({
21966
+ success: false,
21967
+ platformAuthProviderType: this.platformAuthType,
21968
+ }, e);
21969
+ throw e;
21970
+ }
21864
21971
  }
21865
21972
  /**
21866
21973
  * Returns an instance of the MessageHandler that has successfully established a connection with an extension
@@ -21871,23 +21978,51 @@
21871
21978
  */
21872
21979
  static async createProvider(logger, handshakeTimeoutMs, performanceClient, correlationId) {
21873
21980
  logger.trace("PlatformAuthExtensionHandler - createProvider called.", correlationId);
21981
+ const createProviderMeasurement = performanceClient.startMeasurement(PlatformAuthExtensionCreateProvider, correlationId);
21874
21982
  try {
21875
- const preferredProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient, PlatformAuthConstants.PREFERRED_EXTENSION_ID);
21876
- await preferredProvider.sendHandshakeRequest(correlationId);
21983
+ const preferredProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient, PlatformAuthConstants.PREFERRED_EXTENSION_ID, correlationId);
21984
+ await preferredProvider.sendHandshakeRequest();
21985
+ createProviderMeasurement.add({
21986
+ platformAuthProviderAvailable: true,
21987
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
21988
+ });
21989
+ createProviderMeasurement.end({
21990
+ platformAuthProviderAvailable: true,
21991
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
21992
+ });
21877
21993
  return preferredProvider;
21878
21994
  }
21879
21995
  catch (e) {
21880
21996
  // If preferred extension fails for whatever reason, fallback to using any installed extension
21881
- const backupProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient);
21882
- await backupProvider.sendHandshakeRequest(correlationId);
21883
- return backupProvider;
21997
+ try {
21998
+ const backupProvider = new PlatformAuthExtensionHandler(logger, handshakeTimeoutMs, performanceClient, undefined, correlationId);
21999
+ await backupProvider.sendHandshakeRequest();
22000
+ createProviderMeasurement.add({
22001
+ platformAuthProviderAvailable: true,
22002
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
22003
+ });
22004
+ createProviderMeasurement.end({
22005
+ platformAuthProviderAvailable: true,
22006
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
22007
+ });
22008
+ return backupProvider;
22009
+ }
22010
+ catch (backupError) {
22011
+ createProviderMeasurement.add({
22012
+ platformAuthProviderAvailable: false,
22013
+ });
22014
+ createProviderMeasurement.end({
22015
+ platformAuthProviderAvailable: false,
22016
+ }, backupError);
22017
+ throw backupError;
22018
+ }
21884
22019
  }
21885
22020
  }
21886
22021
  /**
21887
22022
  * Send handshake request helper.
21888
22023
  */
21889
- async sendHandshakeRequest(correlationId) {
21890
- this.logger.trace(`'${this.platformAuthType}' - sendHandshakeRequest called.`, correlationId);
22024
+ async sendHandshakeRequest() {
22025
+ this.logger.trace(`'${this.platformAuthType}' - sendHandshakeRequest called.`, this.correlationId);
21891
22026
  // Register this event listener before sending handshake
21892
22027
  window.addEventListener("message", this.windowListener, false); // false is important, because content script message processing should work first
21893
22028
  const req = {
@@ -21901,13 +22036,18 @@
21901
22036
  this.handshakeEvent.add({
21902
22037
  extensionId: this.extensionId,
21903
22038
  extensionHandshakeTimeoutMs: this.handshakeTimeoutMs,
22039
+ platformAuthRequestCorrelationId: this.correlationId,
21904
22040
  });
21905
22041
  this.messageChannel.port1.onmessage = (event) => {
21906
22042
  this.onChannelMessage(event);
21907
22043
  };
21908
22044
  window.postMessage(req, window.origin, [this.messageChannel.port2]);
21909
22045
  return new Promise((resolve, reject) => {
21910
- this.handshakeResolvers.set(req.responseId, { resolve, reject });
22046
+ this.handshakeResolvers.set(req.responseId, {
22047
+ resolve,
22048
+ reject,
22049
+ correlationId: this.correlationId,
22050
+ });
21911
22051
  this.timeoutId = window.setTimeout(() => {
21912
22052
  /*
21913
22053
  * Throw an error if neither HandshakeResponse nor original Handshake request are received in a reasonable timeframe.
@@ -21916,11 +22056,14 @@
21916
22056
  window.removeEventListener("message", this.windowListener, false);
21917
22057
  this.messageChannel.port1.close();
21918
22058
  this.messageChannel.port2.close();
22059
+ this.handshakeEvent.add({
22060
+ extensionHandshakeTimedOut: true,
22061
+ });
21919
22062
  this.handshakeEvent.end({
21920
22063
  extensionHandshakeTimedOut: true,
21921
22064
  success: false,
21922
22065
  });
21923
- reject(createBrowserAuthError(nativeHandshakeTimeout, ""));
22066
+ reject(createBrowserAuthError(nativeHandshakeTimeout, this.correlationId));
21924
22067
  this.handshakeResolvers.delete(req.responseId);
21925
22068
  }, this.handshakeTimeoutMs); // Use a reasonable timeout in milliseconds here
21926
22069
  });
@@ -21930,7 +22073,7 @@
21930
22073
  * @param event
21931
22074
  */
21932
22075
  onWindowMessage(event) {
21933
- const correlationId = createGuid();
22076
+ let correlationId = createGuid();
21934
22077
  this.logger.trace(`'${this.platformAuthType}' - onWindowMessage called`, correlationId);
21935
22078
  // We only accept messages from ourselves
21936
22079
  if (event.source !== window) {
@@ -21954,6 +22097,7 @@
21954
22097
  this.logger.trace(`'${this.platformAuthType}'.onWindowMessage - resolver can't be found for request '${request.responseId}'`, correlationId);
21955
22098
  return;
21956
22099
  }
22100
+ correlationId = handshakeResolver.correlationId;
21957
22101
  // If we receive this message back it means no extension intercepted the request, meaning no extension supporting handshake protocol is installed
21958
22102
  this.logger.verbose(request.extensionId
21959
22103
  ? `Extension with id: ${request.extensionId} not installed`
@@ -21962,11 +22106,15 @@
21962
22106
  this.messageChannel.port1.close();
21963
22107
  this.messageChannel.port2.close();
21964
22108
  window.removeEventListener("message", this.windowListener, false);
22109
+ this.handshakeEvent.add({
22110
+ extensionInstalled: false,
22111
+ });
21965
22112
  this.handshakeEvent.end({
21966
22113
  success: false,
21967
22114
  extensionInstalled: false,
21968
22115
  });
21969
- handshakeResolver.reject(createBrowserAuthError(nativeExtensionNotInstalled, ""));
22116
+ handshakeResolver.reject(createBrowserAuthError(nativeExtensionNotInstalled, correlationId));
22117
+ this.handshakeResolvers.delete(request.responseId);
21970
22118
  }
21971
22119
  }
21972
22120
  /**
@@ -21974,36 +22122,47 @@
21974
22122
  * @param event
21975
22123
  */
21976
22124
  onChannelMessage(event) {
21977
- const correlationId = createGuid();
21978
- this.logger.trace(`'${this.platformAuthType}' - onChannelMessage called.`, correlationId);
21979
22125
  const request = event.data;
21980
- const resolver = this.resolvers.get(request.responseId);
21981
- const handshakeResolver = this.handshakeResolvers.get(request.responseId);
22126
+ const responseId = request?.responseId;
22127
+ const resolver = responseId
22128
+ ? this.resolvers.get(responseId)
22129
+ : undefined;
22130
+ const handshakeResolver = responseId
22131
+ ? this.handshakeResolvers.get(responseId)
22132
+ : undefined;
22133
+ const correlationId = resolver?.correlationId ||
22134
+ handshakeResolver?.correlationId ||
22135
+ createGuid();
22136
+ this.logger.trace(`'${this.platformAuthType}' - onChannelMessage called.`, correlationId);
21982
22137
  try {
21983
22138
  const method = request.body.method;
21984
22139
  if (method === NativeExtensionMethod.Response) {
21985
22140
  if (!resolver) {
21986
22141
  return;
21987
22142
  }
21988
- const response = request.body.response;
21989
- this.logger.trace(`'${this.platformAuthType}' - Received response from browser extension`, correlationId);
21990
- this.logger.tracePii(`'${this.platformAuthType}' - Received response from browser extension: '${JSON.stringify(response)}'`, correlationId);
21991
- if (response.status !== "Success") {
21992
- resolver.reject(createNativeAuthError(response.code, correlationId, response.description, response.ext));
21993
- }
21994
- else if (response.result) {
21995
- if (response.result["code"] &&
21996
- response.result["description"]) {
21997
- resolver.reject(createNativeAuthError(response.result["code"], correlationId, response.result["description"], response.result["ext"]));
22143
+ try {
22144
+ const response = request.body.response;
22145
+ this.logger.trace(`'${this.platformAuthType}' - Received response from browser extension`, correlationId);
22146
+ this.logger.tracePii(`'${this.platformAuthType}' - Received response from browser extension: '${JSON.stringify(response)}'`, correlationId);
22147
+ if (response.status !== "Success") {
22148
+ resolver.reject(createNativeAuthError(response.code, correlationId, response.description, response.ext));
22149
+ }
22150
+ else if (response.result) {
22151
+ if (response.result["code"] &&
22152
+ response.result["description"]) {
22153
+ resolver.reject(createNativeAuthError(response.result["code"], correlationId, response.result["description"], response.result["ext"]));
22154
+ }
22155
+ else {
22156
+ resolver.resolve(response.result);
22157
+ }
21998
22158
  }
21999
22159
  else {
22000
- resolver.resolve(response.result);
22160
+ throw createAuthError(unexpectedError, correlationId, "Event does not contain result.");
22001
22161
  }
22002
22162
  }
22003
- else {
22004
- throw createAuthError(unexpectedError, correlationId, "Event does not contain result.");
22163
+ finally {
22164
+ this.resolvers.delete(request.responseId);
22005
22165
  }
22006
- this.resolvers.delete(request.responseId);
22007
22166
  }
22008
22167
  else if (method === NativeExtensionMethod.HandshakeResponse) {
22009
22168
  if (!handshakeResolver) {
@@ -22013,25 +22172,46 @@
22013
22172
  clearTimeout(this.timeoutId); // Clear setTimeout
22014
22173
  window.removeEventListener("message", this.windowListener, false); // Remove 'No extension' listener
22015
22174
  this.extensionId = request.extensionId;
22016
- this.extensionVersion = request.body.version;
22175
+ this.extensionVersion = request.body.version?.toString();
22017
22176
  this.logger.verbose(`'${this.platformAuthType}' - Received HandshakeResponse from extension: '${this.extensionId}'`, correlationId);
22177
+ this.handshakeEvent.add({
22178
+ extensionId: this.extensionId,
22179
+ extensionVersion: this.extensionVersion,
22180
+ extensionInstalled: true,
22181
+ });
22018
22182
  this.handshakeEvent.end({
22183
+ extensionId: this.extensionId,
22184
+ extensionVersion: this.extensionVersion,
22019
22185
  extensionInstalled: true,
22020
22186
  success: true,
22021
22187
  });
22022
22188
  handshakeResolver.resolve();
22023
22189
  this.handshakeResolvers.delete(request.responseId);
22024
22190
  }
22025
- // Do nothing if method is not Response or HandshakeResponse
22191
+ else if (resolver) {
22192
+ this.resolvers.delete(request.responseId);
22193
+ resolver.reject(createAuthError(unexpectedError, correlationId, "Extension response contains an unexpected method."));
22194
+ }
22026
22195
  }
22027
22196
  catch (err) {
22028
22197
  this.logger.error("Error parsing response from WAM Extension", correlationId);
22029
22198
  this.logger.errorPii(`Error parsing response from WAM Extension: '${err}'`, correlationId);
22030
22199
  this.logger.errorPii(`Unable to parse '${event}'`, correlationId);
22031
22200
  if (resolver) {
22032
- resolver.reject(err);
22201
+ this.resolvers.delete(responseId);
22202
+ resolver.reject(err instanceof AuthError
22203
+ ? err
22204
+ : createAuthError(unexpectedError, correlationId, "Unable to parse extension response."));
22033
22205
  }
22034
22206
  else if (handshakeResolver) {
22207
+ clearTimeout(this.timeoutId);
22208
+ window.removeEventListener("message", this.windowListener, false);
22209
+ this.messageChannel.port1.close();
22210
+ this.messageChannel.port2.close();
22211
+ this.handshakeEvent.end({
22212
+ success: false,
22213
+ });
22214
+ this.handshakeResolvers.delete(responseId);
22035
22215
  handshakeResolver.reject(err);
22036
22216
  }
22037
22217
  }
@@ -22040,19 +22220,34 @@
22040
22220
  * Validates native platform response before processing
22041
22221
  * @param response
22042
22222
  */
22043
- validatePlatformBrokerResponse(response) {
22044
- if (response.hasOwnProperty("access_token") &&
22045
- response.hasOwnProperty("id_token") &&
22046
- response.hasOwnProperty("client_info") &&
22047
- response.hasOwnProperty("account") &&
22048
- response.hasOwnProperty("scope") &&
22049
- response.hasOwnProperty("expires_in")) {
22223
+ validatePlatformBrokerResponse(response, correlationId) {
22224
+ const responseCorrelationId = this.getCorrelationId(correlationId);
22225
+ const validationMeasurement = this.performanceClient.startMeasurement(PlatformAuthExtensionValidateResponse, responseCorrelationId);
22226
+ if (response &&
22227
+ Object.prototype.hasOwnProperty.call(response, "access_token") &&
22228
+ Object.prototype.hasOwnProperty.call(response, "id_token") &&
22229
+ Object.prototype.hasOwnProperty.call(response, "client_info") &&
22230
+ Object.prototype.hasOwnProperty.call(response, "account") &&
22231
+ Object.prototype.hasOwnProperty.call(response, "scope") &&
22232
+ Object.prototype.hasOwnProperty.call(response, "expires_in")) {
22233
+ validationMeasurement.end({
22234
+ success: true,
22235
+ platformAuthProviderType: this.platformAuthType,
22236
+ });
22050
22237
  return response;
22051
22238
  }
22052
22239
  else {
22053
- throw createAuthError(unexpectedError, "", "Response missing expected properties.");
22240
+ const error = createAuthError(unexpectedError, responseCorrelationId, "Response missing expected properties.");
22241
+ validationMeasurement.end({
22242
+ success: false,
22243
+ platformAuthProviderType: this.platformAuthType,
22244
+ }, error);
22245
+ throw error;
22054
22246
  }
22055
22247
  }
22248
+ getCorrelationId(correlationId) {
22249
+ return correlationId || this.correlationId;
22250
+ }
22056
22251
  /**
22057
22252
  * Returns the Id for the browser extension this handler is communicating with
22058
22253
  * @returns
@@ -22090,17 +22285,49 @@
22090
22285
  }
22091
22286
  static async createProvider(logger, performanceClient, correlationId) {
22092
22287
  logger.trace("PlatformAuthDOMHandler: createProvider called", correlationId);
22093
- // @ts-ignore
22094
- if (window.navigator?.platformAuthentication) {
22095
- const supportedContracts =
22096
- // @ts-ignore
22097
- await window.navigator.platformAuthentication.getSupportedContracts(PlatformAuthConstants.MICROSOFT_ENTRA_BROKERID);
22098
- if (supportedContracts?.includes(PlatformAuthConstants.PLATFORM_DOM_APIS)) {
22288
+ const createProviderMeasurement = performanceClient.startMeasurement(PlatformAuthDOMCreateProvider, correlationId);
22289
+ try {
22290
+ const platformAuthentication = window.navigator.platformAuthentication;
22291
+ if (!platformAuthentication) {
22292
+ createProviderMeasurement.add({
22293
+ platformAuthProviderAvailable: false,
22294
+ });
22295
+ createProviderMeasurement.end({
22296
+ platformAuthProviderAvailable: false,
22297
+ });
22298
+ return undefined;
22299
+ }
22300
+ const supportedContracts = (await invokeAsync(platformAuthentication.getSupportedContracts.bind(platformAuthentication), PlatformAuthDOMGetSupportedContracts, logger, performanceClient, correlationId)(PlatformAuthConstants.MICROSOFT_ENTRA_BROKERID));
22301
+ const contractSupported = supportedContracts?.includes(PlatformAuthConstants.PLATFORM_DOM_APIS);
22302
+ if (contractSupported) {
22099
22303
  logger.trace("Platform auth api available in DOM", correlationId);
22304
+ createProviderMeasurement.add({
22305
+ platformAuthProviderAvailable: true,
22306
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_DOM_PROVIDER,
22307
+ });
22308
+ createProviderMeasurement.end({
22309
+ platformAuthProviderAvailable: true,
22310
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_DOM_PROVIDER,
22311
+ });
22100
22312
  return new PlatformAuthDOMHandler(logger, performanceClient, correlationId);
22101
22313
  }
22314
+ createProviderMeasurement.add({
22315
+ platformAuthProviderAvailable: false,
22316
+ });
22317
+ createProviderMeasurement.end({
22318
+ platformAuthProviderAvailable: false,
22319
+ });
22320
+ return undefined;
22321
+ }
22322
+ catch (e) {
22323
+ createProviderMeasurement.add({
22324
+ platformAuthProviderAvailable: false,
22325
+ });
22326
+ createProviderMeasurement.end({
22327
+ platformAuthProviderAvailable: false,
22328
+ }, e);
22329
+ throw e;
22102
22330
  }
22103
- return undefined;
22104
22331
  }
22105
22332
  /**
22106
22333
  * Returns the Id for the broker extension this handler is communicating with
@@ -22121,31 +22348,46 @@
22121
22348
  * @returns
22122
22349
  */
22123
22350
  async sendMessage(request) {
22124
- this.logger.trace(`'${this.platformAuthType}' - Sending request to browser DOM API`, request.correlationId);
22351
+ const correlationId = this.getCorrelationId(request.correlationId);
22352
+ const sendMessageMeasurement = this.performanceClient.startMeasurement(PlatformAuthDOMGetToken, correlationId);
22353
+ sendMessageMeasurement.add({
22354
+ platformAuthProviderType: this.platformAuthType,
22355
+ });
22356
+ this.logger.trace(`'${this.platformAuthType}' - Sending request to browser DOM API`, correlationId);
22125
22357
  try {
22126
- const platformDOMRequest = this.initializePlatformDOMRequest(request);
22358
+ const platformDOMRequest = invoke(this.initializePlatformDOMRequest.bind(this), PlatformAuthDOMInitializeRequest, this.logger, this.performanceClient, correlationId)(request);
22127
22359
  const response =
22128
22360
  // @ts-ignore
22129
22361
  await window.navigator.platformAuthentication.executeGetToken(platformDOMRequest);
22130
- return this.validatePlatformBrokerResponse(response, request.correlationId);
22362
+ const validatedResponse = this.validatePlatformBrokerResponse(response, correlationId);
22363
+ sendMessageMeasurement.end({
22364
+ success: true,
22365
+ platformAuthProviderType: this.platformAuthType,
22366
+ });
22367
+ return validatedResponse;
22131
22368
  }
22132
22369
  catch (e) {
22133
- this.logger.error(`'${this.platformAuthType}' - executeGetToken DOM API error`, request.correlationId);
22370
+ this.logger.error(`'${this.platformAuthType}' - executeGetToken DOM API error`, correlationId);
22371
+ sendMessageMeasurement.end({
22372
+ success: false,
22373
+ platformAuthProviderType: this.platformAuthType,
22374
+ }, e);
22134
22375
  throw e;
22135
22376
  }
22136
22377
  }
22137
22378
  initializePlatformDOMRequest(request) {
22138
- this.logger.trace(`'${this.platformAuthType}' - initializeNativeDOMRequest called`, request.correlationId);
22139
22379
  const { accountId, clientId, authority, scope, redirectUri, correlationId, state, preferBinding, enclave, reqCnf, extraParametersNoCache, extraParameters, ...remainingProperties } = request;
22380
+ const requestCorrelationId = this.getCorrelationId(correlationId);
22381
+ this.logger.trace(`'${this.platformAuthType}' - initializeNativeDOMRequest called`, requestCorrelationId);
22140
22382
  delete remainingProperties.resourceRequestMethod;
22141
22383
  delete remainingProperties.resourceRequestUri;
22142
- const validExtraParameters = this.getDOMExtraParams(remainingProperties, correlationId);
22384
+ const validExtraParameters = this.getDOMExtraParams(remainingProperties, requestCorrelationId);
22143
22385
  const platformDOMRequest = {
22144
22386
  accountId: accountId,
22145
22387
  brokerId: this.getExtensionId(),
22146
22388
  authority: authority,
22147
22389
  clientId: clientId,
22148
- correlationId: correlationId || this.correlationId,
22390
+ correlationId: requestCorrelationId,
22149
22391
  extraParameters: {
22150
22392
  ...extraParameters,
22151
22393
  ...validExtraParameters,
@@ -22162,32 +22404,68 @@
22162
22404
  return platformDOMRequest;
22163
22405
  }
22164
22406
  validatePlatformBrokerResponse(response, correlationId) {
22165
- if (response.hasOwnProperty("isSuccess")) {
22166
- if (response.hasOwnProperty("accessToken") &&
22167
- response.hasOwnProperty("idToken") &&
22168
- response.hasOwnProperty("clientInfo") &&
22169
- response.hasOwnProperty("account") &&
22170
- response.hasOwnProperty("scopes") &&
22171
- response.hasOwnProperty("expiresIn")) {
22407
+ const validationMeasurement = this.performanceClient.startMeasurement(PlatformAuthDOMValidateResponse, correlationId);
22408
+ const requiredKeys = [
22409
+ "accessToken",
22410
+ "idToken",
22411
+ "clientInfo",
22412
+ "account",
22413
+ "scopes",
22414
+ "expiresIn",
22415
+ ];
22416
+ const isValid = response &&
22417
+ requiredKeys.every((key) => Object.prototype.hasOwnProperty.call(response, key));
22418
+ if (response &&
22419
+ Object.prototype.hasOwnProperty.call(response, "isSuccess")) {
22420
+ if (isValid) {
22172
22421
  this.logger.trace(`'${this.platformAuthType}' - platform broker returned successful and valid response`, correlationId);
22173
- return this.convertToPlatformBrokerResponse(response, correlationId);
22422
+ try {
22423
+ const validatedResponse = this.convertToPlatformBrokerResponse(response, correlationId);
22424
+ validationMeasurement.end({
22425
+ success: true,
22426
+ platformAuthProviderType: this.platformAuthType,
22427
+ });
22428
+ return validatedResponse;
22429
+ }
22430
+ catch (e) {
22431
+ validationMeasurement.end({
22432
+ success: false,
22433
+ platformAuthProviderType: this.platformAuthType,
22434
+ }, e);
22435
+ throw e;
22436
+ }
22174
22437
  }
22175
- else if (response.hasOwnProperty("error")) {
22438
+ else if (Object.prototype.hasOwnProperty.call(response, "error")) {
22176
22439
  const errorResponse = response;
22177
22440
  if (errorResponse.isSuccess === false &&
22178
22441
  errorResponse.error &&
22179
22442
  errorResponse.error.code) {
22180
22443
  this.logger.trace(`'${this.platformAuthType}' - platform broker returned error response`, correlationId);
22181
- throw createNativeAuthError(errorResponse.error.code, correlationId, errorResponse.error.description, {
22444
+ const nativeAuthError = createNativeAuthError(errorResponse.error.code, correlationId, errorResponse.error.description, {
22182
22445
  error: parseInt(errorResponse.error.errorCode),
22183
22446
  protocol_error: errorResponse.error.protocolError,
22184
22447
  status: errorResponse.error.status,
22185
22448
  properties: errorResponse.error.properties,
22186
22449
  });
22450
+ validationMeasurement.end({
22451
+ success: false,
22452
+ platformAuthProviderType: this.platformAuthType,
22453
+ brokerErrorName: errorResponse.error.code,
22454
+ brokerErrorCode: errorResponse.error.errorCode,
22455
+ }, nativeAuthError);
22456
+ throw nativeAuthError;
22187
22457
  }
22188
22458
  }
22189
22459
  }
22190
- throw createAuthError(unexpectedError, correlationId, "Response missing expected properties.");
22460
+ const error = createAuthError(unexpectedError, correlationId, "Response missing expected properties.");
22461
+ validationMeasurement.end({
22462
+ success: false,
22463
+ platformAuthProviderType: this.platformAuthType,
22464
+ }, error);
22465
+ throw error;
22466
+ }
22467
+ getCorrelationId(correlationId) {
22468
+ return correlationId || this.correlationId;
22191
22469
  }
22192
22470
  convertToPlatformBrokerResponse(response, correlationId) {
22193
22471
  this.logger.trace(`'${this.platformAuthType}' - convertToNativeResponse called`, correlationId);
@@ -22249,26 +22527,55 @@
22249
22527
  */
22250
22528
  async function getPlatformAuthProvider(logger, performanceClient, correlationId, nativeBrokerHandshakeTimeout, enablePlatformBrokerDOMSupport) {
22251
22529
  logger.trace("getPlatformAuthProvider called", correlationId);
22530
+ const discoveryMeasurement = performanceClient.startMeasurement(PlatformAuthProviderDiscovery, correlationId);
22252
22531
  logger.trace(`Has client allowed platform auth via DOM API: '${enablePlatformBrokerDOMSupport}'`, correlationId);
22253
22532
  let platformAuthProvider;
22254
22533
  try {
22255
22534
  if (enablePlatformBrokerDOMSupport) {
22256
22535
  // Check if DOM platform API is supported first
22257
- platformAuthProvider = await PlatformAuthDOMHandler.createProvider(logger, performanceClient, correlationId);
22536
+ try {
22537
+ platformAuthProvider =
22538
+ await PlatformAuthDOMHandler.createProvider(logger, performanceClient, correlationId);
22539
+ }
22540
+ catch (e) {
22541
+ logger.trace("Platform auth via DOM API unavailable, checking for extension", correlationId);
22542
+ }
22543
+ if (platformAuthProvider) {
22544
+ discoveryMeasurement.add({
22545
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_DOM_PROVIDER,
22546
+ });
22547
+ discoveryMeasurement.end({
22548
+ success: true,
22549
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_DOM_PROVIDER,
22550
+ });
22551
+ return platformAuthProvider;
22552
+ }
22258
22553
  }
22259
- if (!platformAuthProvider) {
22260
- logger.trace("Platform auth via DOM API not available, checking for extension", correlationId);
22261
- /*
22262
- * If DOM APIs are not available, check if browser extension is available.
22263
- * Platform authentication via DOM APIs is preferred over extension APIs.
22264
- */
22265
- platformAuthProvider =
22266
- await PlatformAuthExtensionHandler.createProvider(logger, nativeBrokerHandshakeTimeout ||
22267
- DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, performanceClient, correlationId);
22554
+ logger.trace("Platform auth via DOM API not available, checking for extension", correlationId);
22555
+ /*
22556
+ * If DOM APIs are not available, check if browser extension is available.
22557
+ * Platform authentication via DOM APIs is preferred over extension APIs.
22558
+ */
22559
+ platformAuthProvider =
22560
+ await PlatformAuthExtensionHandler.createProvider(logger, nativeBrokerHandshakeTimeout ||
22561
+ DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, performanceClient, correlationId);
22562
+ if (platformAuthProvider) {
22563
+ discoveryMeasurement.add({
22564
+ platformAuthProviderType: PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER,
22565
+ });
22268
22566
  }
22567
+ discoveryMeasurement.end({
22568
+ success: !!platformAuthProvider,
22569
+ platformAuthProviderType: platformAuthProvider
22570
+ ? PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER
22571
+ : undefined,
22572
+ });
22269
22573
  }
22270
22574
  catch (e) {
22271
22575
  logger.trace("Platform auth not available", e);
22576
+ discoveryMeasurement.end({
22577
+ success: false,
22578
+ }, e);
22272
22579
  }
22273
22580
  return platformAuthProvider;
22274
22581
  }
@@ -22280,8 +22587,22 @@
22280
22587
  * @param platformAuthProvider
22281
22588
  * @param authenticationScheme
22282
22589
  */
22283
- function isPlatformAuthAllowed(config, logger, correlationId, platformAuthProvider, authenticationScheme) {
22590
+ function isPlatformAuthAllowed(config, logger, correlationId, platformAuthProvider, authenticationScheme, performanceClient) {
22284
22591
  logger.trace("isPlatformAuthAllowed called", correlationId);
22592
+ const schemeSupported = !authenticationScheme ||
22593
+ authenticationScheme === AuthenticationScheme.BEARER ||
22594
+ authenticationScheme === AuthenticationScheme.POP;
22595
+ const fields = {
22596
+ allowPlatformBroker: config.system.allowPlatformBroker,
22597
+ ...(config.system.allowPlatformBroker && {
22598
+ platformAuthProviderType: platformAuthProvider instanceof PlatformAuthDOMHandler
22599
+ ? PlatformAuthConstants.PLATFORM_DOM_PROVIDER
22600
+ : platformAuthProvider
22601
+ ? PlatformAuthConstants.PLATFORM_EXTENSION_PROVIDER
22602
+ : undefined,
22603
+ }),
22604
+ };
22605
+ performanceClient?.addFields(fields, correlationId);
22285
22606
  // throw an error if allowPlatformBroker is not enabled and allowPlatformBrokerWithDOM is enabled
22286
22607
  if (!config.system.allowPlatformBroker &&
22287
22608
  config.experimental.allowPlatformBrokerWithDOM) {
@@ -22297,17 +22618,11 @@
22297
22618
  // Platform broker auth providers are not available
22298
22619
  return false;
22299
22620
  }
22300
- if (authenticationScheme) {
22301
- switch (authenticationScheme) {
22302
- case AuthenticationScheme.BEARER:
22303
- case AuthenticationScheme.POP:
22304
- logger.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true", correlationId);
22305
- return true;
22306
- default:
22307
- logger.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false", correlationId);
22308
- return false;
22309
- }
22621
+ if (!schemeSupported) {
22622
+ logger.trace("isPlatformAuthAllowed: authenticationScheme is not supported, returning false", correlationId);
22623
+ return false;
22310
22624
  }
22625
+ logger.trace("isPlatformAuthAllowed: authenticationScheme is supported, returning true", correlationId);
22311
22626
  return true;
22312
22627
  }
22313
22628
 
@@ -23791,6 +24106,9 @@
23791
24106
  this.hybridAuthCodeResponses = new Map();
23792
24107
  // Initialize performance client
23793
24108
  this.performanceClient = this.config.telemetry.client;
24109
+ this.performanceClient.addGlobalFields({
24110
+ allowPlatformBroker: this.config.system.allowPlatformBroker,
24111
+ });
23794
24112
  // Initialize environment-specific crypto and token-binding services.
23795
24113
  if (this.isBrowserEnvironment) {
23796
24114
  this.browserCrypto = new CryptoOps(this.logger, this.performanceClient);
@@ -24051,9 +24369,9 @@
24051
24369
  enforceResourceParameter(this.config.auth.isMcp, request);
24052
24370
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, correlationId, InteractionType.Redirect, request);
24053
24371
  let result;
24054
- if (this.platformAuthProvider &&
24055
- this.canUsePlatformBroker(request)) {
24056
- 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);
24372
+ const platformAuthProvider = this.platformAuthProvider;
24373
+ if (this.canUsePlatformBroker(request) && platformAuthProvider) {
24374
+ 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);
24057
24375
  result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
24058
24376
  if (e instanceof NativeAuthError &&
24059
24377
  isFatalNativeAuthError(e)) {
@@ -24738,11 +25056,8 @@
24738
25056
  canUsePlatformBroker(request, accountId) {
24739
25057
  const correlationId = this.getRequestCorrelationId(request);
24740
25058
  this.logger.trace("canUsePlatformBroker called", correlationId);
24741
- if (!this.platformAuthProvider) {
24742
- this.logger.trace("canUsePlatformBroker: platform broker unavilable, returning false", correlationId);
24743
- return false;
24744
- }
24745
- if (!isPlatformAuthAllowed(this.config, this.logger, correlationId, this.platformAuthProvider, request.authenticationScheme)) {
25059
+ const platformAuthAllowed = isPlatformAuthAllowed(this.config, this.logger, correlationId, this.platformAuthProvider, request.authenticationScheme, this.performanceClient);
25060
+ if (!platformAuthAllowed) {
24746
25061
  this.logger.trace("canUsePlatformBroker: isPlatformAuthAllowed returned false, returning false", correlationId);
24747
25062
  return false;
24748
25063
  }
@@ -25134,7 +25449,7 @@
25134
25449
  */
25135
25450
  async acquireTokenSilentNoIframe(silentRequest, cacheLookupPolicy) {
25136
25451
  // if the cache policy is set to access_token only, we should not be hitting the native layer yet
25137
- if (isPlatformAuthAllowed(this.config, this.logger, silentRequest.correlationId, this.platformAuthProvider, silentRequest.authenticationScheme) &&
25452
+ if (isPlatformAuthAllowed(this.config, this.logger, silentRequest.correlationId, this.platformAuthProvider, silentRequest.authenticationScheme, this.performanceClient) &&
25138
25453
  silentRequest.account.nativeAccountId) {
25139
25454
  this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform", silentRequest.correlationId);
25140
25455
  this.performanceClient.addFields({ isPlatformBrokerRequest: true }, silentRequest.correlationId);