@azure/msal-browser 5.29.1 → 5.31.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 (558) hide show
  1. package/README.md +4 -2
  2. package/dist/app/IPublicClientApplication.mjs +4 -1
  3. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  4. package/dist/app/PublicClientApplication.mjs +14 -2
  5. package/dist/app/PublicClientApplication.mjs.map +1 -1
  6. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +10 -23
  8. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  9. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  10. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +2 -3
  11. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  12. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
  13. package/dist/cache/AccountManager.mjs +1 -1
  14. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  15. package/dist/cache/BrowserCacheManager.mjs +40 -4
  16. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  17. package/dist/cache/CacheHelpers.mjs +1 -1
  18. package/dist/cache/CacheKeys.mjs +1 -1
  19. package/dist/cache/CookieStorage.mjs +1 -1
  20. package/dist/cache/DatabaseStorage.mjs +1 -1
  21. package/dist/cache/EncryptedData.mjs +1 -1
  22. package/dist/cache/LocalStorage.mjs +1 -1
  23. package/dist/cache/MemoryStorage.mjs +1 -1
  24. package/dist/cache/SessionStorage.mjs +1 -1
  25. package/dist/cache/TokenCache.mjs +1 -1
  26. package/dist/config/Configuration.mjs +11 -2
  27. package/dist/config/Configuration.mjs.map +1 -1
  28. package/dist/controllers/NestedAppAuthController.mjs +26 -5
  29. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  30. package/dist/controllers/StandardController.mjs +44 -11
  31. package/dist/controllers/StandardController.mjs.map +1 -1
  32. package/dist/crypto/BrowserCrypto.mjs +189 -5
  33. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  34. package/dist/crypto/CryptoOps.mjs +1 -1
  35. package/dist/crypto/PkceGenerator.mjs +1 -1
  36. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  37. package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
  38. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  39. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -4
  40. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
  41. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +11 -4
  42. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  43. package/dist/custom_auth/core/CustomAuthAuthority.mjs +3 -3
  44. package/dist/custom_auth/core/CustomAuthAuthority.mjs.map +1 -1
  45. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -4
  51. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs.map +1 -1
  52. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -3
  53. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs.map +1 -1
  54. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  56. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -8
  57. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +1 -1
  58. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  59. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -3
  60. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs.map +1 -1
  61. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -3
  62. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs.map +1 -1
  63. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  64. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  65. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -7
  66. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +1 -1
  67. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +1 -2
  68. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
  69. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -2
  70. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
  71. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +1 -1
  72. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +1 -2
  73. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -1
  74. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +1 -2
  75. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs.map +1 -1
  76. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +2 -5
  77. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
  78. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +1 -2
  79. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -1
  80. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
  81. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +1 -2
  82. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
  83. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +1 -2
  84. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -1
  85. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -2
  86. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -1
  87. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +1 -2
  88. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
  89. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +2 -3
  90. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -1
  91. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  92. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  93. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  94. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  95. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  96. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  97. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  98. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  99. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  100. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  101. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  102. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  103. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  104. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  105. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  106. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  107. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  108. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  109. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  110. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  111. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  112. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  113. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +32 -27
  114. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
  115. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +1 -1
  116. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +6 -2
  117. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
  118. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  119. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  120. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  121. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  122. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  123. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  124. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  125. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  126. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  127. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -1
  128. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +7 -5
  129. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs.map +1 -1
  130. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +12 -3
  131. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
  132. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  133. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +9 -39
  134. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs.map +1 -1
  135. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +1 -1
  136. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  137. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
  138. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
  139. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -1
  140. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
  141. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  142. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  143. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +1 -1
  144. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  145. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  146. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  147. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  148. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  149. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  150. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  151. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  152. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  153. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  154. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  155. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  156. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +2 -1
  157. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
  158. package/dist/custom_auth/index.mjs +1 -1
  159. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  160. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  161. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  162. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  163. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  164. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  165. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  166. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  167. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  168. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  169. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  170. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +1 -2
  171. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
  172. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +1 -1
  173. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  174. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  175. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  176. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  177. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -3
  178. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs.map +1 -1
  179. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -3
  180. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs.map +1 -1
  181. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -3
  182. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs.map +1 -1
  183. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  184. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  185. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  186. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  187. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  188. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  189. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +1 -2
  190. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -1
  191. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +1 -1
  192. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  193. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  194. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  195. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  196. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  197. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  198. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  199. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  200. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  201. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  202. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  203. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  204. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  205. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  206. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +1 -2
  207. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
  208. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +1 -1
  209. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +1 -1
  210. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +1 -1
  211. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +1 -1
  212. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  213. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  214. package/dist/encode/Base64Decode.mjs +1 -1
  215. package/dist/encode/Base64Encode.mjs +1 -1
  216. package/dist/error/BrowserAuthError.mjs +1 -1
  217. package/dist/error/BrowserAuthErrorCodes.mjs +3 -2
  218. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
  219. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  220. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  221. package/dist/error/NativeAuthError.mjs +1 -1
  222. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  223. package/dist/error/NestedAppAuthError.mjs +1 -1
  224. package/dist/event/EventHandler.mjs +1 -1
  225. package/dist/event/EventMessage.mjs +1 -1
  226. package/dist/event/EventType.mjs +1 -1
  227. package/dist/index.mjs +1 -1
  228. package/dist/interaction_client/BaseInteractionClient.mjs +4 -2
  229. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  230. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  231. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +18 -5
  232. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  233. package/dist/interaction_client/PopupClient.mjs +27 -21
  234. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  235. package/dist/interaction_client/RedirectClient.mjs +8 -10
  236. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  237. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  238. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  239. package/dist/interaction_client/SilentIframeClient.mjs +5 -8
  240. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  241. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  242. package/dist/interaction_client/StandardInteractionClient.mjs +2 -1
  243. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  244. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  245. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  246. package/dist/log-strings-mapping.json +13 -9
  247. package/dist/naa/BridgeError.mjs +1 -1
  248. package/dist/naa/BridgeProxy.mjs +1 -1
  249. package/dist/naa/BridgeStatusCode.mjs +1 -1
  250. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  251. package/dist/navigation/NavigationClient.mjs +1 -1
  252. package/dist/network/FetchClient.mjs +1 -1
  253. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  254. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  255. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  256. package/dist/packageMetadata.mjs +2 -2
  257. package/dist/popup_relay/constants.mjs +24 -6
  258. package/dist/popup_relay/constants.mjs.map +1 -1
  259. package/dist/popup_relay/index.mjs +142 -44
  260. package/dist/popup_relay/index.mjs.map +1 -1
  261. package/dist/popup_relay/relayClient.mjs +66 -23
  262. package/dist/popup_relay/relayClient.mjs.map +1 -1
  263. package/dist/protocol/Authorize.mjs +71 -13
  264. package/dist/protocol/Authorize.mjs.map +1 -1
  265. package/dist/redirect_bridge/index.mjs +1 -1
  266. package/dist/request/RequestHelpers.mjs +2 -1
  267. package/dist/request/RequestHelpers.mjs.map +1 -1
  268. package/dist/request/SilentRequestHelpers.mjs +7 -4
  269. package/dist/request/SilentRequestHelpers.mjs.map +1 -1
  270. package/dist/response/ResponseHandler.mjs +1 -1
  271. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  272. package/dist/telemetry/BrowserPerformanceEvents.mjs +14 -2
  273. package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
  274. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  275. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  276. package/dist/utils/BrowserConstants.mjs +1 -1
  277. package/dist/utils/BrowserDetection.mjs +1 -1
  278. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  279. package/dist/utils/BrowserUtils.mjs +1 -1
  280. package/dist/utils/Helpers.mjs +1 -1
  281. package/dist/utils/IframeMonitor.mjs +1 -1
  282. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  283. package/dist/utils/PopupMonitor.mjs +1 -1
  284. package/dist/utils/PopupOriginCheck.mjs +1 -1
  285. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  286. package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
  287. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  288. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  289. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  290. package/dist/webBrokerBridge/index.mjs +1 -1
  291. package/lib/custom-auth-path/log-strings-mapping.json +13 -9
  292. package/lib/custom-auth-path/msal-custom-auth.cjs +764 -314
  293. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  294. package/lib/custom-auth-path/msal-custom-auth.js +764 -314
  295. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  296. package/lib/log-strings-mapping.json +13 -9
  297. package/lib/msal-browser.cjs +791 -215
  298. package/lib/msal-browser.cjs.map +1 -1
  299. package/lib/msal-browser.js +791 -215
  300. package/lib/msal-browser.js.map +1 -1
  301. package/lib/msal-browser.min.js +2 -2
  302. package/lib/popup-relay/msal-popup-relay.cjs +231 -60
  303. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  304. package/lib/popup-relay/msal-popup-relay.js +231 -60
  305. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  306. package/lib/popup-relay/msal-popup-relay.min.js +2 -2
  307. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  308. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  309. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  310. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  311. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  312. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
  313. package/package.json +2 -2
  314. package/src/app/IPublicClientApplication.ts +16 -0
  315. package/src/app/PublicClientApplication.ts +22 -0
  316. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +11 -44
  317. package/src/broker/nativeBroker/PlatformAuthProvider.ts +1 -2
  318. package/src/broker/nativeBroker/PlatformAuthResponse.ts +2 -6
  319. package/src/cache/BrowserCacheManager.ts +66 -6
  320. package/src/config/Configuration.ts +35 -0
  321. package/src/controllers/NestedAppAuthController.ts +35 -2
  322. package/src/controllers/StandardController.ts +76 -12
  323. package/src/controllers/UnknownOperatingContextController.ts +10 -0
  324. package/src/crypto/BrowserCrypto.ts +367 -2
  325. package/src/custom_auth/CustomAuthActionInputs.ts +0 -9
  326. package/src/custom_auth/CustomAuthPublicClientApplication.ts +0 -3
  327. package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +0 -3
  328. package/src/custom_auth/controller/CustomAuthStandardController.ts +15 -2
  329. package/src/custom_auth/core/CustomAuthAuthority.ts +2 -1
  330. package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.ts +0 -3
  331. package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.ts +0 -2
  332. package/src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.ts +0 -7
  333. package/src/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.ts +0 -2
  334. package/src/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.ts +0 -2
  335. package/src/custom_auth/core/auth_flow/mfa/state/MfaState.ts +0 -6
  336. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +0 -1
  337. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +0 -1
  338. package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +0 -4
  339. package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +0 -1
  340. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +0 -1
  341. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +0 -2
  342. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +0 -2
  343. package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +0 -2
  344. package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +0 -2
  345. package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +0 -2
  346. package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -2
  347. package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +0 -2
  348. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +0 -1
  349. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +0 -3
  350. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +0 -1
  351. package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +0 -1
  352. package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +0 -1
  353. package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +0 -1
  354. package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +0 -1
  355. package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +8 -6
  356. package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +1 -0
  357. package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +43 -29
  358. package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +21 -2
  359. package/src/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.ts +12 -8
  360. package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +35 -4
  361. package/src/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.ts +10 -47
  362. package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +1 -0
  363. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +9 -0
  364. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +5 -5
  365. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +2 -5
  366. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +2 -4
  367. package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +1 -0
  368. package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +0 -2
  369. package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +0 -1
  370. package/src/custom_auth/sign_in/auth_flow/result/SignInResult.ts +0 -2
  371. package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.ts +0 -2
  372. package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.ts +0 -2
  373. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +0 -2
  374. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +0 -2
  375. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +0 -1
  376. package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +0 -2
  377. package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +0 -2
  378. package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +0 -1
  379. package/src/error/AsymmetricEarSubErrors.ts +18 -0
  380. package/src/error/BrowserAuthErrorCodes.ts +1 -0
  381. package/src/interaction_client/BaseInteractionClient.ts +6 -1
  382. package/src/interaction_client/PlatformAuthInteractionClient.ts +28 -8
  383. package/src/interaction_client/PopupClient.ts +59 -29
  384. package/src/interaction_client/RedirectClient.ts +10 -13
  385. package/src/interaction_client/SilentIframeClient.ts +9 -13
  386. package/src/interaction_client/StandardInteractionClient.ts +1 -0
  387. package/src/packageMetadata.ts +1 -1
  388. package/src/popup_relay/constants.ts +34 -3
  389. package/src/popup_relay/index.ts +200 -45
  390. package/src/popup_relay/relayClient.ts +108 -24
  391. package/src/protocol/Authorize.ts +123 -11
  392. package/src/request/EndSessionPopupRequest.ts +3 -0
  393. package/src/request/PopupRequest.ts +1 -0
  394. package/src/request/RedirectRequest.ts +4 -0
  395. package/src/request/RequestHelpers.ts +5 -0
  396. package/src/request/SilentRequestHelpers.ts +10 -4
  397. package/src/request/SsoSilentRequest.ts +1 -0
  398. package/src/telemetry/BrowserPerformanceEvents.ts +14 -0
  399. package/types/app/IPublicClientApplication.d.ts +8 -0
  400. package/types/app/IPublicClientApplication.d.ts.map +1 -1
  401. package/types/app/PublicClientApplication.d.ts +6 -1
  402. package/types/app/PublicClientApplication.d.ts.map +1 -1
  403. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +0 -1
  404. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  405. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  406. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +2 -6
  407. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
  408. package/types/cache/BrowserCacheManager.d.ts +20 -2
  409. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  410. package/types/config/Configuration.d.ts +14 -0
  411. package/types/config/Configuration.d.ts.map +1 -1
  412. package/types/controllers/NestedAppAuthController.d.ts +5 -0
  413. package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  414. package/types/controllers/StandardController.d.ts +4 -0
  415. package/types/controllers/StandardController.d.ts.map +1 -1
  416. package/types/controllers/UnknownOperatingContextController.d.ts +5 -0
  417. package/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
  418. package/types/crypto/BrowserCrypto.d.ts +34 -0
  419. package/types/crypto/BrowserCrypto.d.ts.map +1 -1
  420. package/types/custom_auth/CustomAuthActionInputs.d.ts +0 -9
  421. package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  422. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  423. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +0 -3
  424. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
  425. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +0 -3
  426. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
  427. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  428. package/types/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
  429. package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +0 -3
  430. package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -1
  431. package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +0 -2
  432. package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -1
  433. package/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +0 -7
  434. package/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -1
  435. package/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +0 -2
  436. package/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -1
  437. package/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +0 -2
  438. package/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -1
  439. package/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +0 -6
  440. package/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -1
  441. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +0 -1
  442. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -1
  443. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +0 -1
  444. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -1
  445. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +0 -4
  446. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -1
  447. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +0 -1
  448. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
  449. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +0 -1
  450. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -1
  451. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +0 -2
  452. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts.map +1 -1
  453. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +0 -2
  454. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -1
  455. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +0 -2
  456. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
  457. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +0 -2
  458. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
  459. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +0 -2
  460. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
  461. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -2
  462. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -1
  463. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +0 -2
  464. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
  465. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +0 -1
  466. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts.map +1 -1
  467. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +0 -1
  468. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
  469. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +0 -1
  470. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -1
  471. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +0 -1
  472. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
  473. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +0 -1
  474. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
  475. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +0 -1
  476. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -1
  477. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +0 -1
  478. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
  479. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -1
  480. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -1
  481. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +1 -0
  482. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
  483. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +3 -2
  484. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
  485. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +10 -1
  486. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
  487. package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts +1 -1
  488. package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts.map +1 -1
  489. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
  490. package/types/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.d.ts.map +1 -1
  491. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +1 -0
  492. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
  493. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +8 -0
  494. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
  495. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts +4 -5
  496. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
  497. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +3 -6
  498. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
  499. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +2 -5
  500. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
  501. package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  502. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +0 -2
  503. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
  504. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +0 -1
  505. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
  506. package/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts +0 -2
  507. package/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -1
  508. package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +0 -2
  509. package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -1
  510. package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +0 -2
  511. package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -1
  512. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +0 -2
  513. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -1
  514. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +0 -2
  515. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
  516. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +0 -1
  517. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
  518. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +0 -2
  519. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -1
  520. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +0 -2
  521. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
  522. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +0 -1
  523. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
  524. package/types/error/AsymmetricEarSubErrors.d.ts +14 -0
  525. package/types/error/AsymmetricEarSubErrors.d.ts.map +1 -0
  526. package/types/error/BrowserAuthErrorCodes.d.ts +1 -0
  527. package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
  528. package/types/interaction_client/BaseInteractionClient.d.ts +3 -2
  529. package/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  530. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  531. package/types/interaction_client/PopupClient.d.ts +3 -1
  532. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  533. package/types/interaction_client/RedirectClient.d.ts +0 -1
  534. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  535. package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  536. package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  537. package/types/packageMetadata.d.ts +1 -1
  538. package/types/popup_relay/constants.d.ts +10 -3
  539. package/types/popup_relay/constants.d.ts.map +1 -1
  540. package/types/popup_relay/index.d.ts +27 -11
  541. package/types/popup_relay/index.d.ts.map +1 -1
  542. package/types/popup_relay/relayClient.d.ts +9 -11
  543. package/types/popup_relay/relayClient.d.ts.map +1 -1
  544. package/types/protocol/Authorize.d.ts +5 -0
  545. package/types/protocol/Authorize.d.ts.map +1 -1
  546. package/types/request/EndSessionPopupRequest.d.ts +3 -0
  547. package/types/request/EndSessionPopupRequest.d.ts.map +1 -1
  548. package/types/request/PopupRequest.d.ts +1 -1
  549. package/types/request/PopupRequest.d.ts.map +1 -1
  550. package/types/request/RedirectRequest.d.ts +4 -1
  551. package/types/request/RedirectRequest.d.ts.map +1 -1
  552. package/types/request/RequestHelpers.d.ts.map +1 -1
  553. package/types/request/SilentRequestHelpers.d.ts +1 -1
  554. package/types/request/SilentRequestHelpers.d.ts.map +1 -1
  555. package/types/request/SsoSilentRequest.d.ts +1 -1
  556. package/types/request/SsoSilentRequest.d.ts.map +1 -1
  557. package/types/telemetry/BrowserPerformanceEvents.d.ts +12 -0
  558. package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
