@azure/msal-browser 5.26.0 → 5.27.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 (295) hide show
  1. package/README.md +2 -0
  2. package/dist/app/IPublicClientApplication.mjs +1 -1
  3. package/dist/app/PublicClientApplication.mjs +54 -14
  4. package/dist/app/PublicClientApplication.mjs.map +1 -1
  5. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  8. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  9. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
  10. package/dist/cache/AccountManager.mjs +1 -1
  11. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  12. package/dist/cache/BrowserCacheManager.mjs +1 -1
  13. package/dist/cache/CacheHelpers.mjs +1 -1
  14. package/dist/cache/CacheKeys.mjs +1 -1
  15. package/dist/cache/CookieStorage.mjs +1 -1
  16. package/dist/cache/DatabaseStorage.mjs +1 -1
  17. package/dist/cache/EncryptedData.mjs +1 -1
  18. package/dist/cache/LocalStorage.mjs +1 -1
  19. package/dist/cache/MemoryStorage.mjs +1 -1
  20. package/dist/cache/SessionStorage.mjs +1 -1
  21. package/dist/cache/TokenCache.mjs +1 -1
  22. package/dist/config/Configuration.mjs +32 -4
  23. package/dist/config/Configuration.mjs.map +1 -1
  24. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  25. package/dist/controllers/StandardController.mjs +36 -5
  26. package/dist/controllers/StandardController.mjs.map +1 -1
  27. package/dist/crypto/BrowserCrypto.mjs +1 -1
  28. package/dist/crypto/CryptoOps.mjs +1 -1
  29. package/dist/crypto/PkceGenerator.mjs +1 -1
  30. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  31. package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
  32. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  33. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  34. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  35. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  36. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  37. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  38. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -1
  54. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +1 -1
  56. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +1 -1
  57. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
  58. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +1 -1
  59. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +1 -1
  60. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -1
  61. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +1 -1
  62. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  63. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  64. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  65. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  66. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  67. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  68. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  69. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  70. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  71. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  72. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  73. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  74. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  75. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  76. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  77. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  78. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  79. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  80. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  81. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  82. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  83. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  84. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +1 -1
  85. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +1 -1
  86. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +1 -1
  87. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  88. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  89. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  90. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  91. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  92. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  93. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  94. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  95. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  96. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -1
  97. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +1 -1
  98. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +1 -1
  99. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  100. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
  101. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +1 -1
  102. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  103. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
  104. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -1
  105. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  106. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  107. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +1 -1
  108. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  109. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  110. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  111. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  112. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  113. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  114. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  115. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  116. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  117. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  118. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  119. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  120. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  121. package/dist/custom_auth/index.mjs +1 -1
  122. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  123. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  124. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  125. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  126. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  127. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  128. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  129. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  130. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  131. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  132. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  133. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +1 -1
  134. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  135. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  136. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  137. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  138. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  139. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  140. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  141. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  142. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  143. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  144. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  145. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  146. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  147. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +1 -1
  148. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +1 -1
  149. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +1 -1
  150. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  151. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  152. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  153. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  154. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  155. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  156. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  157. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  158. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  159. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  160. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  161. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  162. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  163. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  164. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +1 -1
  165. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +1 -1
  166. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +1 -1
  167. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +1 -1
  168. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  169. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  170. package/dist/encode/Base64Decode.mjs +1 -1
  171. package/dist/encode/Base64Encode.mjs +1 -1
  172. package/dist/error/BrowserAuthError.mjs +1 -1
  173. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  174. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  175. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  176. package/dist/error/NativeAuthError.mjs +1 -1
  177. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  178. package/dist/error/NestedAppAuthError.mjs +1 -1
  179. package/dist/event/EventHandler.mjs +1 -1
  180. package/dist/event/EventMessage.mjs +1 -1
  181. package/dist/event/EventType.mjs +1 -1
  182. package/dist/index.mjs +1 -1
  183. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  184. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  185. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
  186. package/dist/interaction_client/PopupClient.mjs +28 -1
  187. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  188. package/dist/interaction_client/RedirectClient.mjs +2 -3
  189. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  190. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  191. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  192. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  193. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  194. package/dist/interaction_client/StandardInteractionClient.mjs +7 -1
  195. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  196. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  197. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  198. package/dist/log-strings-mapping.json +23 -3
  199. package/dist/naa/BridgeError.mjs +1 -1
  200. package/dist/naa/BridgeProxy.mjs +1 -1
  201. package/dist/naa/BridgeStatusCode.mjs +1 -1
  202. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  203. package/dist/navigation/NavigationClient.mjs +1 -1
  204. package/dist/network/FetchClient.mjs +1 -1
  205. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  206. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  207. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  208. package/dist/packageMetadata.mjs +2 -2
  209. package/dist/popup_relay/constants.mjs +1 -1
  210. package/dist/popup_relay/index.mjs +1 -1
  211. package/dist/popup_relay/relayClient.mjs +1 -1
  212. package/dist/protocol/Authorize.mjs +23 -13
  213. package/dist/protocol/Authorize.mjs.map +1 -1
  214. package/dist/redirect_bridge/index.mjs +1 -1
  215. package/dist/request/RequestHelpers.mjs +1 -1
  216. package/dist/request/SilentRequestHelpers.mjs +1 -1
  217. package/dist/response/ResponseHandler.mjs +1 -1
  218. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  219. package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
  220. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  221. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  222. package/dist/utils/BrowserConstants.mjs +1 -1
  223. package/dist/utils/BrowserDetection.mjs +1 -1
  224. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  225. package/dist/utils/BrowserUtils.mjs +7 -2
  226. package/dist/utils/BrowserUtils.mjs.map +1 -1
  227. package/dist/utils/Helpers.mjs +1 -1
  228. package/dist/utils/IframeMonitor.mjs +81 -0
  229. package/dist/utils/IframeMonitor.mjs.map +1 -0
  230. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  231. package/dist/utils/PopupMonitor.mjs +119 -0
  232. package/dist/utils/PopupMonitor.mjs.map +1 -0
  233. package/dist/utils/PopupOriginCheck.mjs +88 -0
  234. package/dist/utils/PopupOriginCheck.mjs.map +1 -0
  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 -3
  242. package/lib/custom-auth-path/msal-custom-auth.cjs +617 -122
  243. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  244. package/lib/custom-auth-path/msal-custom-auth.js +617 -122
  245. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  246. package/lib/log-strings-mapping.json +23 -3
  247. package/lib/msal-browser.cjs +614 -128
  248. package/lib/msal-browser.cjs.map +1 -1
  249. package/lib/msal-browser.js +614 -128
  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 +2 -2
  264. package/src/app/PublicClientApplication.ts +108 -8
  265. package/src/config/Configuration.ts +63 -6
  266. package/src/controllers/StandardController.ts +46 -3
  267. package/src/interaction_client/PopupClient.ts +36 -0
  268. package/src/interaction_client/RedirectClient.ts +0 -1
  269. package/src/interaction_client/StandardInteractionClient.ts +6 -0
  270. package/src/packageMetadata.ts +1 -1
  271. package/src/protocol/Authorize.ts +34 -28
  272. package/src/utils/BrowserUtils.ts +8 -1
  273. package/src/utils/IframeMonitor.ts +98 -0
  274. package/src/utils/PopupMonitor.ts +158 -0
  275. package/src/utils/PopupOriginCheck.ts +94 -0
  276. package/types/app/PublicClientApplication.d.ts +6 -4
  277. package/types/app/PublicClientApplication.d.ts.map +1 -1
  278. package/types/config/Configuration.d.ts +16 -0
  279. package/types/config/Configuration.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/PopupClient.d.ts +12 -0
  283. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  284. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  285. package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  286. package/types/packageMetadata.d.ts +1 -1
  287. package/types/protocol/Authorize.d.ts.map +1 -1
  288. package/types/utils/BrowserUtils.d.ts +2 -1
  289. package/types/utils/BrowserUtils.d.ts.map +1 -1
  290. package/types/utils/IframeMonitor.d.ts +17 -0
  291. package/types/utils/IframeMonitor.d.ts.map +1 -0
  292. package/types/utils/PopupMonitor.d.ts +37 -0
  293. package/types/utils/PopupMonitor.d.ts.map +1 -0
  294. package/types/utils/PopupOriginCheck.d.ts +27 -0
  295. package/types/utils/PopupOriginCheck.d.ts.map +1 -0
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v5.26.0 2026-10-21 */
1
+ /*! @azure/msal-browser v5.27.0 2026-10-27 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -54,9 +54,15 @@ const EAR_JWK = "ear_jwk";
54
54
  const EAR_JWE_CRYPTO = "ear_jwe_crypto";
55
55
  const RESOURCE = "resource";
56
56
  const CLI_DATA = "clidata";
57
- const ATTRIBUTE_TOKENS = "attribute_tokens";
57
+ const ATTRIBUTE_TOKENS = "attribute_tokens";
58
+ /**
59
+ * Popup-origin-check-done. Signals to the STS that the client verified the
60
+ * popup cannot be reached by an untrusted window, so the
61
+ * Cross-Origin-Opener-Policy response header may be omitted.
62
+ */
63
+ const POPUP_ORIGIN_CHECK_DONE = "pocd";
58
64
 