@@ -1,8 +1,9 @@
1
- /*! @azure/msal-browser v5.29.1 2026-11-12 */
1
+ /*! @azure/msal-browser v5.31.0 2026-12-02 */
2
2
  'use strict';
3
- import { POPUP_RELAY_RESPONSE_TYPE } from './constants.mjs';
4
- import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
3
+ import { getPopupRelayProtocolVersion, POPUP_RELAY_RESPONSE_TYPE, POPUP_RELAY_V2_RESPONSE_TYPE, POPUP_RELAY_READY_TYPE, POPUP_RELAY_REQUEST_TYPE } from './constants.mjs';
4
+ import { createBrowserAuthError, BrowserAuthError } from '../error/BrowserAuthError.mjs';
5
5
  import { createForm } from '../protocol/Authorize.mjs';
6
+ import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
6
7
  import { popupRelayUnsupportedFlow, popupWindowError, userCancelled, timedOut } from '../error/BrowserAuthErrorCodes.mjs';
7
8
 
8
9
  /*
@@ -51,12 +52,10 @@ function normalizeAllowedOrigins(allowedAuthorityOrigins) {
51
52
  });
52
53
  }
53
54
  /**
54
- * Validates a navigation target taken from the relay page's hash before it can
55
+ * Validates a navigation target before it can
55
56
  * reach `window.open` or a form `action`.
56
57
  *
57
- * The hash is *not* authority: anyone can craft a link to the deployed relay
58
- * page, so a target must be proven safe rather than assumed to have been built
59
- * by MSAL. Only absolute `https:` URLs without embedded credentials are
58
+ * Only absolute `https:` URLs without embedded credentials are
60
59
  * accepted, which rules out active/local schemes (`javascript:`, `data:`,
61
60
  * `blob:`, `vbscript:`, `file:`) that would otherwise execute in — or read
62
61
  * from — the relay page's own first-party security origin. `https:`-only also
@@ -99,24 +98,16 @@ function validateNavigationTarget(raw, allowedAuthorityOrigins) {
99
98
  return raw;
100
99
  }
101
100
  /**
102
- * Parses and fully validates the relayed request carried in the relay page's
103
- * hash. Every field is treated as attacker-controlled: the shape is checked
104
- * exactly (no implicit GET fallback for an unknown `method`) and both
101
+ * Fully validates a v1 descriptor or an authenticated v2 request. The shape
102
+ * is checked exactly (no implicit GET fallback for an unknown `method`) and both
105
103
  * navigation targets — the GET `url` and the POST `action` — are run through
106
104
  * {@link validateNavigationTarget}.
107
105
  */
108
106
  function parseRelayRequest(rawReq, allowedAuthorityOrigins) {
109
- let parsed;
110
- try {
111
- parsed = JSON.parse(rawReq);
112
- }
113
- catch (e) {
114
- parsed = null;
115
- }
116
- if (typeof parsed !== "object" || parsed === null) {
107
+ if (typeof rawReq !== "object" || rawReq === null) {
117
108
  throwRelayError(BAD_REQUEST_SUBERROR);
118
109
  }
119
- const request = parsed;
110
+ const request = rawReq;
120
111
  const id = request.id;
121
112
  if (typeof id !== "string" || !id) {
122
113
  throwRelayError(BAD_REQUEST_SUBERROR);
@@ -169,17 +160,22 @@ function buildChildPopupFeatures(attributes) {
169
160
  /**
170
161
  * Entry point for the top-level "popup-relay" page referenced by
171
162
  * `auth.popupRelayUri`. Call this from the relay page (which MSAL opens as a
172
- * top-level popup from inside an embedded, cross-origin iframe). It:
163
+ * top-level popup from inside an embedded, cross-origin iframe).
164
+ *
165
+ * V1 (the compatibility default) is deprecated due to security concerns. It
166
+ * executes validated but unauthenticated fragment descriptors and returns the
167
+ * legacy response envelope. It retains the legacy risk when origins are not
168
+ * pinned; retire that endpoint after migrating callers.
173
169
  *
174
- * 1. Reads the IdP navigation MSAL passed in this page's hash (a GET URL, or a
175
- * POST form for the form_post / EAR response modes), then scrubs the hash.
176
- * 2. Validates that navigation. The relay page is directly reachable, so the
177
- * hash is untrusted input: the request shape is checked exactly and the
178
- * navigation target must be an absolute `https:` URL (optionally pinned to
179
- * {@link PopupRelayOptions.allowedAuthorityOrigins}). Anything else — in
180
- * particular active schemes such as `javascript:` — is rejected before it
181
- * can reach `window.open` or a form `action`.
182
- * 3. Opens the IdP child popup and performs that navigation (the relay page
170
+ * V2 must be explicitly selected on both the app and its separate relay
171
+ * endpoint. It:
172
+ *
173
+ * 1. Reads the request id from the hash, then scrubs the hash. Navigation
174
+ * descriptors in the hash are never executed.
175
+ * 2. Reserves a blank child popup during the user gesture, then requests the
176
+ * navigation from the opener through an origin- and source-checked
177
+ * postMessage handoff bound to this relay document's nonce.
178
+ * 3. Validates and performs the authenticated navigation (the relay page
183
179
  * stays put, so its `window.opener` link back to the embedded frame
184
180
  * survives COOP).
185
181
  * 4. Waits for the child's redirect URI page (which must run the redirect
@@ -198,10 +194,27 @@ function buildChildPopupFeatures(attributes) {
198
194
  * @param options - {@link PopupRelayOptions}
199
195
  */
200
196
  function runPopupRelay(options) {
197
+ const protocolVersion = getPopupRelayProtocolVersion(options?.protocolVersion);
201
198
  const opener = window.opener;
202
199
  const targetOrigin = window.location.origin;
203
200
  const hashParams = new URLSearchParams(window.location.hash.replace(/^#/, ""));
204
- const rawReq = hashParams.get("req") || "";
201
+ const incomingVersion = hashParams.has("id") ? 2 : 1;
202
+ let legacyDescriptor;
203
+ if (incomingVersion === 1) {
204
+ try {
205
+ legacyDescriptor = JSON.parse(hashParams.get("req") || "");
206
+ }
207
+ catch {
208
+ legacyDescriptor = null;
209
+ }
210
+ }
211
+ let id = hashParams.get("id") || "";
212
+ if (incomingVersion === 1 &&
213
+ legacyDescriptor &&
214
+ typeof legacyDescriptor === "object" &&
215
+ "id" in legacyDescriptor) {
216
+ id = legacyDescriptor.id;
217
+ }
205
218
  // Scrub the relayed request out of the relay page's own URL immediately.
206
219
  if (typeof window.history.replaceState === "function") {
207
220
  window.history.replaceState(null, "", window.location.origin + window.location.pathname);
@@ -209,14 +222,28 @@ function runPopupRelay(options) {
209
222
  if (!opener) {
210
223
  throw createBrowserAuthError(popupRelayUnsupportedFlow, "", "popup_relay_no_opener");
211
224
  }
212
- /*
213
- * Validate everything before opening anything: the relay page is directly
214
- * reachable, so the hash is attacker-controlled input, not authority.
215
- */
216
- const request = parseRelayRequest(rawReq, options?.allowedAuthorityOrigins);
217
- const id = request.id;
225
+ if (typeof id !== "string" || !id) {
226
+ throwRelayError(BAD_REQUEST_SUBERROR);
227
+ }
228
+ if (incomingVersion !== protocolVersion) {
229
+ const error = createBrowserAuthError(popupRelayUnsupportedFlow, "", "popup_relay_protocol_mismatch");
230
+ opener.postMessage({
231
+ type: incomingVersion === 1
232
+ ? POPUP_RELAY_RESPONSE_TYPE
233
+ : POPUP_RELAY_V2_RESPONSE_TYPE,
234
+ id,
235
+ error: error.errorCode,
236
+ subError: error.subError,
237
+ }, targetOrigin);
238
+ throw error;
239
+ }
240
+ const legacyRequest = protocolVersion === 1
241
+ ? parseRelayRequest(legacyDescriptor, options?.allowedAuthorityOrigins)
242
+ : undefined;
243
+ const nonce = protocolVersion === 2 ? createNewGuid() : undefined;
218
244
  const channel = new BroadcastChannel(id);
219
245
  let settled = false;
246
+ let requestReceived = protocolVersion === 1;
220
247
  /*
221
248
  * Timer handles are kept on a const holder so relay() (declared before the
222
249
  * timers are created) can clear them — `let` handles trip prefer-const, and
@@ -236,7 +263,16 @@ function runPopupRelay(options) {
236
263
  }
237
264
  clearInterval(timers.closedPoll);
238
265
  clearTimeout(timers.timeoutId);
239
- opener.postMessage({ type: POPUP_RELAY_RESPONSE_TYPE, id, ...message }, targetOrigin);
266
+ window.removeEventListener("message", onRequest);
267
+ window.removeEventListener("pagehide", onPageHide);
268
+ opener.postMessage({
269
+ type: protocolVersion === 1
270
+ ? POPUP_RELAY_RESPONSE_TYPE
271
+ : POPUP_RELAY_V2_RESPONSE_TYPE,
272
+ id,
273
+ ...(protocolVersion === 2 ? { nonce } : {}),
274
+ ...message,
275
+ }, targetOrigin);
240
276
  setTimeout(() => {
241
277
  try {
242
278
  window.close();
@@ -249,21 +285,75 @@ function runPopupRelay(options) {
249
285
  // The redirect bridge broadcasts the raw auth response payload here.
250
286
  channel.onmessage = (event) => {
251
287
  const payload = event.data && event.data.payload;
252
- if (payload) {
288
+ if (requestReceived && payload) {
253
289
  relay({ payload });
254
290
  }
255
291
  };
292
+ const onRequest = (event) => {
293
+ const data = event.data;
294
+ if (settled ||
295
+ requestReceived ||
296
+ protocolVersion !== 2 ||
297
+ !childPopup ||
298
+ event.origin !== targetOrigin ||
299
+ event.source !== opener ||
300
+ !data ||
301
+ data.type !== POPUP_RELAY_REQUEST_TYPE ||
302
+ data.id !== id ||
303
+ data.nonce !== nonce) {
304
+ return;
305
+ }
306
+ window.removeEventListener("message", onRequest);
307
+ try {
308
+ const request = parseRelayRequest(data.request, options?.allowedAuthorityOrigins);
309
+ if (request.id !== id) {
310
+ throwRelayError(BAD_REQUEST_SUBERROR);
311
+ }
312
+ requestReceived = true;
313
+ if (request.method === "GET") {
314
+ childPopup.location.replace(request.url);
315
+ }
316
+ else {
317
+ createForm(childPopup.document, request.action, request.fields).submit();
318
+ }
319
+ }
320
+ catch (e) {
321
+ relay({
322
+ error: e instanceof BrowserAuthError
323
+ ? e.errorCode
324
+ : popupWindowError,
325
+ subError: e instanceof BrowserAuthError
326
+ ? e.subError
327
+ : "popup_relay_navigation_failed",
328
+ });
329
+ childPopup.close();
330
+ }
331
+ };
256
332
  const features = buildChildPopupFeatures(options?.popupWindowAttributes);
257
- const childPopup = request.method === "POST"
258
- ? window.open("about:blank", "msalPopupRelayChild", features)
259
- : window.open(request.url, "msalPopupRelayChild", features);
333
+ // Reserve a fresh window before the asynchronous handoff consumes activation.
334
+ const childPopup = legacyRequest?.method === "GET"
335
+ ? window.open(legacyRequest.url, "msalPopupRelayChild", features)
336
+ : window.open("about:blank", protocolVersion === 1 ? "msalPopupRelayChild" : "_blank", features);
260
337
  if (!childPopup) {
261
338
  relay({ error: popupWindowError });
262
339
  return;
263
340
  }
264
- if (request.method === "POST") {
265
- createForm(childPopup.document, request.action, request.fields).submit();
341
+ function onPageHide() {
342
+ settled = true;
343
+ window.removeEventListener("message", onRequest);
344
+ window.removeEventListener("pagehide", onPageHide);
345
+ clearInterval(timers.closedPoll);
346
+ clearTimeout(timers.timeoutId);
347
+ channel.close();
348
+ childPopup?.close();
349
+ }
350
+ if (protocolVersion === 2) {
351
+ window.addEventListener("message", onRequest);
266
352
  }
353
+ else if (legacyRequest?.method === "POST") {
354
+ createForm(childPopup.document, legacyRequest.action, legacyRequest.fields).submit();
355
+ }
356
+ window.addEventListener("pagehide", onPageHide);
267
357
  timers.closedPoll = window.setInterval(() => {
268
358
  if (childPopup.closed && !settled) {
269
359
  /*
@@ -291,9 +381,17 @@ function runPopupRelay(options) {
291
381
  catch (e) {
292
382
  /* ignore */
293
383
  }
294
- relay({ error: timedOut });
384
+ relay({
385
+ error: timedOut,
386
+ subError: requestReceived
387
+ ? undefined
388
+ : "popup_relay_handshake_timeout",
389
+ });
295
390
  }
296
391
  }, options?.timeoutMs || DEFAULT_POPUP_RELAY_TIMEOUT_MS);
392
+ if (protocolVersion === 2) {
393
+ opener.postMessage({ type: POPUP_RELAY_READY_TYPE, id, nonce }, targetOrigin);
394
+ }
297
395
  }
298
396
 
299
397
  export { runPopupRelay };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/popup_relay/index.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.popupRelayUnsupportedFlow","BrowserAuthErrorCodes.popupWindowError","BrowserAuthErrorCodes.userCancelled","BrowserAuthErrorCodes.timedOut"],"mappings":";;;;;;;AAAA;;;AAGG;AAgDH,MAAM,8BAA8B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,EAAE,KAAK,EAAEC,aAAmC,EAAE,CAAC,CAAC;AACzD,QAAA,CAAA;IACL,CAAC,EAAE,GAAG,CAAC,CAAC;IAER,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,MAAK;QACtC,IAAI,CAAC,OAAO,EAAE;AACV;;;AAGG;AACH,YAAA,aAAa,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;YACjC,IAAI;gBACA,UAAU,CAAC,KAAK,EAAE,CAAC;AACtB,YAAA,CAAA;AAAC,YAAA,OAAO,CAAC,EAAE;;AAEX,YAAA,CAAA;YACD,KAAK,CAAC,EAAE,KAAK,EAAEC,QAA8B,EAAE,CAAC,CAAC;AACpD,QAAA,CAAA;AACL,IAAA,CAAC,EAAE,OAAO,EAAE,SAAS,IAAI,8BAA8B,CAAC,CAAC;AAC7D;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/popup_relay/index.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.popupRelayUnsupportedFlow","BrowserAuthErrorCodes.popupWindowError","BrowserAuthErrorCodes.userCancelled","BrowserAuthErrorCodes.timedOut"],"mappings":";;;;;;;;AAAA;;;AAGG;AAmEH,MAAM,8BAA8B,GAAG,MAAM,CAAC;AAC9C,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC,MAAM,oBAAoB,GAAG,yBAAyB,CAAC;AACvD,MAAM,mBAAmB,GAAG,wBAAwB,CAAC;AACrD,MAAM,4BAA4B,GAAG,iCAAiC,CAAC;AACvE,MAAM,+BAA+B,GAAG,oCAAoC,CAAC;AAE7E,SAAS,eAAe,CAAC,QAAgB,EAAA;IACrC,MAAM,sBAAsB,CACxBA,yBAA+C,EAC/C,EAAE,EACF,QAAQ,CACX,CAAC;AACN,CAAC;AAED,SAAS,WAAW,CAAC,GAAW,EAAA;IAC5B,IAAI;AACA,QAAA,OAAO,IAAI,GAAG,CAAC,GAAG,CAA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-11-12 */
1
+ /*! @azure/msal-browser v5.31.0 2026-12-02 */
2
2
  'use strict';
3
3
  import { ProtocolUtils } from '@azure/msal-common/browser';
4
4
  import { base64Decode } from '../encode/Base64Decode.mjs';
5
5
  import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
6
- import { popupRelayUnsupportedFlow, timedOut, userCancelled, redirectBridgeEmptyResponse } from '../error/BrowserAuthErrorCodes.mjs';
7
- import { POPUP_RELAY_RESPONSE_TYPE } from './constants.mjs';
6
+ import { popupRelayUnsupportedFlow, timedOut, userCancelled, popupWindowError, redirectBridgeEmptyResponse } from '../error/BrowserAuthErrorCodes.mjs';
7
+ import { getPopupRelayProtocolVersion, POPUP_RELAY_READY_TYPE, POPUP_RELAY_REQUEST_TYPE, POPUP_RELAY_RESPONSE_TYPE, POPUP_RELAY_V2_RESPONSE_TYPE } from './constants.mjs';
8
8
 
9
9
  /*
10
10
  * Copyright (c) Microsoft Corporation. All rights reserved.
11
11
  * Licensed under the MIT License.
12
12
  */
13
13
  /**
14
- * Builds the URL of the popup-relay page to open. The action the relay page
15
- * must perform (GET navigation or POST form) is carried in the page's hash
16
- * (client-side only, never sent to a server), keyed by the per-request
17
- * library-state `id` so the relay page can listen on the right BroadcastChannel
18
- * and echo the id back. The relay URI is resolved against the app origin, so it
19
- * must be same-origin as the embedded frame. See `runPopupRelay`.
14
+ * Builds the same-origin relay URL. V1 preserves the fragment descriptor;
15
+ * explicitly selected v2 carries only the id and retains the navigation for
16
+ * the authenticated handoff.
20
17
  *
21
18
  * @internal
22
19
  */
23
- function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
24
- const req = { id, ...action };
20
+ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId, protocolVersion) {
21
+ const version = getPopupRelayProtocolVersion(protocolVersion, correlationId);
25
22
  const target = new URL(popupRelayUri, window.location.origin);
26
23
  /*
27
24
  * The relay page must be same-origin as the embedded frame: the response is
@@ -34,7 +31,12 @@ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
34
31
  throw createBrowserAuthError(popupRelayUnsupportedFlow, correlationId, "popup_relay_cross_origin");
35
32
  }
36
33
  const hashParams = new URLSearchParams();
37
- hashParams.set("req", JSON.stringify(req));
34
+ if (version === 1) {
35
+ hashParams.set("req", JSON.stringify({ id, ...action }));
36
+ }
37
+ else {
38
+ hashParams.set("id", id);
39
+ }
38
40
  target.hash = hashParams.toString();
39
41
  return target.toString();
40
42
  }
@@ -45,21 +47,30 @@ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
45
47
  * partitioning blocks the BroadcastChannel the redirect bridge uses from
46
48
  * reaching the embedded frame.
47
49
  *
48
- * The response is accepted only from the popup window we opened, on our own
49
- * origin (the relay page is same-origin as the embedded frame), and only when
50
- * it carries the matching per-request library-state id.
50
+ * In v2, the retained navigation is sent once, after a ready signal from the popup
51
+ * window we opened on our own origin with the matching library-state id.
52
+ * Successful responses must also carry that handoff's relay-document nonce.
53
+ * Setup failures can reject the request before the handoff completes.
51
54
  *
52
55
  * @internal
53
56
  */
54
- async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow, performanceClient) {
57
+ async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow, performanceClient, action, protocolVersion) {
58
+ const version = getPopupRelayProtocolVersion(protocolVersion, request.correlationId);
59
+ if (version === 2 && !action) {
60
+ throw createBrowserAuthError(popupRelayUnsupportedFlow, request.correlationId, "popup_relay_bad_request");
61
+ }
55
62
  return new Promise((resolve, reject) => {
56
63
  const correlationId = request.correlationId;
57
64
  logger.verbose("1d05g9", correlationId);
58
- performanceClient.addFields({ redirectBridgeTimeoutMs: timeoutMs }, correlationId);
65
+ performanceClient.addFields({
66
+ redirectBridgeTimeoutMs: timeoutMs,
67
+ popupRelayProtocolVersion: version,
68
+ }, correlationId);
59
69
  const { libraryState } = ProtocolUtils.parseRequestState(base64Decode, request.state || "", correlationId);
60
70
  const expectedId = libraryState.id;
61
71
  const expectedOrigin = window.location.origin;
62
72
  let settled = false;
73
+ let handoffNonce = "";
63
74
  const cleanup = () => {
64
75
  window.removeEventListener("message", onMessage);
65
76
  clearTimeout(timeoutId);
@@ -71,20 +82,52 @@ async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow
71
82
  return;
72
83
  }
73
84
  const data = event.data;
74
- if (!data ||
75
- data.type !== POPUP_RELAY_RESPONSE_TYPE ||
76
- data.id !== expectedId) {
85
+ if (!data || data.id !== expectedId) {
77
86
  return;
78
87
  }
79
88
  if (settled) {
80
89
  return;
81
90
  }
91
+ if (version === 2 && data.type === POPUP_RELAY_READY_TYPE) {
92
+ if (handoffNonce ||
93
+ typeof data.nonce !== "string" ||
94
+ !data.nonce) {
95
+ return;
96
+ }
97
+ handoffNonce = data.nonce;
98
+ try {
99
+ popupWindow.postMessage({
100
+ type: POPUP_RELAY_REQUEST_TYPE,
101
+ id: expectedId,
102
+ nonce: handoffNonce,
103
+ request: { id: expectedId, ...action },
104
+ }, expectedOrigin);
105
+ performanceClient.addFields({ "ext.popupRelayRequestSent": true }, correlationId);
106
+ }
107
+ catch {
108
+ settled = true;
109
+ cleanup();
110
+ logger.error("0sx3jz", correlationId);
111
+ reject(createBrowserAuthError(popupWindowError, correlationId, "popup_relay_handoff_failed"));
112
+ }
113
+ return;
114
+ }
115
+ const hasError = typeof data.error === "string" && data.error.length > 0;
116
+ const responseType = version === 1
117
+ ? POPUP_RELAY_RESPONSE_TYPE
118
+ : POPUP_RELAY_V2_RESPONSE_TYPE;
119
+ if (data.type !== responseType ||
120
+ (version === 2 &&
121
+ ((!handoffNonce && !hasError) ||
122
+ (handoffNonce && data.nonce !== handoffNonce)))) {
123
+ return;
124
+ }
82
125
  settled = true;
83
126
  cleanup();
84
- if (data.error) {
85
- reject(createBrowserAuthError(data.error, correlationId));
127
+ if (hasError) {
128
+ reject(createBrowserAuthError(data.error, correlationId, data.subError));
86
129
  }
87
- else if (data.payload) {
130
+ else if (typeof data.payload === "string" && data.payload) {
88
131
  resolve(data.payload);
89
132
  }
90
133
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"relayClient.mjs","sources":["../../src/popup_relay/relayClient.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.popupRelayUnsupportedFlow","BrowserAuthErrorCodes.timedOut","BrowserAuthErrorCodes.userCancelled"],"mappings":";;;;;;;;AAAA;;;AAGG;AA2BH;;;;;;;;;AASG;AACG,SAAU,kBAAkB,CAC9B,aAAqB,EACrB,EAAU,EACV,MAAwB,EACxB,aAAqB,EAAA;IAErB,MAAM,GAAG,GAAG,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC;AAC9B,IAAA,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC9D;;;;;;AAMG;IACH,IAAI,MAAM,CAAC,MAAM,KAAK,MAAM,CAAC,QAAQ,CAAC,MAAM,EAAE;QAC1C,MAAM,sBAAsB,CACxBA,yBAA+C,EAC/C,aAAa,EACb,0BAA0B,CAC7B,CAAC;AACL,IAAA,CAAA;AACD,IAAA,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;AACzC,IAAA,UAAU,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3C,IAAA,MAAM,CAAC,IAAI,GAAG,UAAU,CAAC,QAAQ,EAAE,CAAC;AACpC,IAAA,OAAO,MAAM,CAAC,QAAQ,EAAE,CAAC;AAC7B,CAAC;AAED;;;;;;;;;;;;AAYG;AACI,eAAe,yBAAyB,CAC3C,SAAiB,EACjB,MAAc,EACd,OAA6B,EAC7B,WAAmB,EACnB,iBAAqC,EAAA;IAErC,OAAO,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,KAAI;AAC3C,QAAA,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC;AAC5C,QAAA,MAAM,CAAC,OAAO,CACV;QAGJ,iBAA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;AACrB,gBAAA,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACzB,YAAA,CAAA;AAAM,iBAAA;gBACH,MAAM,CACF,sBAAsB,CAClB,2BAA2B,EAC3B,aAAa,CAChB,CACJ,CAAC;AACL,YAAA,CAAA;AACL,QAAA,CAAC,CAAC;AACF,QAAA,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AAE9C,QAAA,MAAM,SAAS,GAAG,MAAM,CAAC,UAAU,CAAC,MAAK;AACrC,YAAA,IAAI,OAAO,EAAE;gBACT,OAAO;AACV,YAAA,CAAA;YACD,OAAO,GAAG,IAAI,CAAC;AACf,YAAA,OAAO,EAAE,CAAC;AACV,YAAA,MAAM,CACF,sBAAsB,CAClBC,QAA8B,EAC9B,aAAa,EACb,qBAAqB,CACxB,CACJ,CAAC;QACN,CAAC,EAAE,SAAS,CAAC,CAAC;AAEd,QAAA,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,MAAK;AACvC,YAAA,IAAI,WAAW,CAAC,MAAM,IAAI,CAAC,OAAO,EAAE;gBAChC,OAAO,GAAG,IAAI,CAAC;AACf,gBAAA,OAAO,EAAE,CAAC;gBACV,MAAM,CACF,sBAAsB,CAClBC,aAAmC,EACnC,aAAa,CAChB,CACJ,CAAC;AACL,YAAA,CAAA;QACL,CAAC,EAAE,GAAG,CAAC,CAAC;AACZ,IAAA,CAAC,CAAC,CAAC;AACP;;;;"}
1
+ {"version":3,"file":"relayClient.mjs","sources":["../../src/popup_relay/relayClient.ts"],"sourcesContent":[null],"names":["BrowserAuthErrorCodes.popupRelayUnsupportedFlow","BrowserAuthErrorCodes.popupWindowError","BrowserAuthErrorCodes.timedOut","BrowserAuthErrorCodes.userCancelled"],"mappings":";;;;;;;;AAAA;;;AAGG;AAiCH;;;;;;AAMG;AACG,SAAU,kBAAkB,CAC9B,aAAqB,EACrB,EAAU,EACV,MAAwB,EACxB,aAAqB,EACrB,eAAuB,EAA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/msal-browser v5.29.1 2026-11-12 */
1
+ /*! @azure/msal-browser v5.31.0 2026-12-02 */
2
2
  'use strict';
3
- import { createClientConfigurationError, ClientConfigurationErrorCodes, invokeAsync, RequestParameterBuilder, Constants, AuthorizeProtocol, ThrottlingUtils, ResponseHandler, PerformanceEvents, TimeUtils, ProtocolMode, AADServerParamKeys, ProtocolUtils } from '@azure/msal-common/browser';
4
- import { GetStandardParams, HandleResponsePlatformBroker, HandleCodeResponse, DecryptEarResponse, NativeInteractionClientAcquireToken } from '../telemetry/BrowserPerformanceEvents.mjs';
3
+ import { createClientConfigurationError, ClientConfigurationErrorCodes, invokeAsync, RequestParameterBuilder, Constants, AuthorizeProtocol, ThrottlingUtils, AuthError, ResponseHandler, PerformanceEvents, TimeUtils, ProtocolMode, AADServerParamKeys, ProtocolUtils } from '@azure/msal-common/browser';
4
+ import { GetStandardParams, HandleResponsePlatformBroker, HandleCodeResponse, GenerateEarKey, GenerateAsymmetricEarKey, DecryptEarResponse, NativeInteractionClientAcquireToken } from '../telemetry/BrowserPerformanceEvents.mjs';
5
5
  import { computePocd } from '../utils/PopupOriginCheck.mjs';
6
6
  import { BrowserConstants } from '../utils/BrowserConstants.mjs';
7
7
  import { version } from '../packageMetadata.mjs';
@@ -9,10 +9,11 @@ import { CryptoOps } from '../crypto/CryptoOps.mjs';
9
9
  import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
10
10
  import { InteractionHandler } from '../interaction_handler/InteractionHandler.mjs';
11
11
  import { PlatformAuthInteractionClient } from '../interaction_client/PlatformAuthInteractionClient.mjs';
12
- import { decryptEarResponse } from '../crypto/BrowserCrypto.mjs';
12
+ import { generateEarKey, generateAsymmetricEarKey, generateAsymmetricEarApv, decryptAsymmetricEarResponse, decryptEarResponse } from '../crypto/BrowserCrypto.mjs';
13
+ import { base64Encode } from '../encode/Base64Encode.mjs';
13
14
  import { TokenBindingKeyManager } from '../crypto/TokenBindingKeyManager.mjs';
14
15
  import { removeTokenBindingKeyOnFailure } from '../request/RequestHelpers.mjs';
15
- import { earJweEmpty, earJwkEmpty, nativeConnectionNotEstablished } from '../error/BrowserAuthErrorCodes.mjs';
16
+ import { asymmetricEarKeyError, earJweEmpty, earJwkEmpty, failedToDecryptEarResponse, nativeConnectionNotEstablished } from '../error/BrowserAuthErrorCodes.mjs';
16
17
 
17
18
  /*
18
19
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -157,6 +158,36 @@ function getAuthorizeFormAction(authority, request, parameters) {
157
158
  RequestParameterBuilder.addCorrelationId(queryParams, request.correlationId);
158
159
  return AuthorizeProtocol.getAuthorizeUrl(authority, queryParams);
159
160
  }
161
+ /**
162
+ * Prepares the selected EAR construction.
163
+ * @internal
164
+ */
165
+ async function initializeEarRequest(config, request, logger, performanceClient) {
166
+ if (!config.experimental.enableAsymmetricEar) {
167
+ const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, logger, performanceClient, request.correlationId)();
168
+ return {
169
+ ...request,
170
+ earJwk,
171
+ asymmetricEar: undefined,
172
+ };
173
+ }
174
+ try {
175
+ const { privateJwk, publicJwk } = await invokeAsync(generateAsymmetricEarKey, GenerateAsymmetricEarKey, logger, performanceClient, request.correlationId)();
176
+ const apv = generateAsymmetricEarApv(publicJwk);
177
+ const earJwk = base64Encode(JSON.stringify(publicJwk));
178
+ return {
179
+ ...request,
180
+ earJwk,
181
+ asymmetricEar: { privateJwk, apv },
182
+ };
183
+ }
184
+ catch (error) {
185
+ if (error instanceof AuthError) {
186
+ throw error;
187
+ }
188
+ throw createBrowserAuthError(asymmetricEarKeyError, request.correlationId, "request_initialization_failed" /* AsymmetricEarSubErrors.RequestInitializationFailed */);
189
+ }
190
+ }
160
191
  /**
161
192
  * Builds the action URL + POST-body fields for the EAR /authorize form.
162
193
  */
@@ -166,7 +197,18 @@ async function getEARFormData(config, authority, request, logger, performanceCli
166
197
  }
167
198
  const parameters = await getStandardParameters(config, authority, request, logger, performanceClient);
168
199
  RequestParameterBuilder.addResponseType(parameters, Constants.OAuthResponseType.IDTOKEN_TOKEN_REFRESHTOKEN);
169
- RequestParameterBuilder.addEARParameters(parameters, request.earJwk);
200
+ try {
201
+ RequestParameterBuilder.addEARParameters(parameters, request.earJwk, request.asymmetricEar
202
+ ? base64Encode(JSON.stringify({
203
+ alg: "ECDH-ES",
204
+ enc: "A256GCM",
205
+ apv: request.asymmetricEar.apv,
206
+ }))
207
+ : undefined);
208
+ }
209
+ catch {
210
+ throw createBrowserAuthError(asymmetricEarKeyError, request.correlationId, "request_encoding_failed" /* AsymmetricEarSubErrors.RequestEncodingFailed */);
211
+ }
170
212
  // Also add codeChallenge as backup in case EAR is not supported
171
213
  RequestParameterBuilder.addCodeChallengeParams(parameters, request.codeChallenge, Constants.S256_CODE_CHALLENGE_METHOD);
172
214
  RequestParameterBuilder.addExtraParameters(parameters, {
@@ -250,12 +292,14 @@ async function handleResponsePlatformBroker(request, accountId, apiId, config, b
250
292
  const browserCrypto = new CryptoOps(logger, performanceClient);
251
293
  const nativeInteractionClient = new PlatformAuthInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, config.system.navigationClient, apiId, performanceClient, platformAuthProvider, accountId, nativeStorage, request.correlationId, tokenBindingKeyManager);
252
294
  const { userRequestState } = ProtocolUtils.parseRequestState(browserCrypto.base64Decode, request.state, request.correlationId);
295
+ const brokerRequest = {
296
+ ...request,
297
+ state: userRequestState,
298
+ prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
299
+ };
300
+ delete brokerRequest.asymmetricEar;
253
301
  try {
254
- return await invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)({
255
- ...request,
256
- state: userRequestState,
257
- prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
258
- });
302
+ return await invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)(brokerRequest);
259
303
  }
260
304
  catch (e) {
261
305
  await removeTokenBindingKeyOnFailure(request, tokenBindingKeyManager, logger, performanceClient);
@@ -279,6 +323,7 @@ async function handleResponseCode(request, response, codeVerifier, apiId, config
279
323
  // Instrument clientdata telemetry fields from the authorize response
280
324
  instrumentClientData(response, request.correlationId, performanceClient);
281
325
  if (response.accountId) {
326
+ AuthorizeProtocol.validateAuthorizationResponse(response, request.state, request.correlationId);
282
327
  return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, response.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
283
328
  }
284
329
  const authCodeRequest = {
@@ -320,7 +365,20 @@ async function handleResponseEAR(request, response, apiId, config, authority, br
320
365
  if (!request.earJwk) {
321
366
  throw createBrowserAuthError(earJwkEmpty, request.correlationId);
322
367
  }
323
- const decryptedData = JSON.parse(await invokeAsync(decryptEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.earJwk, response.ear_jwe));
368
+ let plaintext;
369
+ if (request.asymmetricEar) {
370
+ plaintext = await invokeAsync(decryptAsymmetricEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.asymmetricEar.privateJwk, request.asymmetricEar.apv, response.ear_jwe, request.asymmetricEar.apv, { logger, performanceClient, correlationId: request.correlationId });
371
+ }
372
+ else {
373
+ plaintext = await invokeAsync(decryptEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.earJwk, response.ear_jwe);
374
+ }
375
+ let decryptedData;
376
+ try {
377
+ decryptedData = JSON.parse(plaintext);
378
+ }
379
+ catch {
380
+ throw createBrowserAuthError(failedToDecryptEarResponse, request.correlationId, "invalid_decrypted_response_payload" /* AsymmetricEarSubErrors.InvalidDecryptedResponsePayload */);
381
+ }
324
382
  if (decryptedData.accountId) {
325
383
  return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, decryptedData.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
326
384
  }
@@ -341,5 +399,5 @@ async function handleResponseEAR(request, response, apiId, config, authority, br
341
399
  return (await invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), PerformanceEvents.HandleServerTokenResponse, logger, performanceClient, request.correlationId)(decryptedData, authority, TimeUtils.nowSeconds(), request, apiId, additionalData, undefined, undefined, undefined, undefined));
342
400
  }
343
401
 
344
- export { createForm, getAuthCodeRequestUrl, getCodeForm, getCodeFormData, getEARForm, getEARFormData, handleResponseCode, handleResponseEAR, handleResponsePlatformBroker, parseClientData };
402
+ export { createForm, getAuthCodeRequestUrl, getCodeForm, getCodeFormData, getEARForm, getEARFormData, handleResponseCode, handleResponseEAR, handleResponsePlatformBroker, initializeEarRequest, parseClientData };
345
403
  //# sourceMappingURL=Authorize.mjs.map