59
- /*! @azure/msal-common v16.14.3 2026-10-21 */
65
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
60
66
  /*
61
67
  * Copyright (c) Microsoft Corporation. All rights reserved.
62
68
  * Licensed under the MIT License.
@@ -290,7 +296,7 @@ const JsonWebTokenTypes = {
290
296
  // Token renewal offset default in seconds
291
297
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
292
298
 
293
- /*! @azure/msal-common v16.14.3 2026-10-21 */
299
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
294
300
  /*
295
301
  * Copyright (c) Microsoft Corporation. All rights reserved.
296
302
  * Licensed under the MIT License.
@@ -319,7 +325,7 @@ function createAuthError(code, correlationId, additionalMessage) {
319
325
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
320
326
  }
321
327
 
322
- /*! @azure/msal-common v16.14.3 2026-10-21 */
328
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
323
329
 
324
330
  /*
325
331
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -342,7 +348,7 @@ function createClientAuthError(errorCode, correlationId, additionalMessage) {
342
348
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
343
349
  }
344
350
 
345
- /*! @azure/msal-common v16.14.3 2026-10-21 */
351
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
346
352
  /*
347
353
  * Copyright (c) Microsoft Corporation. All rights reserved.
348
354
  * Licensed under the MIT License.
@@ -380,7 +386,7 @@ const methodNotImplemented = "method_not_implemented";
380
386
  const resourceParameterRequired = "resource_parameter_required";
381
387
  const misplacedResourceParam = "misplaced_resource_parameter";
382
388
 
383
- /*! @azure/msal-common v16.14.3 2026-10-21 */
389
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
384
390
 
385
391
  /*
386
392
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -418,7 +424,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
418
424
  };
419
425
  }
420
426
 
421
- /*! @azure/msal-common v16.14.3 2026-10-21 */
427
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
422
428
 
423
429
  /*
424
430
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -484,7 +490,7 @@ function getJWSPayload(authToken, correlationId) {
484
490
  return matches[2];
485
491
  }
486
492
 
487
- /*! @azure/msal-common v16.14.3 2026-10-21 */
493
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
488
494
 
489
495
  /*
490
496
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -572,7 +578,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
572
578
  return updatedAccountInfo;
573
579
  }
574
580
 
575
- /*! @azure/msal-common v16.14.3 2026-10-21 */
581
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
576
582
  /*
577
583
  * Copyright (c) Microsoft Corporation. All rights reserved.
578
584
  * Licensed under the MIT License.
@@ -586,7 +592,7 @@ const AuthorityType = {
586
592
  Ciam: 3,
587
593
  };
588
594
 
589
- /*! @azure/msal-common v16.14.3 2026-10-21 */
595
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
590
596
  /*
591
597
  * Copyright (c) Microsoft Corporation. All rights reserved.
592
598
  * Licensed under the MIT License.
@@ -608,7 +614,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
608
614
  return null;
609
615
  }
610
616
 
611
- /*! @azure/msal-common v16.14.3 2026-10-21 */
617
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
612
618
  /*
613
619
  * Copyright (c) Microsoft Corporation. All rights reserved.
614
620
  * Licensed under the MIT License.
@@ -632,7 +638,7 @@ const ProtocolMode = {
632
638
  EAR: "EAR",
633
639
  };
634
640
 
635
- /*! @azure/msal-common v16.14.3 2026-10-21 */
641
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
636
642
  /**
637
643
  * Returns the AccountInfo interface for this account.
638
644
  * @internal
@@ -821,7 +827,7 @@ function isAccountEntity(entity) {
821
827
  entity.hasOwnProperty("authorityType"));
822
828
  }
823
829
 
824
- /*! @azure/msal-common v16.14.3 2026-10-21 */
830
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
825
831
  /*
826
832
  * Copyright (c) Microsoft Corporation. All rights reserved.
827
833
  * Licensed under the MIT License.
@@ -831,7 +837,7 @@ function isAccountEntity(entity) {
831
837
  */
832
838
  const unexpectedError = "unexpected_error";
833
839
 
834
- /*! @azure/msal-common v16.14.3 2026-10-21 */
840
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
835
841
 
836
842
  /*
837
843
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -851,7 +857,47 @@ function createClientConfigurationError(errorCode, correlationId) {
851
857
  return new ClientConfigurationError(errorCode, correlationId);
852
858
  }
853
859
 
854
- /*! @azure/msal-common v16.14.3 2026-10-21 */
860
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
861
+ /*
862
+ * Copyright (c) Microsoft Corporation. All rights reserved.
863
+ * Licensed under the MIT License.
864
+ */
865
+ // Track only our normalized copies, never caller-owned mutable inputs.
866
+ const normalizedHeaderRecords = new WeakSet();
867
+ /**
868
+ * Creates a lowercase-keyed snapshot without changing header values or the input.
869
+ * Reuses snapshots produced by this function to avoid repeated normalization.
870
+ * @internal
871
+ */
872
+ function normalizeResponseHeaders(headers) {
873
+ if (normalizedHeaderRecords.has(headers)) {
874
+ return headers;
875
+ }
876
+ const normalized = Object.fromEntries(Object.entries(headers).map(([name, value]) => [
877
+ name.toLowerCase(),
878
+ value,
879
+ ]));
880
+ normalizedHeaderRecords.add(normalized);
881
+ return normalized;
882
+ }
883
+ /**
884
+ * Reads a response header case-insensitively.
885
+ * Normalized snapshots are never scanned, even when a header is missing.
886
+ * @internal
887
+ */
888
+ function getResponseHeader(headers, name) {
889
+ const key = name.toLowerCase();
890
+ if (Object.prototype.hasOwnProperty.call(headers, key)) {
891
+ return headers[key];
892
+ }
893
+ if (normalizedHeaderRecords.has(headers)) {
894
+ return undefined;
895
+ }
896
+ const headerName = Object.keys(headers).find((header) => header.toLowerCase() === key);
897
+ return headerName === undefined ? undefined : headers[headerName];
898
+ }
899
+
900
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
855
901
  /*
856
902
  * Copyright (c) Microsoft Corporation. All rights reserved.
857
903
  * Licensed under the MIT License.
@@ -882,7 +928,7 @@ const invalidDpopHtu = "invalid_dpop_htu";
882
928
  const invalidDpopNonce = "invalid_dpop_nonce";
883
929
  const dpopMissingResourceContext = "dpop_missing_resource_context";
884
930
 
885
- /*! @azure/msal-common v16.14.3 2026-10-21 */
931
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
886
932
  /*
887
933
  * Copyright (c) Microsoft Corporation. All rights reserved.
888
934
  * Licensed under the MIT License.
@@ -894,7 +940,7 @@ function isOpenIdConfigResponse(response) {
894
940
  response.hasOwnProperty("jwks_uri"));
895
941
  }
896
942
 
897
- /*! @azure/msal-common v16.14.3 2026-10-21 */
943
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
898
944
  /*
899
945
  * Copyright (c) Microsoft Corporation. All rights reserved.
900
946
  * Licensed under the MIT License.
@@ -974,7 +1020,7 @@ class StringUtils {
974
1020
  }
975
1021
  }
976
1022
 
977
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1023
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
978
1024
 
979
1025
  /*
980
1026
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1132,7 +1178,7 @@ class UrlString {
1132
1178
  }
1133
1179
  }
1134
1180
 
1135
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1181
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1136
1182
 
1137
1183
  /*
1138
1184
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1286,7 +1332,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1286
1332
  return null;
1287
1333
  }
1288
1334
 
1289
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1335
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1290
1336
  /*
1291
1337
  * Copyright (c) Microsoft Corporation. All rights reserved.
1292
1338
  * Licensed under the MIT License.
@@ -1295,7 +1341,7 @@ const AzureCloudInstance = {
1295
1341
  // AzureCloudInstance is not specified.
1296
1342
  None: "none"};
1297
1343
 
1298
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1344
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1299
1345
  /*
1300
1346
  * Copyright (c) Microsoft Corporation. All rights reserved.
1301
1347
  * Licensed under the MIT License.
@@ -1305,7 +1351,7 @@ function isCloudInstanceDiscoveryResponse(response) {
1305
1351
  response.hasOwnProperty("metadata"));
1306
1352
  }
1307
1353
 
1308
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1354
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1309
1355
  /*
1310
1356
  * Copyright (c) Microsoft Corporation. All rights reserved.
1311
1357
  * Licensed under the MIT License.
@@ -1315,7 +1361,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
1315
1361
  response.hasOwnProperty("error_description"));
1316
1362
  }
1317
1363
 
1318
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1364
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1319
1365
  /*
1320
1366
  * Copyright (c) Microsoft Corporation. All rights reserved.
1321
1367
  * Licensed under the MIT License.
@@ -1386,7 +1432,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
1386
1432
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1387
1433
  const SetUserData = "setUserData";
1388
1434
 
1389
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1435
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1390
1436
  /*
1391
1437
  * Copyright (c) Microsoft Corporation. All rights reserved.
1392
1438
  * Licensed under the MIT License.
@@ -1479,7 +1525,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
1479
1525
  };
1480
1526
  };
1481
1527
 
1482
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1528
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1483
1529
 
1484
1530
  /*
1485
1531
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1590,7 +1636,7 @@ RegionDiscovery.IMDS_OPTIONS = {
1590
1636
  },
1591
1637
  };
1592
1638
 
1593
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1639
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1594
1640
  /*
1595
1641
  * Copyright (c) Microsoft Corporation. All rights reserved.
1596
1642
  * Licensed under the MIT License.
@@ -1655,7 +1701,7 @@ function wasClockTurnedBack(cachedAt) {
1655
1701
  return cachedAtSec > nowSeconds();
1656
1702
  }
1657
1703
 
1658
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1704
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1659
1705
 
1660
1706
  /*
1661
1707
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1942,7 +1988,7 @@ function serializeAttributeTokens(attributeTokens) {
1942
1988
  return [...attributeTokens].sort().join(" ");
1943
1989
  }
1944
1990
 
1945
- /*! @azure/msal-common v16.14.3 2026-10-21 */
1991
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
1946
1992
 
1947
1993
  /*
1948
1994
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2910,7 +2956,7 @@ function buildStaticAuthorityOptions(authOptions) {
2910
2956
  };
2911
2957
  }
2912
2958
 
2913
- /*! @azure/msal-common v16.14.3 2026-10-21 */
2959
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
2914
2960
 
2915
2961
  /*
2916
2962
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2944,7 +2990,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
2944
2990
  }
2945
2991
  }
2946
2992
 
2947
- /*! @azure/msal-common v16.14.3 2026-10-21 */
2993
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
2948
2994
 
2949
2995
  /*
2950
2996
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3140,7 +3186,7 @@ class ScopeSet {
3140
3186
  }
3141
3187
  }
3142
3188
 
3143
- /*! @azure/msal-common v16.14.3 2026-10-21 */
3189
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
3144
3190
 
3145
3191
  /*
3146
3192
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3421,6 +3467,20 @@ function addInstanceAware(parameters) {
3421
3467
  parameters.set(INSTANCE_AWARE, "true");
3422
3468
  }
3423
3469
  }
3470
+ /**
3471
+ * Adds `pocd=1`, telling the STS that the client verified the popup driving
3472
+ * this request cannot be reached by an untrusted window, so the
3473
+ * Cross-Origin-Opener-Policy response header may be omitted.
3474
+ *
3475
+ * Only ever added when the check passed — a negative result is signalled by
3476
+ * omitting the parameter, which keeps the STS default (apply COOP) and stays
3477
+ * compatible with library versions that never send it.
3478
+ */
3479
+ function addPopupOriginCheckDone(parameters) {
3480
+ if (!parameters.has(POPUP_ORIGIN_CHECK_DONE)) {
3481
+ parameters.set(POPUP_ORIGIN_CHECK_DONE, "1");
3482
+ }
3483
+ }
3424
3484
  /**
3425
3485
  * Add extraParameters
3426
3486
  * @param extraParams - String dictionary containing extra parameters to be added.
@@ -3626,7 +3686,7 @@ function addAttributeTokens(parameters, attributeTokens) {
3626
3686
  }
3627
3687
  }
3628
3688
 
3629
- /*! @azure/msal-common v16.14.3 2026-10-21 */
3689
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
3630
3690
 
3631
3691
  /*
3632
3692
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3647,7 +3707,8 @@ function stripLeadingHashOrQuery(responseString) {
3647
3707
  return responseString;
3648
3708
  }
3649
3709
  /**
3650
- * Returns URL hash as server auth code response object.
3710
+ * Returns flat fragment or query parameters as an authorization response.
3711
+ * Application routes and unrecognized responses return null.
3651
3712
  */
3652
3713
  function getDeserializedResponse(responseString) {
3653
3714
  // Check if given hash is empty
@@ -3657,7 +3718,15 @@ function getDeserializedResponse(responseString) {
3657
3718
  try {
3658
3719
  // Strip the # or ? symbol if present
3659
3720
  const normalizedResponse = stripLeadingHashOrQuery(responseString);
3660
- // If # symbol was not present, above will return empty string, so give original hash value
3721
+ /*
3722
+ * Require a flat parameter name, not an application route.
3723
+ * Reject routes like #/dashboard?tab=orders&code=... and
3724
+ * #/dashboard/orders&state=..., where ?, /, or # appears before
3725
+ * the first = or &. These characters are allowed in parameter values.
3726
+ */
3727
+ if (!/^[^=&?#/]+(?:=|&|$)/.test(normalizedResponse)) {
3728
+ return null;
3729
+ }
3661
3730
  const deserializedHash = Object.fromEntries(new URLSearchParams(normalizedResponse));
3662
3731
  // Check for known response properties
3663
3732
  if (deserializedHash.code ||
@@ -3748,7 +3817,7 @@ function validateUrl(url, logger, correlationId) {
3748
3817
  }
3749
3818
  }
3750
3819
 
3751
- /*! @azure/msal-common v16.14.3 2026-10-21 */
3820
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
3752
3821
 
3753
3822
  /*
3754
3823
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3796,7 +3865,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
3796
3865
  },
3797
3866
  };
3798
3867
 
3799
- /*! @azure/msal-common v16.14.3 2026-10-21 */
3868
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
3800
3869
 
3801
3870
  /*
3802
3871
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3819,7 +3888,7 @@ const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
3819
3888
  },
3820
3889
  };
3821
3890
 
3822
- /*! @azure/msal-common v16.14.3 2026-10-21 */
3891
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
3823
3892
  /*
3824
3893
  * Copyright (c) Microsoft Corporation. All rights reserved.
3825
3894
  * Licensed under the MIT License.
@@ -4094,12 +4163,12 @@ class Logger {
4094
4163
  }
4095
4164
  }
4096
4165
 
4097
- /*! @azure/msal-common v16.14.3 2026-10-21 */
4166
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
4098
4167
  /* eslint-disable header/header */
4099
4168
  const name$1 = "@azure/msal-common";
4100
- const version$1 = "16.14.3";
4169
+ const version$1 = "16.15.0";
4101
4170
 
4102
- /*! @azure/msal-common v16.14.3 2026-10-21 */
4171
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
4103
4172
  /*
4104
4173
  * Copyright (c) Microsoft Corporation. All rights reserved.
4105
4174
  * Licensed under the MIT License.
@@ -4107,7 +4176,7 @@ const version$1 = "16.14.3";
4107
4176
  const cacheQuotaExceeded = "cache_quota_exceeded";
4108
4177
  const cacheErrorUnknown = "cache_error_unknown";
4109
4178
 
4110
- /*! @azure/msal-common v16.14.3 2026-10-21 */
4179
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
4111
4180
 
4112
4181
  /*
4113
4182
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4145,7 +4214,7 @@ function createCacheError(e) {
4145
4214
  }
4146
4215
  }
4147
4216
 
4148
- /*! @azure/msal-common v16.14.3 2026-10-21 */
4217
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
4149
4218
 
4150
4219
  /*
4151
4220
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5332,7 +5401,7 @@ class DefaultStorageClass extends CacheManager {
5332
5401
  }
5333
5402
  }
5334
5403
 
5335
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5404
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5336
5405
  /*
5337
5406
  * Copyright (c) Microsoft Corporation. All rights reserved.
5338
5407
  * Licensed under the MIT License.
@@ -5346,7 +5415,7 @@ class DefaultStorageClass extends CacheManager {
5346
5415
  const PerformanceEventStatus = {
5347
5416
  InProgress: 1};
5348
5417
 
5349
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5418
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5350
5419
 
5351
5420
  /*
5352
5421
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5404,7 +5473,7 @@ class StubPerformanceClient {
5404
5473
  }
5405
5474
  }
5406
5475
 
5407
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5476
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5408
5477
 
5409
5478
  /*
5410
5479
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5502,7 +5571,7 @@ function isOidcProtocolMode(config) {
5502
5571
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5503
5572
  }
5504
5573
 
5505
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5574
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5506
5575
  /*
5507
5576
  * Copyright (c) Microsoft Corporation. All rights reserved.
5508
5577
  * Licensed under the MIT License.
@@ -5529,7 +5598,7 @@ function isOidcProtocolMode(config) {
5529
5598
  }
5530
5599
  }
5531
5600
 
5532
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5601
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5533
5602
 
5534
5603
  /*
5535
5604
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5550,7 +5619,7 @@ function createJoseHeaderError(code, correlationId) {
5550
5619
  return new JoseHeaderError(code, correlationId);
5551
5620
  }
5552
5621
 
5553
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5622
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5554
5623
  /*
5555
5624
  * Copyright (c) Microsoft Corporation. All rights reserved.
5556
5625
  * Licensed under the MIT License.
@@ -5575,7 +5644,7 @@ function isPlainObject(value) {
5575
5644
  return Object.getPrototypeOf(value) === proto;
5576
5645
  }
5577
5646
 
5578
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5647
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5579
5648
  /*
5580
5649
  * Copyright (c) Microsoft Corporation. All rights reserved.
5581
5650
  * Licensed under the MIT License.
@@ -5585,7 +5654,7 @@ const missingAlgError = "missing_alg_error";
5585
5654
  const missingJwkError = "missing_jwk_error";
5586
5655
  const invalidJwkError = "invalid_jwk_error";
5587
5656
 
5588
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5657
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5589
5658
 
5590
5659
  /*
5591
5660
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5651,7 +5720,7 @@ class JoseHeader {
5651
5720
  }
5652
5721
  }
5653
5722
 
5654
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5723
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5655
5724
 
5656
5725
  /*
5657
5726
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5752,7 +5821,7 @@ class PopTokenGenerator {
5752
5821
  }
5753
5822
  }
5754
5823
 
5755
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5824
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5756
5825
 
5757
5826
  /*
5758
5827
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5897,7 +5966,7 @@ class DpopProofGenerator {
5897
5966
  }
5898
5967
  }
5899
5968
 
5900
- /*! @azure/msal-common v16.14.3 2026-10-21 */
5969
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5901
5970
  /*
5902
5971
  * Copyright (c) Microsoft Corporation. All rights reserved.
5903
5972
  * Licensed under the MIT License.
@@ -5948,7 +6017,7 @@ const badToken = "bad_token";
5948
6017
  */
5949
6018
  const interruptedUser = "interrupted_user";
5950
6019
 
5951
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6020
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
5952
6021
 
5953
6022
  /*
5954
6023
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6015,7 +6084,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
6015
6084
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
6016
6085
  }
6017
6086
 
6018
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6087
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6019
6088
 
6020
6089
  /*
6021
6090
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6034,7 +6103,7 @@ class ServerError extends AuthError {
6034
6103
  }
6035
6104
  }
6036
6105
 
6037
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6106
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6038
6107
 
6039
6108
  /*
6040
6109
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6105,7 +6174,7 @@ function parseRequestState(base64Decode, state, correlationId) {
6105
6174
  }
6106
6175
  }
6107
6176
 
6108
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6177
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6109
6178
 
6110
6179
  /*
6111
6180
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6533,7 +6602,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6533
6602
  return baseAccount;
6534
6603
  }
6535
6604
 
6536
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6605
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6537
6606
  /*
6538
6607
  * Copyright (c) Microsoft Corporation. All rights reserved.
6539
6608
  * Licensed under the MIT License.
@@ -6543,7 +6612,7 @@ const CcsCredentialType = {
6543
6612
  UPN: "UPN",
6544
6613
  };
6545
6614
 
6546
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6615
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6547
6616
  /*
6548
6617
  * Copyright (c) Microsoft Corporation. All rights reserved.
6549
6618
  * Licensed under the MIT License.
@@ -6562,7 +6631,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
6562
6631
  }
6563
6632
  }
6564
6633
 
6565
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6634
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6566
6635
 
6567
6636
  /*
6568
6637
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6586,7 +6655,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
6586
6655
  };
6587
6656
  }
6588
6657
 
6589
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6658
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6590
6659
 
6591
6660
  /*
6592
6661
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6621,13 +6690,14 @@ class ThrottlingUtils {
6621
6690
  * Performs necessary throttling checks after a network request.
6622
6691
  * @param cacheManager
6623
6692
  * @param thumbprint
6624
- * @param response
6693
+ * @param response - Token response with case-insensitive header names.
6625
6694
  */
6626
6695
  static postProcess(cacheManager, thumbprint, response, correlationId) {
6696
+ const retryAfter = getRetryAfterHeader(response);
6627
6697
  if (ThrottlingUtils.checkResponseStatus(response) ||
6628
- ThrottlingUtils.checkResponseForRetryAfter(response)) {
6698
+ retryAfter !== undefined) {
6629
6699
  const thumbprintValue = {
6630
- throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(response.headers[HeaderNames.RETRY_AFTER])),
6700
+ throttleTime: ThrottlingUtils.calculateThrottleTime(parseInt(retryAfter || "")),
6631
6701
  error: response.body.error,
6632
6702
  errorCodes: response.body.error_codes,
6633
6703
  errorMessage: response.body.error_description,
@@ -6646,14 +6716,10 @@ class ThrottlingUtils {
6646
6716
  }
6647
6717
  /**
6648
6718
  * Checks a NetworkResponse object's RetryAfter header
6649
- * @param response
6719
+ * @param response - Token response with case-insensitive header names.
6650
6720
  */
6651
6721
  static checkResponseForRetryAfter(response) {
6652
- if (response.headers) {
6653
- return (response.headers.hasOwnProperty(HeaderNames.RETRY_AFTER) &&
6654
- (response.status < 200 || response.status >= 300));
6655
- }
6656
- return false;
6722
+ return getRetryAfterHeader(response) !== undefined;
6657
6723
  }
6658
6724
  /**
6659
6725
  * Calculates the Unix-time value for a throttle to expire given throttleTime in seconds.
@@ -6670,9 +6736,16 @@ class ThrottlingUtils {
6670
6736
  const key = this.generateThrottlingStorageKey(thumbprint);
6671
6737
  cacheManager.removeItem(key, request.correlationId);
6672
6738
  }
6739
+ }
6740
+ /** Reads Retry-After only for non-success responses. */
6741
+ function getRetryAfterHeader(response) {
6742
+ if ((response.status < 200 || response.status >= 300) && response.headers) {
6743
+ return getResponseHeader(response.headers, HeaderNames.RETRY_AFTER);
6744
+ }
6745
+ return undefined;
6673
6746
  }
6674
6747
 
6675
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6748
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6676
6749
 
6677
6750
  /*
6678
6751
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6703,7 +6776,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
6703
6776
  return new NetworkError(error, httpStatus, responseHeaders);
6704
6777
  }
6705
6778
 
6706
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6779
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6707
6780
 
6708
6781
  /*
6709
6782
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6801,7 +6874,8 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
6801
6874
  let response;
6802
6875
  try {
6803
6876
  response = await invokeAsync((networkClient.sendPostRequestAsync.bind(networkClient)), NetworkClientSendPostRequestAsync, logger, performanceClient, correlationId)(tokenEndpoint, { ...options, correlationId, performanceClient });
6804
- const responseHeaders = response.headers || {};
6877
+ const responseHeaders = normalizeResponseHeaders(response.headers || {});
6878
+ response = { ...response, headers: responseHeaders };
6805
6879
  performanceClient?.addFields({
6806
6880
  refreshTokenSize: response.body.refresh_token?.length || 0,
6807
6881
  httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] || "",
@@ -6810,16 +6884,16 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
6810
6884
  }
6811
6885
  catch (e) {
6812
6886
  if (e instanceof NetworkError) {
6813
- const responseHeaders = e.responseHeaders;
6887
+ const responseHeaders = e.responseHeaders
6888
+ ? normalizeResponseHeaders(e.responseHeaders)
6889
+ : undefined;
6814
6890
  if (responseHeaders) {
6815
6891
  performanceClient?.addFields({
6816
6892
  httpVerToken: responseHeaders[HeaderNames.X_MS_HTTP_VERSION] ||
6817
6893
  "",
6818
6894
  requestId: responseHeaders[HeaderNames.X_MS_REQUEST_ID] || "",
6819
- contentTypeHeader: responseHeaders[HeaderNames.CONTENT_TYPE] ||
6820
- undefined,
6821
- contentLengthHeader: responseHeaders[HeaderNames.CONTENT_LENGTH] ||
6822
- undefined,
6895
+ contentTypeHeader: getResponseHeader(responseHeaders, HeaderNames.CONTENT_TYPE) || undefined,
6896
+ contentLengthHeader: getResponseHeader(responseHeaders, HeaderNames.CONTENT_LENGTH) || undefined,
6823
6897
  httpStatus: e.httpStatus,
6824
6898
  }, correlationId);
6825
6899
  }
@@ -6836,7 +6910,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
6836
6910
  return response;
6837
6911
  }
6838
6912
 
6839
- /*! @azure/msal-common v16.14.3 2026-10-21 */
6913
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
6840
6914
 
6841
6915
  /*
6842
6916
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7080,6 +7154,9 @@ class AuthorizationCodeClient {
7080
7154
  if (request.logoutHint) {
7081
7155
  addLogoutHint(parameters, request.logoutHint);
7082
7156
  }
7157
+ if (request.popupOriginCheckDone) {
7158
+ addPopupOriginCheckDone(parameters);
7159
+ }
7083
7160
  if (request.extraQueryParameters) {
7084
7161
  addExtraParameters(parameters, request.extraQueryParameters);
7085
7162
  }
@@ -7100,7 +7177,7 @@ class AuthorizationCodeClient {
7100
7177
  }
7101
7178
  }
7102
7179
 
7103
- /*! @azure/msal-common v16.14.3 2026-10-21 */
7180
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
7104
7181
 
7105
7182
  /*
7106
7183
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7235,6 +7312,9 @@ function getStandardAuthorizeRequestParameters(authOptions, request, logger, per
7235
7312
  !Object.keys(request.extraQueryParameters).includes(INSTANCE_AWARE))) {
7236
7313
  addInstanceAware(parameters);
7237
7314
  }
7315
+ if (request.popupOriginCheckDone) {
7316
+ addPopupOriginCheckDone(parameters);
7317
+ }
7238
7318
  return parameters;
7239
7319
  }
7240
7320
  /**
@@ -7327,7 +7407,7 @@ function extractLoginHint(account) {
7327
7407
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7328
7408
  }
7329
7409
 
7330
- /*! @azure/msal-common v16.14.3 2026-10-21 */
7410
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
7331
7411
 
7332
7412
  /*
7333
7413
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7562,7 +7642,7 @@ class RefreshTokenClient {
7562
7642
  }
7563
7643
  }
7564
7644
 
7565
- /*! @azure/msal-common v16.14.3 2026-10-21 */
7645
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
7566
7646
 
7567
7647
  /*
7568
7648
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7855,7 +7935,7 @@ class StubServerTelemetryManager extends ServerTelemetryManager {
7855
7935
  clearNativeBrokerErrorCode() { }
7856
7936
  }
7857
7937
 
7858
- /*! @azure/msal-common v16.14.3 2026-10-21 */
7938
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
7859
7939
 
7860
7940
  /*
7861
7941
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7982,7 +8062,7 @@ class SilentFlowClient {
7982
8062
  }
7983
8063
  }
7984
8064
 
7985
- /*! @azure/msal-common v16.14.3 2026-10-21 */
8065
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
7986
8066
 
7987
8067
  /*
7988
8068
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7998,7 +8078,7 @@ const StubbedNetworkModule = {
7998
8078
  },
7999
8079
  };
8000
8080
 
8001
- /*! @azure/msal-common v16.14.3 2026-10-21 */
8081
+ /*! @azure/msal-common v16.15.0 2026-10-27 */
8002
8082
 
8003
8083
  /*
8004
8084
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8434,7 +8514,7 @@ function ensureArgumentIsStringArray(argName, argValue, correlationId) {
8434
8514
 
8435
8515
  /* eslint-disable header/header */
8436
8516
  const name = "@azure/msal-browser";
8437
- const version = "5.26.0";
8517
+ const version = "5.27.0";
8438
8518
 
8439
8519
  /*
8440
8520
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9880,9 +9960,14 @@ function parseAuthResponseFromUrl() {
9880
9960
  };
9881
9961
  }
9882
9962
  /**
9883
- * Clears hash from window url.
9963
+ * Clears a recognized authentication response fragment, preserving the query string.
9964
+ * Assigns an empty hash, then removes the trailing # when history updates are available.
9884
9965
  */
9885
9966
  function clearHash(contentWindow) {
9967
+ const serverParams = getDeserializedResponse(contentWindow.location.hash);
9968
+ if (!serverParams) {
9969
+ return;
9970
+ }
9886
9971
  // Office.js sets history.replaceState to null
9887
9972
  contentWindow.location.hash = "";
9888
9973
  if (typeof contentWindow.history.replaceState === "function") {
@@ -9890,6 +9975,16 @@ function clearHash(contentWindow) {
9890
9975
  contentWindow.history.replaceState(null, "", `${contentWindow.location.origin}${contentWindow.location.pathname}${contentWindow.location.search}`);
9891
9976
  }
9892
9977
  }
9978
+ /**
9979
+ * Strips both hash and query string from the given window's URL by replacing
9980
+ * with origin + pathname only. Used to remove auth response parameters
9981
+ * (auth code, state, etc.) before the window is closed or navigated away.
9982
+ */
9983
+ function clearAuthResponseFromUrl(contentWindow) {
9984
+ if (typeof contentWindow.history?.replaceState === "function") {
9985
+ contentWindow.history.replaceState(null, "", `${contentWindow.location.origin}${contentWindow.location.pathname}`);
9986
+ }
9987
+ }
9893
9988
  /**
9894
9989
  * Replaces current hash with hash from provided url
9895
9990
  */
@@ -11075,6 +11170,90 @@ function validateRequestMethod(interactionRequest, protocolMode) {
11075
11170
  return httpMethod;
11076
11171
  }
11077
11172
 
11173
+ /*
11174
+ * Copyright (c) Microsoft Corporation. All rights reserved.
11175
+ * Licensed under the MIT License.
11176
+ */
11177
+ /**
11178
+ * `window.origin` of a document with an opaque origin, e.g. one sandboxed
11179
+ * without `allow-same-origin`. Read from `window.origin`, not
11180
+ * `location.origin`, which reports the real host even when sandboxed.
11181
+ */
11182
+ const OPAQUE_ORIGIN = "null";
11183
+ /**
11184
+ * Returns `true` when every ancestor browsing context is same-origin with
11185
+ * `win`. A top-level document has no ancestors, so it always passes.
11186
+ */
11187
+ function allAncestorsSameOrigin(win) {
11188
+ try {
11189
+ // Sandboxed: no origin to compare ancestors against.
11190
+ if (win.origin === OPAQUE_ORIGIN) {
11191
+ return false;
11192
+ }
11193
+ let current = win;
11194
+ // `window.parent` is self-referential at the top level, never falsy.
11195
+ while (current !== current.parent) {
11196
+ current = current.parent;
11197
+ // Throws SecurityError if this ancestor is cross-origin.
11198
+ void current.location.href;
11199
+ }
11200
+ return true;
11201
+ }
11202
+ catch {
11203
+ return false;
11204
+ }
11205
+ }
11206
+ /**
11207
+ * Returns `true` when the top-level window has no opener, or one that is
11208
+ * same-origin with it.
11209
+ *
11210
+ * Reads the opener from `win.top`, not `win`: a framed document always reports
11211
+ * `window.opener === null` and would pass while the top window's untrusted
11212
+ * opener still holds a handle on it.
11213
+ */
11214
+ function topOpenerIsSameOriginOrAbsent(win) {
11215
+ try {
11216
+ const top = win.top;
11217
+ if (!top) {
11218
+ // Detached from its browsing context; treat as unsafe.
11219
+ return false;
11220
+ }
11221
+ const opener = top.opener;
11222
+ if (!opener || opener === top) {
11223
+ return true;
11224
+ }
11225
+ // Throws SecurityError if the opener is cross-origin.
11226
+ void opener.location.href;
11227
+ return true;
11228
+ }
11229
+ catch {
11230
+ return false;
11231
+ }
11232
+ }
11233
+ /**
11234
+ * Computes the `pocd` ("popup origin check done") authorize parameter value.
11235
+ *
11236
+ * `1` means no untrusted window can reach the popup, which is what lets Entra
11237
+ * omit the `Cross-Origin-Opener-Policy` response header for the request.
11238
+ *
11239
+ * @param config Resolved browser configuration.
11240
+ * @param win Window whose hosting environment is being checked. Defaults to the app window.
11241
+ * @returns `1` when the check passes, otherwise `0`.
11242
+ */
11243
+ function computePocd(config, win = typeof window !== "undefined" ? window : undefined) {
11244
+ /*
11245
+ * Only an explicit false opts out; anything else computes the check, so an
11246
+ * unresolved config fails closed rather than asserting pocd=1.
11247
+ */
11248
+ if (config.auth.originCheck === false) {
11249
+ return 1;
11250
+ }
11251
+ if (!win || !allAncestorsSameOrigin(win)) {
11252
+ return 0;
11253
+ }
11254
+ return topOpenerIsSameOriginOrAbsent(win) ? 1 : 0;
11255
+ }
11256
+
11078
11257
  /*
11079
11258
  * Copyright (c) Microsoft Corporation. All rights reserved.
11080
11259
  * Licensed under the MIT License.
@@ -11092,6 +11271,11 @@ class StandardInteractionClient extends BaseInteractionClient {
11092
11271
  const validLogoutRequest = {
11093
11272
  correlationId: this.correlationId,
11094
11273
  ...logoutRequest,
11274
+ /*
11275
+ * Computed here rather than per flow so every end-session request
11276
+ * carries it, matching the authorize path.
11277
+ */
11278
+ popupOriginCheckDone: computePocd(this.config) === 1,
11095
11279
  };
11096
11280
  /**
11097
11281
  * Set logout_hint to be login_hint from ID Token Claims if present
@@ -19811,6 +19995,116 @@ function getActiveAccount(browserStorage, correlationId) {
19811
19995
  return browserStorage.getActiveAccount(correlationId);
19812
19996
  }
19813
19997
 
19998
+ /*
19999
+ * Copyright (c) Microsoft Corporation. All rights reserved.
20000
+ * Licensed under the MIT License.
20001
+ */
20002
+ const POPUP_POLL_INTERVAL_MS = 30;
20003
+ let activePopupPoller;
20004
+ /**
20005
+ * Cancels legacy popup polling when an interaction is superseded.
20006
+ *
20007
+ * @internal
20008
+ * @param logger Logger for the interaction.
20009
+ */
20010
+ function cancelPendingPopupPollingResponse(logger) {
20011
+ if (activePopupPoller) {
20012
+ logger.verbose("0g9n3p", activePopupPoller.correlationId);
20013
+ activePopupPoller.cancel();
20014
+ }
20015
+ }
20016
+ /**
20017
+ * Monitors a popup window for a URL change to the same origin as the parent application.
20018
+ * Polls the popup at a specified interval until it is redirected back to the application,
20019
+ * closed by the user, or a navigation to a same-origin URL is detected. Once a same-origin
20020
+ * URL is detected, extracts the response string (query or hash) and resolves the promise.
20021
+ *
20022
+ * @param popupWindow - The popup window to monitor for navigation.
20023
+ * @param popupWindowParent - The parent window that opened the popup.
20024
+ * @param responseMode - Response mode (`"query"` | `"fragment"`) determines whether
20025
+ * to read `location.search` or `location.hash` from the popup once on the same
20026
+ * origin. Any value other than `"query"` is treated as fragment.
20027
+ * @param logger - Logger instance.
20028
+ * @param unloadWindow - Event handler to remove from the parent window on cleanup.
20029
+ * @param correlationId
20030
+ */
20031
+ async function monitorPopupForHash(popupWindow, popupWindowParent, responseMode, logger, unloadWindow, correlationId) {
20032
+ let poller;
20033
+ return new Promise((resolve, reject) => {
20034
+ logger.verbose("0cp91u", correlationId);
20035
+ const intervalId = window.setInterval(() => {
20036
+ if (popupWindow.closed) {
20037
+ logger.error("0n69wb", correlationId);
20038
+ window.clearInterval(intervalId);
20039
+ reject(new BrowserAuthError(userCancelled, correlationId));
20040
+ return;
20041
+ }
20042
+ let href = "";
20043
+ try {
20044
+ /*
20045
+ * Will throw if cross origin,
20046
+ * which should be caught and ignored
20047
+ * since we need the interval to keep running while on STS UI.
20048
+ */
20049
+ href = popupWindow.location.href;
20050
+ }
20051
+ catch (e) { }
20052
+ // Don't process blank pages or cross domain
20053
+ if (!href || href === "about:blank") {
20054
+ return;
20055
+ }
20056
+ window.clearInterval(intervalId);
20057
+ let responseString;
20058
+ if (responseMode === ResponseMode.QUERY) {
20059
+ responseString = popupWindow.location.search;
20060
+ }
20061
+ else {
20062
+ responseString = popupWindow.location.hash;
20063
+ }
20064
+ logger.verbose("0po9er", correlationId);
20065
+ resolve(responseString);
20066
+ }, POPUP_POLL_INTERVAL_MS);
20067
+ poller = {
20068
+ correlationId,
20069
+ cancel: () => {
20070
+ window.clearInterval(intervalId);
20071
+ if (activePopupPoller === poller) {
20072
+ activePopupPoller = undefined;
20073
+ }
20074
+ reject(new BrowserAuthError(interactionInProgressCancelled, correlationId));
20075
+ },
20076
+ };
20077
+ activePopupPoller = poller;
20078
+ }).finally(() => {
20079
+ if (poller && activePopupPoller === poller) {
20080
+ activePopupPoller = undefined;
20081
+ }
20082
+ cleanPopup(popupWindow, popupWindowParent, unloadWindow);
20083
+ });
20084
+ }
20085
+ /**
20086
+ * Performs cleanup operations after popup authentication.
20087
+ * Strips auth-response params (code/state) from the popup URL while it is still
20088
+ * open, closes the popup window, and removes the 'beforeunload' event listener
20089
+ * from the parent window.
20090
+ *
20091
+ * @param popupWindow - The popup window to be closed.
20092
+ * @param popupWindowParent - The parent window from which the event listener will be removed.
20093
+ * @param unloadWindow - The event handler function to remove.
20094
+ */
20095
+ function cleanPopup(popupWindow, popupWindowParent, unloadWindow) {
20096
+ if (!popupWindow.closed) {
20097
+ try {
20098
+ clearAuthResponseFromUrl(popupWindow);
20099
+ }
20100
+ catch {
20101
+ // Popup may have become cross-origin or otherwise inaccessible; ignore.
20102
+ }
20103
+ }
20104
+ popupWindow.close();
20105
+ popupWindowParent.removeEventListener("beforeunload", unloadWindow);
20106
+ }
20107
+
19814
20108
  /*
19815
20109
  * Copyright (c) Microsoft Corporation. All rights reserved.
19816
20110
  * Licensed under the MIT License.
@@ -21201,7 +21495,16 @@ function instrumentClientData(response, correlationId, performanceClient) {
21201
21495
  * @returns
21202
21496
  */
21203
21497
  async function getStandardParameters(config, authority, request, logger, performanceClient) {
21204
- const parameters = getStandardAuthorizeRequestParameters({ ...config.auth, authority: authority }, request, logger, performanceClient);
21498
+ const parameters = getStandardAuthorizeRequestParameters({ ...config.auth, authority: authority }, {
21499
+ ...request,
21500
+ /*
21501
+ * Computed here rather than per flow so every authorize request
21502
+ * carries it — GET, POST and EAR, interactive and silent alike.
21503
+ * A request may assert it instead when the topology, rather than
21504
+ * the current window, is what makes the popup unreachable.
21505
+ */
21506
+ popupOriginCheckDone: request.popupOriginCheckDone ?? computePocd(config) === 1,
21507
+ }, logger, performanceClient);
21205
21508
  addLibraryInfo(parameters, {
21206
21509
  sku: BrowserConstants.MSAL_SKU,
21207
21510
  version: version,
@@ -21255,6 +21558,15 @@ async function getAuthCodeRequestUrl(config, authority, request, logger, perform
21255
21558
  });
21256
21559
  return getAuthorizeUrl(authority, parameters);
21257
21560
  }
21561
+ function getAuthorizeFormAction(authority, request, parameters) {
21562
+ const queryParams = new Map();
21563
+ addExtraParameters(queryParams, request.extraQueryParameters || {});
21564
+ if (parameters.has(POPUP_ORIGIN_CHECK_DONE)) {
21565
+ queryParams.delete(POPUP_ORIGIN_CHECK_DONE);
21566
+ }
21567
+ addCorrelationId(queryParams, request.correlationId);
21568
+ return getAuthorizeUrl(authority, queryParams);
21569
+ }
21258
21570
  /**
21259
21571
  * Builds the action URL + POST-body fields for the EAR /authorize form.
21260
21572
  */
@@ -21270,11 +21582,7 @@ async function getEARFormData(config, authority, request, logger, performanceCli
21270
21582
  addExtraParameters(parameters, {
21271
21583
  ...request.extraParameters,
21272
21584
  });
21273
- const queryParams = new Map();
21274
- addExtraParameters(queryParams, request.extraQueryParameters || {});
21275
- // Add correlationId to query params so gateway can propagate it to IDPs
21276
- addCorrelationId(queryParams, request.correlationId);
21277
- const action = getAuthorizeUrl(authority, queryParams);
21585
+ const action = getAuthorizeFormAction(authority, request, parameters);
21278
21586
  return { action, fields: Object.fromEntries(parameters) };
21279
21587
  }
21280
21588
  /**
@@ -21295,12 +21603,7 @@ async function getCodeFormData(config, authority, request, logger, performanceCl
21295
21603
  addExtraParameters(parameters, {
21296
21604
  ...request.extraParameters,
21297
21605
  });
21298
- // Add extraQueryParameters to be appended to request URL
21299
- const queryParams = new Map();
21300
- addExtraParameters(queryParams, request.extraQueryParameters || {});
21301
- // Add correlationId to query params so gateway can propagate it to IDPs
21302
- addCorrelationId(queryParams, request.correlationId);
21303
- const action = getAuthorizeUrl(authority, queryParams);
21606
+ const action = getAuthorizeFormAction(authority, request, parameters);
21304
21607
  return { action, fields: Object.fromEntries(parameters) };
21305
21608
  }
21306
21609
  /**
@@ -21687,7 +21990,7 @@ function getHeaderDict(headers) {
21687
21990
  */
21688
21991
  // Default timeout for popup windows and iframes in milliseconds
21689
21992
  const DEFAULT_POPUP_TIMEOUT_MS = 60000;
21690
- const DEFAULT_IFRAME_TIMEOUT_MS = 10000;
21993
+ const DEFAULT_IFRAME_TIMEOUT_MS$1 = 10000;
21691
21994
  const DEFAULT_REDIRECT_TIMEOUT_MS = 30000;
21692
21995
  const DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;
21693
21996
  /**
@@ -21728,6 +22031,8 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
21728
22031
  instanceAware: false,
21729
22032
  isMcp: false,
21730
22033
  verifySSO: false,
22034
+ // Legacy polling needs COOP omitted, so it implies asserting pocd=1.
22035
+ originCheck: !userInputSystem?.enableLegacyPolling,
21731
22036
  };
21732
22037
  // Default cache options for browser
21733
22038
  const DEFAULT_CACHE_OPTIONS = {
@@ -21752,7 +22057,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
21752
22057
  : StubbedNetworkModule,
21753
22058
  navigationClient: new NavigationClient(),
21754
22059
  popupBridgeTimeout: userInputSystem?.popupBridgeTimeout || DEFAULT_POPUP_TIMEOUT_MS,
21755
- iframeBridgeTimeout: userInputSystem?.iframeBridgeTimeout || DEFAULT_IFRAME_TIMEOUT_MS,
22060
+ iframeBridgeTimeout: userInputSystem?.iframeBridgeTimeout || DEFAULT_IFRAME_TIMEOUT_MS$1,
21756
22061
  redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,
21757
22062
  allowRedirectInIframe: false,
21758
22063
  navigatePopups: true,
@@ -21761,6 +22066,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
21761
22066
  DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS,
21762
22067
  protocolMode: ProtocolMode.AAD,
21763
22068
  serverTelemetryEnabled: false,
22069
+ enableLegacyPolling: false,
21764
22070
  };
21765
22071
  const providedSystemOptions = {
21766
22072
  ...DEFAULT_BROWSER_SYSTEM_OPTIONS,
@@ -21778,11 +22084,17 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
21778
22084
  iframeTimeoutTelemetry: false,
21779
22085
  allowPlatformBrokerWithDOM: false,
21780
22086
  };
22087
+ let logger;
22088
+ const getLogger = () => {
22089
+ if (!logger) {
22090
+ logger = new Logger(providedSystemOptions.loggerOptions, name, version);
22091
+ }
22092
+ return logger;
22093
+ };
21781
22094
  // Throw an error if user has set OIDCOptions without being in OIDC protocol mode
21782
22095
  if (userInputSystem?.protocolMode !== ProtocolMode.OIDC &&
21783
22096
  userInputAuth?.OIDCOptions) {
21784
- const logger = new Logger(providedSystemOptions.loggerOptions, name, version);
21785
- logger.warning(JSON.stringify(createClientConfigurationError(cannotSetOIDCOptions, "")), "");
22097
+ getLogger().warning(JSON.stringify(createClientConfigurationError(cannotSetOIDCOptions, "")), "");
21786
22098
  }
21787
22099
  // Throw an error if user has set allowPlatformBroker to true with OIDC protocol mode
21788
22100
  if (userInputSystem?.protocolMode &&
@@ -21790,6 +22102,24 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
21790
22102
  providedSystemOptions?.allowPlatformBroker) {
21791
22103
  throw createClientConfigurationError(cannotAllowPlatformBroker, "");
21792
22104
  }
22105
+ /*
22106
+ * The origin check computes 0 in the embedded contexts legacy polling
22107
+ * serves, so re-enabling it there breaks the flow. Honor it, but warn.
22108
+ */
22109
+ if (userInputSystem?.enableLegacyPolling &&
22110
+ userInputAuth?.originCheck === true) {
22111
+ getLogger().warning("buildConfiguration: system.enableLegacyPolling is true and auth.originCheck is explicitly true. Legacy polling requires pocd=1, which the origin check will not produce in an embedded context. Unset auth.originCheck to let legacy polling assert it.", "");
22112
+ }
22113
+ /*
22114
+ * Opting out is a deliberate risk transfer, not an error — but the app
22115
+ * cannot know at config time that the risky topology is actually present.
22116
+ */
22117
+ if ((userInputAuth?.originCheck ?? DEFAULT_AUTH_OPTIONS.originCheck) ===
22118
+ false &&
22119
+ typeof window !== "undefined" &&
22120
+ !topOpenerIsSameOriginOrAbsent(window)) {
22121
+ getLogger().warning("buildConfiguration: auth.originCheck is disabled and the top-level window has a cross-origin opener. MSAL will assert pocd=1, so the STS omits Cross-Origin-Opener-Policy and that opener can reach the auth popup. The application is responsible for this risk.", "");
22122
+ }
21793
22123
  const overlayedConfig = {
21794
22124
  auth: {
21795
22125
  ...DEFAULT_AUTH_OPTIONS,
@@ -22598,6 +22928,9 @@ class PopupClient extends StandardInteractionClient {
22598
22928
  popupWindowAttributes: logoutRequest?.popupWindowAttributes || {},
22599
22929
  popupWindowParent: logoutRequest?.popupWindowParent ?? window,
22600
22930
  };
22931
+ validLogoutRequest.popupOriginCheckDone =
22932
+ this.getPopupOriginCheckDone(popupParams.popupWindowParent) ??
22933
+ validLogoutRequest.popupOriginCheckDone;
22601
22934
  const authority = logoutRequest && logoutRequest.authority;
22602
22935
  const mainWindowRedirectUri = logoutRequest && logoutRequest.mainWindowRedirectUri;
22603
22936
  // navigatePopups flag set to false. Acquires token without first opening popup. Popup will be opened later asynchronously.
@@ -22662,6 +22995,7 @@ class PopupClient extends StandardInteractionClient {
22662
22995
  ...request,
22663
22996
  codeChallenge: pkce.challenge,
22664
22997
  ...tokenBindingParams,
22998
+ popupOriginCheckDone: this.getPopupOriginCheckDone(popupParams.popupWindowParent),
22665
22999
  };
22666
23000
  try {
22667
23001
  // Initialize the client
@@ -22725,6 +23059,7 @@ class PopupClient extends StandardInteractionClient {
22725
23059
  earJwk: earJwk,
22726
23060
  codeChallenge: pkce.challenge,
22727
23061
  ...tokenBindingParams,
23062
+ popupOriginCheckDone: this.getPopupOriginCheckDone(popupParams.popupWindowParent),
22728
23063
  };
22729
23064
  const popupWindow = await this.openPostFormPopup(popupRequest, discoveredAuthority, popupParams, correlationId, true);
22730
23065
  // Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
@@ -22997,6 +23332,27 @@ class PopupClient extends StandardInteractionClient {
22997
23332
  getRelayStateId(state, correlationId) {
22998
23333
  return parseRequestState(base64Decode, state, correlationId).libraryState.id;
22999
23334
  }
23335
+ /**
23336
+ * Asserts `pocd=1` for the relay flow. Direct popups also require the
23337
+ * environment of a delegated opening window to pass the origin check.
23338
+ *
23339
+ * With a relay the IdP window is a grandchild popup, which an untrusted
23340
+ * ancestor cannot reach by name — so the topology satisfies the check by
23341
+ * construction. The current window is framed and would otherwise compute
23342
+ * `0`. Without a delegated parent, the standard app check remains unchanged.
23343
+ *
23344
+ * @param popupWindowParent Window that opens the popup.
23345
+ */
23346
+ getPopupOriginCheckDone(popupWindowParent) {
23347
+ if (this.config.auth.popupRelayUri) {
23348
+ return true;
23349
+ }
23350
+ if (popupWindowParent !== window) {
23351
+ return (computePocd(this.config) === 1 &&
23352
+ computePocd(this.config, popupWindowParent) === 1);
23353
+ }
23354
+ return undefined;
23355
+ }
23000
23356
  /**
23001
23357
  * Opens the interactive popup for a POST-form /authorize request. Shared by
23002
23358
  * the auth-code POST and EAR flows, which are identical apart from the form
@@ -23319,7 +23675,6 @@ class RedirectClient extends StandardInteractionClient {
23319
23675
  }
23320
23676
  return [null, ""];
23321
23677
  }
23322
- clearHash(window);
23323
23678
  this.logger.verbose("00uvho", this.correlationId);
23324
23679
  return [response, responseString];
23325
23680
  }
@@ -24278,7 +24633,32 @@ class StandardController {
24278
24633
  * @returns
24279
24634
  */
24280
24635
  async handleRedirectPromiseInternal(options) {
24281
- if (!this.browserStorage.isInteractionInProgress(true)) {
24636
+ // Preserve the response for RedirectClient before removing it from the URL.
24637
+ const responseString = options?.hash ||
24638
+ (this.config.auth.OIDCOptions.responseMode ===
24639
+ ResponseMode.QUERY
24640
+ ? window.location.search
24641
+ : window.location.hash);
24642
+ const anyClientInteractionInProgress = this.browserStorage.isInteractionInProgress(false);
24643
+ const currentClientInteraction = this.browserStorage.isInteractionInProgress(true);
24644
+ const isBridgeCallback = isInPopup() ||
24645
+ (isInIframe() &&
24646
+ !this.config.system.allowRedirectInIframe);
24647
+ /*
24648
+ * Clear recognized response fragments for:
24649
+ * - Stale callbacks with no pending interaction.
24650
+ * - This client's login callback, even if request setup or response validation fails.
24651
+ * - This client's logout callback containing state, before the SIGNOUT early return.
24652
+ * Leave another client's callback untouched. clearHash preserves query strings
24653
+ * and application routes, and does nothing when no response fragment is present.
24654
+ * Skip popup and non-redirect iframe callbacks: legacy apps may call HRP
24655
+ * before their redirect bridge reads and broadcasts the response.
24656
+ */
24657
+ if (!isBridgeCallback &&
24658
+ (!anyClientInteractionInProgress || currentClientInteraction)) {
24659
+ clearHash(window);
24660
+ }
24661
+ if (!currentClientInteraction) {
24282
24662
  this.logger.info("0le6uv", "");
24283
24663
  return null;
24284
24664
  }
@@ -24286,7 +24666,7 @@ class StandardController {
24286
24666
  if (interactionType === INTERACTION_TYPE.SIGNOUT) {
24287
24667
  this.logger.verbose("1ywcv2", "");
24288
24668
  this.browserStorage.setInteractionInProgress(false);
24289
- return Promise.resolve(null);
24669
+ return null;
24290
24670
  }
24291
24671
  const loggedInAccounts = this.getAllAccounts();
24292
24672
  const platformBrokerRequest = this.browserStorage.getCachedNativeRequest();
@@ -24316,7 +24696,9 @@ class StandardController {
24316
24696
  rootMeasurement = this.performanceClient.startMeasurement(AcquireTokenRedirect, correlationId);
24317
24697
  this.logger.trace("0znzs5", correlationId);
24318
24698
  const redirectClient = this.createRedirectClient(correlationId);
24319
- redirectResponse = invokeAsync(redirectClient.handleRedirectPromise.bind(redirectClient), HandleRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(standardRequest, codeVerifier, rootMeasurement, options);
24699
+ redirectResponse = invokeAsync(redirectClient.handleRedirectPromise.bind(redirectClient), HandleRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)(standardRequest, codeVerifier, rootMeasurement, options?.hash
24700
+ ? options
24701
+ : { ...options, hash: responseString });
24320
24702
  }
24321
24703
  }
24322
24704
  catch (e) {
@@ -24464,6 +24846,9 @@ class StandardController {
24464
24846
  this.logger.verbose("0ch87b", correlationId);
24465
24847
  preflightCheck(this.initialized, atPopupMeasurement, this.config, request);
24466
24848
  this.browserStorage.setInteractionInProgress(true, INTERACTION_TYPE.SIGNIN, request.overrideInteractionInProgress, correlationId);
24849
+ if (request.overrideInteractionInProgress) {
24850
+ cancelPendingPopupPollingResponse(this.logger);
24851
+ }
24467
24852
  }
24468
24853
  catch (e) {
24469
24854
  // Since this function is syncronous we need to reject
@@ -26562,6 +26947,79 @@ NestedAppOperatingContext.MODULE_NAME = "";
26562
26947
  */
26563
26948
  NestedAppOperatingContext.ID = "NestedAppOperatingContext";
26564
26949
 
26950
+ /*
26951
+ * Copyright (c) Microsoft Corporation. All rights reserved.
26952
+ * Licensed under the MIT License.
26953
+ */
26954
+ const IFRAME_POLL_INTERVAL_MS = 50;
26955
+ const DEFAULT_IFRAME_TIMEOUT_MS = 10000;
26956
+ /**
26957
+ * Monitors an iframe content window until it loads a URL with a known hash, or hits a specified timeout.
26958
+ *
26959
+ * @param iframe - The hidden iframe to monitor.
26960
+ * @param timeout - Maximum time (ms) to wait for navigation before rejecting with
26961
+ * `monitor_window_timeout`.
26962
+ * @param logger - Logger instance.
26963
+ * @param correlationId
26964
+ * @param responseMode - `"query"` or `"fragment"` — determines whether to read
26965
+ * `location.search` or `location.hash`. Any value other than `"query"` is
26966
+ * treated as fragment.
26967
+ */
26968
+ async function monitorIframeForHash(iframe, timeout, logger, correlationId, responseMode) {
26969
+ return new Promise((resolve, reject) => {
26970
+ if (timeout < DEFAULT_IFRAME_TIMEOUT_MS) {
26971
+ logger.warning(`137tec ${timeout} ${DEFAULT_IFRAME_TIMEOUT_MS}`, correlationId);
26972
+ }
26973
+ /*
26974
+ * Polling for iframes can be purely timing based,
26975
+ * since we don't need to account for interaction.
26976
+ */
26977
+ const timeoutId = window.setTimeout(() => {
26978
+ window.clearInterval(intervalId);
26979
+ reject(new AuthError(timedOut, correlationId, undefined, "monitor_window_timeout"));
26980
+ }, timeout);
26981
+ const intervalId = window.setInterval(() => {
26982
+ const contentWindow = iframe.contentWindow;
26983
+ if (!contentWindow) {
26984
+ return;
26985
+ }
26986
+ let href = "";
26987
+ try {
26988
+ /*
26989
+ * Will throw if cross origin,
26990
+ * which should be caught and ignored
26991
+ * since we need the interval to keep running while on STS UI.
26992
+ */
26993
+ href = contentWindow.location.href;
26994
+ }
26995
+ catch (e) { }
26996
+ if (!href || href === "about:blank") {
26997
+ return;
26998
+ }
26999
+ const responseString = responseMode === ResponseMode.QUERY
27000
+ ? contentWindow.location.search
27001
+ : contentWindow.location.hash;
27002
+ window.clearTimeout(timeoutId);
27003
+ window.clearInterval(intervalId);
27004
+ resolve(responseString);
27005
+ }, IFRAME_POLL_INTERVAL_MS);
27006
+ }).finally(() => {
27007
+ /*
27008
+ * Strip auth-response params from the iframe URL. The monitor owns the
27009
+ * iframe for the duration of the poll, mirroring cleanPopup in
27010
+ * PopupMonitor.
27011
+ */
27012
+ try {
27013
+ if (iframe.contentWindow) {
27014
+ clearAuthResponseFromUrl(iframe.contentWindow);
27015
+ }
27016
+ }
27017
+ catch {
27018
+ // Iframe may already be navigated away or cross-origin; ignore.
27019
+ }
27020
+ });
27021
+ }
27022
+
26565
27023
  /*
26566
27024
  * Copyright (c) Microsoft Corporation. All rights reserved.
26567
27025
  * Licensed under the MIT License.
@@ -26604,27 +27062,29 @@ class PublicClientApplication {
26604
27062
  /**
26605
27063
  * Waits for the auth response from a popup window opened by MSAL.
26606
27064
  *
26607
- * The default implementation delegates to MSAL's `BroadcastChannel`-based bridge.
26608
- * Subclasses must return the raw response string (hash/query/fragment), or reject
26609
- * with an `AuthError` on failure.
27065
+ * The default implementation delegates to MSAL's `BroadcastChannel`-based bridge,
27066
+ * or to the v4-style same-origin location poller when
27067
+ * `system.enableLegacyPolling` is set. Subclasses must return the raw response
27068
+ * string (hash/query/fragment), or reject with an `AuthError` on failure.
26610
27069
  *
26611
27070
  * @internal
26612
27071
  * @param request The in-flight authorization or end-session request.
26613
27072
  * @param popupWindow The popup window opened by MSAL.
26614
27073
  * @param popupWindowParent The parent window that opened the popup.
26615
27074
  */
26616
- async waitForPopupResponse(request,
26617
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
26618
- popupWindow,
26619
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
26620
- popupWindowParent) {
27075
+ async waitForPopupResponse(request, popupWindow, popupWindowParent) {
26621
27076
  const controller = this.controller;
26622
- return waitForBridgeResponse(controller.getConfiguration().system.popupBridgeTimeout, controller.getLogger(), request, controller.getPerformanceClient());
27077
+ const config = controller.getConfiguration();
27078
+ if (config.system.enableLegacyPolling) {
27079
+ return waitForPopupPollingResponse(config, controller.getLogger(), controller.getPerformanceClient(), request, popupWindow, popupWindowParent);
27080
+ }
27081
+ return waitForBridgeResponse(config.system.popupBridgeTimeout, controller.getLogger(), request, controller.getPerformanceClient());
26623
27082
  }
26624
27083
  /**
26625
27084
  * Waits for the auth response from a hidden iframe used by MSAL silent flows.
26626
27085
  *
26627
- * The default implementation delegates to MSAL's `BroadcastChannel`-based bridge.
27086
+ * The default implementation delegates to MSAL's `BroadcastChannel`-based bridge,
27087
+ * or to the v4-style location poller when `system.enableLegacyPolling` is set.
26628
27088
  * Subclasses must return the raw response string (hash/query/fragment), or reject
26629
27089
  * with an `AuthError` on failure.
26630
27090
  *
@@ -26632,11 +27092,12 @@ class PublicClientApplication {
26632
27092
  * @param iframe The hidden iframe MSAL attached to the document.
26633
27093
  * @param request The in-flight authorization request.
26634
27094
  */
26635
- async waitForIframeResponse(
26636
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
26637
- iframe, request) {
27095
+ async waitForIframeResponse(iframe, request) {
26638
27096
  const controller = this.controller;
26639
27097
  const config = controller.getConfiguration();
27098
+ if (config.system.enableLegacyPolling) {
27099
+ return waitForIframePollingResponse(config, controller.getLogger(), controller.getPerformanceClient(), iframe, request);
27100
+ }
26640
27101
  return waitForBridgeResponse(config.system.iframeBridgeTimeout, controller.getLogger(), request, controller.getPerformanceClient(), config.experimental);
26641
27102
  }
26642
27103
  /**
@@ -26869,6 +27330,40 @@ class PublicClientApplication {
26869
27330
  clearCache(logoutRequest) {
26870
27331
  return this.controller.clearCache(logoutRequest);
26871
27332
  }
27333
+ }
27334
+ /**
27335
+ * Collects a popup auth response using the v4-style same-origin location
27336
+ * poller instead of the `BroadcastChannel` redirect bridge.
27337
+ */
27338
+ async function waitForPopupPollingResponse(config, logger, performanceClient, request, popupWindow, popupWindowParent) {
27339
+ const responseMode = config.auth.OIDCOptions?.responseMode === ResponseMode.QUERY
27340
+ ? ResponseMode.QUERY
27341
+ : ResponseMode.FRAGMENT;
27342
+ performanceClient.addFields({ usesLegacyPolling: true }, request.correlationId);
27343
+ const unloadHandler = () => {
27344
+ try {
27345
+ if (popupWindow && !popupWindow.closed) {
27346
+ popupWindow.close();
27347
+ }
27348
+ }
27349
+ catch {
27350
+ /* ignore */
27351
+ }
27352
+ };
27353
+ popupWindowParent.addEventListener("beforeunload", unloadHandler);
27354
+ return monitorPopupForHash(popupWindow, popupWindowParent, responseMode, logger, unloadHandler, request.correlationId);
27355
+ }
27356
+ /**
27357
+ * Collects a silent-iframe auth response using the v4-style location poller
27358
+ * instead of the `BroadcastChannel` redirect bridge.
27359
+ */
27360
+ async function waitForIframePollingResponse(config, logger, performanceClient, iframe, request) {
27361
+ const responseMode = config.auth.OIDCOptions?.responseMode === ResponseMode.QUERY
27362
+ ? ResponseMode.QUERY
27363
+ : ResponseMode.FRAGMENT;
27364
+ const iframePollTimeout = config.system.iframeBridgeTimeout;
27365
+ performanceClient.addFields({ usesLegacyPolling: true, iframePollTimeout }, request.correlationId);
27366
+ return monitorIframeForHash(iframe, iframePollTimeout, logger, request.correlationId, responseMode);
26872
27367
  }
26873
27368
 
26874
27369
  /*