@azure/msal-browser 5.29.1 → 5.30.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 (319) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  4. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  5. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
  8. package/dist/cache/AccountManager.mjs +1 -1
  9. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +2 -3
  11. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  12. package/dist/cache/CacheHelpers.mjs +1 -1
  13. package/dist/cache/CacheKeys.mjs +1 -1
  14. package/dist/cache/CookieStorage.mjs +1 -1
  15. package/dist/cache/DatabaseStorage.mjs +1 -1
  16. package/dist/cache/EncryptedData.mjs +1 -1
  17. package/dist/cache/LocalStorage.mjs +1 -1
  18. package/dist/cache/MemoryStorage.mjs +1 -1
  19. package/dist/cache/SessionStorage.mjs +1 -1
  20. package/dist/cache/TokenCache.mjs +1 -1
  21. package/dist/config/Configuration.mjs +11 -2
  22. package/dist/config/Configuration.mjs.map +1 -1
  23. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  24. package/dist/controllers/StandardController.mjs +1 -1
  25. package/dist/crypto/BrowserCrypto.mjs +185 -3
  26. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  27. package/dist/crypto/CryptoOps.mjs +1 -1
  28. package/dist/crypto/PkceGenerator.mjs +1 -1
  29. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  30. package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
  31. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  32. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  33. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  34. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  35. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  36. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  37. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  38. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +1 -1
  54. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.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/AuthMethodVerificationRequiredStateV2.mjs +1 -1
  58. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
  59. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +1 -1
  60. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +1 -1
  61. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -1
  62. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +1 -1
  63. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +1 -1
  64. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  65. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  66. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  67. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  68. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  69. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  70. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  71. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  72. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  73. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  74. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  75. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  76. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  77. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  78. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  79. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  80. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  81. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  82. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  83. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  84. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  85. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  86. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +1 -1
  87. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +1 -1
  88. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +1 -1
  89. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  90. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  91. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  92. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  93. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  94. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  95. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  96. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  97. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  98. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -1
  99. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +1 -1
  100. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +1 -1
  101. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  102. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +1 -1
  103. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +1 -1
  104. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  105. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
  106. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -1
  107. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  108. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  109. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +1 -1
  110. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  111. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  112. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  113. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  114. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  115. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  116. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  117. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  118. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  119. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  120. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  121. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  122. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  123. package/dist/custom_auth/index.mjs +1 -1
  124. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  125. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  126. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  127. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  128. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  129. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  130. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  131. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  132. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  133. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  134. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  135. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +1 -1
  136. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +1 -1
  137. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  138. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  139. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  140. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  141. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  142. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  143. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  144. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  145. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  146. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  147. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  148. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  149. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  150. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +1 -1
  151. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +1 -1
  152. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  153. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  154. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  155. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  156. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  157. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  158. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  159. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  160. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  161. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  162. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  163. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  164. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  165. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  166. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +1 -1
  167. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +1 -1
  168. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +1 -1
  169. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +1 -1
  170. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +1 -1
  171. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  172. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  173. package/dist/encode/Base64Decode.mjs +1 -1
  174. package/dist/encode/Base64Encode.mjs +1 -1
  175. package/dist/error/BrowserAuthError.mjs +1 -1
  176. package/dist/error/BrowserAuthErrorCodes.mjs +3 -2
  177. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
  178. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  179. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  180. package/dist/error/NativeAuthError.mjs +1 -1
  181. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  182. package/dist/error/NestedAppAuthError.mjs +1 -1
  183. package/dist/event/EventHandler.mjs +1 -1
  184. package/dist/event/EventMessage.mjs +1 -1
  185. package/dist/event/EventType.mjs +1 -1
  186. package/dist/index.mjs +1 -1
  187. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  188. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  189. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
  190. package/dist/interaction_client/PopupClient.mjs +27 -21
  191. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  192. package/dist/interaction_client/RedirectClient.mjs +8 -10
  193. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  194. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  195. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  196. package/dist/interaction_client/SilentIframeClient.mjs +5 -8
  197. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  198. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  199. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  200. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  201. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  202. package/dist/log-strings-mapping.json +701 -697
  203. package/dist/naa/BridgeError.mjs +1 -1
  204. package/dist/naa/BridgeProxy.mjs +1 -1
  205. package/dist/naa/BridgeStatusCode.mjs +1 -1
  206. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  207. package/dist/navigation/NavigationClient.mjs +1 -1
  208. package/dist/network/FetchClient.mjs +1 -1
  209. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  210. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  211. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  212. package/dist/packageMetadata.mjs +2 -2
  213. package/dist/popup_relay/constants.mjs +24 -6
  214. package/dist/popup_relay/constants.mjs.map +1 -1
  215. package/dist/popup_relay/index.mjs +142 -44
  216. package/dist/popup_relay/index.mjs.map +1 -1
  217. package/dist/popup_relay/relayClient.mjs +66 -23
  218. package/dist/popup_relay/relayClient.mjs.map +1 -1
  219. package/dist/protocol/Authorize.mjs +70 -13
  220. package/dist/protocol/Authorize.mjs.map +1 -1
  221. package/dist/redirect_bridge/index.mjs +1 -1
  222. package/dist/request/RequestHelpers.mjs +1 -1
  223. package/dist/request/SilentRequestHelpers.mjs +2 -1
  224. package/dist/request/SilentRequestHelpers.mjs.map +1 -1
  225. package/dist/response/ResponseHandler.mjs +1 -1
  226. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  227. package/dist/telemetry/BrowserPerformanceEvents.mjs +9 -2
  228. package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
  229. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  230. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  231. package/dist/utils/BrowserConstants.mjs +1 -1
  232. package/dist/utils/BrowserDetection.mjs +1 -1
  233. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  234. package/dist/utils/BrowserUtils.mjs +1 -1
  235. package/dist/utils/Helpers.mjs +1 -1
  236. package/dist/utils/IframeMonitor.mjs +1 -1
  237. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  238. package/dist/utils/PopupMonitor.mjs +1 -1
  239. package/dist/utils/PopupOriginCheck.mjs +1 -1
  240. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  241. package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
  242. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  243. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  244. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  245. package/dist/webBrokerBridge/index.mjs +1 -1
  246. package/lib/custom-auth-path/log-strings-mapping.json +13 -9
  247. package/lib/custom-auth-path/msal-custom-auth.cjs +449 -133
  248. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  249. package/lib/custom-auth-path/msal-custom-auth.js +449 -133
  250. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  251. package/lib/log-strings-mapping.json +13 -9
  252. package/lib/msal-browser.cjs +453 -135
  253. package/lib/msal-browser.cjs.map +1 -1
  254. package/lib/msal-browser.js +453 -135
  255. package/lib/msal-browser.js.map +1 -1
  256. package/lib/msal-browser.min.js +2 -2
  257. package/lib/popup-relay/msal-popup-relay.cjs +231 -60
  258. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  259. package/lib/popup-relay/msal-popup-relay.js +231 -60
  260. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  261. package/lib/popup-relay/msal-popup-relay.min.js +2 -2
  262. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  263. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  264. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  265. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  266. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  267. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
  268. package/package.json +2 -2
  269. package/src/cache/BrowserCacheManager.ts +1 -5
  270. package/src/config/Configuration.ts +35 -0
  271. package/src/crypto/BrowserCrypto.ts +363 -0
  272. package/src/error/AsymmetricEarSubErrors.ts +18 -0
  273. package/src/error/BrowserAuthErrorCodes.ts +1 -0
  274. package/src/interaction_client/PopupClient.ts +59 -29
  275. package/src/interaction_client/RedirectClient.ts +10 -13
  276. package/src/interaction_client/SilentIframeClient.ts +9 -13
  277. package/src/packageMetadata.ts +1 -1
  278. package/src/popup_relay/constants.ts +34 -3
  279. package/src/popup_relay/index.ts +200 -45
  280. package/src/popup_relay/relayClient.ts +108 -24
  281. package/src/protocol/Authorize.ts +118 -11
  282. package/src/request/PopupRequest.ts +1 -0
  283. package/src/request/RedirectRequest.ts +1 -0
  284. package/src/request/SilentRequestHelpers.ts +1 -0
  285. package/src/request/SsoSilentRequest.ts +1 -0
  286. package/src/telemetry/BrowserPerformanceEvents.ts +7 -0
  287. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  288. package/types/config/Configuration.d.ts +14 -0
  289. package/types/config/Configuration.d.ts.map +1 -1
  290. package/types/crypto/BrowserCrypto.d.ts +34 -0
  291. package/types/crypto/BrowserCrypto.d.ts.map +1 -1
  292. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  293. package/types/error/AsymmetricEarSubErrors.d.ts +14 -0
  294. package/types/error/AsymmetricEarSubErrors.d.ts.map +1 -0
  295. package/types/error/BrowserAuthErrorCodes.d.ts +1 -0
  296. package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
  297. package/types/interaction_client/PopupClient.d.ts +3 -1
  298. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  299. package/types/interaction_client/RedirectClient.d.ts +0 -1
  300. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  301. package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  302. package/types/packageMetadata.d.ts +1 -1
  303. package/types/popup_relay/constants.d.ts +10 -3
  304. package/types/popup_relay/constants.d.ts.map +1 -1
  305. package/types/popup_relay/index.d.ts +27 -11
  306. package/types/popup_relay/index.d.ts.map +1 -1
  307. package/types/popup_relay/relayClient.d.ts +9 -11
  308. package/types/popup_relay/relayClient.d.ts.map +1 -1
  309. package/types/protocol/Authorize.d.ts +5 -0
  310. package/types/protocol/Authorize.d.ts.map +1 -1
  311. package/types/request/PopupRequest.d.ts +1 -1
  312. package/types/request/PopupRequest.d.ts.map +1 -1
  313. package/types/request/RedirectRequest.d.ts +1 -1
  314. package/types/request/RedirectRequest.d.ts.map +1 -1
  315. package/types/request/SilentRequestHelpers.d.ts.map +1 -1
  316. package/types/request/SsoSilentRequest.d.ts +1 -1
  317. package/types/request/SsoSilentRequest.d.ts.map +1 -1
  318. package/types/telemetry/BrowserPerformanceEvents.d.ts +7 -0
  319. package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v5.29.1 2026-11-12 */
1
+ /*! @azure/msal-browser v5.30.0 2026-11-18 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -62,7 +62,7 @@ const ATTRIBUTE_TOKENS = "attribute_tokens";
62
62
  */
63
63
  const POPUP_ORIGIN_CHECK_DONE = "pocd";
64
64
 
65
- /*! @azure/msal-common v16.16.2 2026-11-12 */
65
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
66
66
  /*
67
67
  * Copyright (c) Microsoft Corporation. All rights reserved.
68
68
  * Licensed under the MIT License.
@@ -301,7 +301,7 @@ const JsonWebTokenTypes$1 = {
301
301
  // Token renewal offset default in seconds
302
302
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
303
303
 
304
- /*! @azure/msal-common v16.16.2 2026-11-12 */
304
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
305
305
  /*
306
306
  * Copyright (c) Microsoft Corporation. All rights reserved.
307
307
  * Licensed under the MIT License.
@@ -330,7 +330,7 @@ function createAuthError(code, correlationId, additionalMessage) {
330
330
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
331
331
  }
332
332
 
333
- /*! @azure/msal-common v16.16.2 2026-11-12 */
333
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
334
334
 
335
335
  /*
336
336
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -353,7 +353,7 @@ function createClientAuthError(errorCode, correlationId, additionalMessage) {
353
353
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
354
354
  }
355
355
 
356
- /*! @azure/msal-common v16.16.2 2026-11-12 */
356
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
357
357
  /*
358
358
  * Copyright (c) Microsoft Corporation. All rights reserved.
359
359
  * Licensed under the MIT License.
@@ -439,7 +439,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
439
439
  userCanceled: userCanceled
440
440
  });
441
441
 
442
- /*! @azure/msal-common v16.16.2 2026-11-12 */
442
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
443
443
 
444
444
  /*
445
445
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -477,7 +477,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
477
477
  };
478
478
  }
479
479
 
480
- /*! @azure/msal-common v16.16.2 2026-11-12 */
480
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
481
481
 
482
482
  /*
483
483
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -543,7 +543,7 @@ function getJWSPayload(authToken, correlationId) {
543
543
  return matches[2];
544
544
  }
545
545
 
546
- /*! @azure/msal-common v16.16.2 2026-11-12 */
546
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
547
547
 
548
548
  /*
549
549
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -631,7 +631,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
631
631
  return updatedAccountInfo;
632
632
  }
633
633
 
634
- /*! @azure/msal-common v16.16.2 2026-11-12 */
634
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
635
635
  /*
636
636
  * Copyright (c) Microsoft Corporation. All rights reserved.
637
637
  * Licensed under the MIT License.
@@ -645,7 +645,7 @@ const AuthorityType = {
645
645
  Ciam: 3,
646
646
  };
647
647
 
648
- /*! @azure/msal-common v16.16.2 2026-11-12 */
648
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
649
649
  /*
650
650
  * Copyright (c) Microsoft Corporation. All rights reserved.
651
651
  * Licensed under the MIT License.
@@ -667,7 +667,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
667
667
  return null;
668
668
  }
669
669
 
670
- /*! @azure/msal-common v16.16.2 2026-11-12 */
670
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
671
671
  /*
672
672
  * Copyright (c) Microsoft Corporation. All rights reserved.
673
673
  * Licensed under the MIT License.
@@ -691,7 +691,7 @@ const ProtocolMode = {
691
691
  EAR: "EAR",
692
692
  };
693
693
 
694
- /*! @azure/msal-common v16.16.2 2026-11-12 */
694
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
695
695
  /**
696
696
  * Returns the AccountInfo interface for this account.
697
697
  * @internal
@@ -880,7 +880,7 @@ function isAccountEntity(entity) {
880
880
  entity.hasOwnProperty("authorityType"));
881
881
  }
882
882
 
883
- /*! @azure/msal-common v16.16.2 2026-11-12 */
883
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
884
884
  /*
885
885
  * Copyright (c) Microsoft Corporation. All rights reserved.
886
886
  * Licensed under the MIT License.
@@ -897,7 +897,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
897
897
  unexpectedError: unexpectedError
898
898
  });
899
899
 
900
- /*! @azure/msal-common v16.16.2 2026-11-12 */
900
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
901
901
 
902
902
  /*
903
903
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -917,7 +917,7 @@ function createClientConfigurationError(errorCode, correlationId) {
917
917
  return new ClientConfigurationError(errorCode, correlationId);
918
918
  }
919
919
 
920
- /*! @azure/msal-common v16.16.2 2026-11-12 */
920
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
921
921
  /*
922
922
  * Copyright (c) Microsoft Corporation. All rights reserved.
923
923
  * Licensed under the MIT License.
@@ -957,7 +957,7 @@ function getResponseHeader(headers, name) {
957
957
  return headerName === undefined ? undefined : headers[headerName];
958
958
  }
959
959
 
960
- /*! @azure/msal-common v16.16.2 2026-11-12 */
960
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
961
961
  /*
962
962
  * Copyright (c) Microsoft Corporation. All rights reserved.
963
963
  * Licensed under the MIT License.
@@ -1027,7 +1027,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
1027
1027
  urlParseError: urlParseError
1028
1028
  });
1029
1029
 
1030
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1030
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1031
1031
 
1032
1032
  /*
1033
1033
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1086,7 +1086,7 @@ class AuthenticationHeaderParser {
1086
1086
  }
1087
1087
  }
1088
1088
 
1089
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1089
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1090
1090
  /*
1091
1091
  * Copyright (c) Microsoft Corporation. All rights reserved.
1092
1092
  * Licensed under the MIT License.
@@ -1098,7 +1098,7 @@ function isOpenIdConfigResponse(response) {
1098
1098
  response.hasOwnProperty("jwks_uri"));
1099
1099
  }
1100
1100
 
1101
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1101
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1102
1102
  /*
1103
1103
  * Copyright (c) Microsoft Corporation. All rights reserved.
1104
1104
  * Licensed under the MIT License.
@@ -1178,7 +1178,7 @@ class StringUtils {
1178
1178
  }
1179
1179
  }
1180
1180
 
1181
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1181
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1182
1182
 
1183
1183
  /*
1184
1184
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1365,7 +1365,7 @@ class UrlString {
1365
1365
  }
1366
1366
  }
1367
1367
 
1368
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1368
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1369
1369
 
1370
1370
  /*
1371
1371
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1519,7 +1519,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1519
1519
  return null;
1520
1520
  }
1521
1521
 
1522
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1522
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1523
1523
  /*
1524
1524
  * Copyright (c) Microsoft Corporation. All rights reserved.
1525
1525
  * Licensed under the MIT License.
@@ -1537,7 +1537,7 @@ const AzureCloudInstance = {
1537
1537
  AzureUsGovernment: "https://login.microsoftonline.us",
1538
1538
  };
1539
1539
 
1540
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1540
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1541
1541
  /*
1542
1542
  * Copyright (c) Microsoft Corporation. All rights reserved.
1543
1543
  * Licensed under the MIT License.
@@ -1547,7 +1547,7 @@ function isCloudInstanceDiscoveryResponse(response) {
1547
1547
  response.hasOwnProperty("metadata"));
1548
1548
  }
1549
1549
 
1550
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1550
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1551
1551
  /*
1552
1552
  * Copyright (c) Microsoft Corporation. All rights reserved.
1553
1553
  * Licensed under the MIT License.
@@ -1557,7 +1557,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
1557
1557
  response.hasOwnProperty("error_description"));
1558
1558
  }
1559
1559
 
1560
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1560
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1561
1561
  /*
1562
1562
  * Copyright (c) Microsoft Corporation. All rights reserved.
1563
1563
  * Licensed under the MIT License.
@@ -1628,7 +1628,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
1628
1628
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1629
1629
  const SetUserData = "setUserData";
1630
1630
 
1631
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1631
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1632
1632
  /*
1633
1633
  * Copyright (c) Microsoft Corporation. All rights reserved.
1634
1634
  * Licensed under the MIT License.
@@ -1722,7 +1722,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
1722
1722
  };
1723
1723
  };
1724
1724
 
1725
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1725
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1726
1726
 
1727
1727
  /*
1728
1728
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1851,7 +1851,7 @@ RegionDiscovery.IMDS_OPTIONS = {
1851
1851
  },
1852
1852
  };
1853
1853
 
1854
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1854
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1855
1855
  /*
1856
1856
  * Copyright (c) Microsoft Corporation. All rights reserved.
1857
1857
  * Licensed under the MIT License.
@@ -1916,7 +1916,7 @@ function wasClockTurnedBack(cachedAt) {
1916
1916
  return cachedAtSec > nowSeconds();
1917
1917
  }
1918
1918
 
1919
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1919
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
1920
1920
 
1921
1921
  /*
1922
1922
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2203,7 +2203,7 @@ function serializeAttributeTokens(attributeTokens) {
2203
2203
  return [...attributeTokens].sort().join(" ");
2204
2204
  }
2205
2205
 
2206
- /*! @azure/msal-common v16.16.2 2026-11-12 */
2206
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
2207
2207
 
2208
2208
  /*
2209
2209
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3174,7 +3174,7 @@ function buildStaticAuthorityOptions(authOptions) {
3174
3174
  };
3175
3175
  }
3176
3176
 
3177
- /*! @azure/msal-common v16.16.2 2026-11-12 */
3177
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3178
3178
 
3179
3179
  /*
3180
3180
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3208,7 +3208,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
3208
3208
  }
3209
3209
  }
3210
3210
 
3211
- /*! @azure/msal-common v16.16.2 2026-11-12 */
3211
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3212
3212
 
3213
3213
  /*
3214
3214
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3404,7 +3404,7 @@ class ScopeSet {
3404
3404
  }
3405
3405
  }
3406
3406
 
3407
- /*! @azure/msal-common v16.16.2 2026-11-12 */
3407
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3408
3408
 
3409
3409
  /*
3410
3410
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3872,12 +3872,13 @@ function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
3872
3872
  * Add EAR (Encrypted Authorize Response) request parameters
3873
3873
  * @param parameters
3874
3874
  * @param jwk
3875
+ * @param jweCrypto - Base64-encoded encryption metadata; defaults to symmetric EAR.
3875
3876
  */
3876
- function addEARParameters(parameters, jwk) {
3877
+ function addEARParameters(parameters, jwk, jweCrypto) {
3877
3878
  parameters.set(EAR_JWK, encodeURIComponent(jwk));
3878
- // ear_jwe_crypto will always have value: {"alg":"dir","enc":"A256GCM"} so we can hardcode this
3879
+ // Default symmetric EAR metadata; asymmetric requests supply their APV.
3879
3880
  const jweCryptoB64Encoded = "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0";
3880
- parameters.set(EAR_JWE_CRYPTO, jweCryptoB64Encoded);
3881
+ parameters.set(EAR_JWE_CRYPTO, jweCrypto ?? jweCryptoB64Encoded);
3881
3882
  }
3882
3883
  function addResource(parameters, resource) {
3883
3884
  if (resource) {
@@ -3904,7 +3905,7 @@ function addAttributeTokens(parameters, attributeTokens) {
3904
3905
  }
3905
3906
  }
3906
3907
 
3907
- /*! @azure/msal-common v16.16.2 2026-11-12 */
3908
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
3908
3909
 
3909
3910
  /*
3910
3911
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4035,7 +4036,7 @@ function validateUrl(url, logger, correlationId) {
4035
4036
  }
4036
4037
  }
4037
4038
 
4038
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4039
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4039
4040
 
4040
4041
  /*
4041
4042
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4083,7 +4084,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
4083
4084
  },
4084
4085
  };
4085
4086
 
4086
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4087
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4087
4088
 
4088
4089
  /*
4089
4090
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4106,7 +4107,7 @@ const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
4106
4107
  },
4107
4108
  };
4108
4109
 
4109
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4110
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4110
4111
  /*
4111
4112
  * Copyright (c) Microsoft Corporation. All rights reserved.
4112
4113
  * Licensed under the MIT License.
@@ -4395,12 +4396,12 @@ class Logger {
4395
4396
  }
4396
4397
  }
4397
4398
 
4398
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4399
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4399
4400
  /* eslint-disable header/header */
4400
4401
  const name$1 = "@azure/msal-common";
4401
- const version$1 = "16.16.2";
4402
+ const version$1 = "16.17.0";
4402
4403
 
4403
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4404
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4404
4405
  /*
4405
4406
  * Copyright (c) Microsoft Corporation. All rights reserved.
4406
4407
  * Licensed under the MIT License.
@@ -4408,7 +4409,7 @@ const version$1 = "16.16.2";
4408
4409
  const cacheQuotaExceeded = "cache_quota_exceeded";
4409
4410
  const cacheErrorUnknown = "cache_error_unknown";
4410
4411
 
4411
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4412
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4412
4413
 
4413
4414
  /*
4414
4415
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4446,7 +4447,7 @@ function createCacheError(e) {
4446
4447
  }
4447
4448
  }
4448
4449
 
4449
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4450
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
4450
4451
 
4451
4452
  /*
4452
4453
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5674,7 +5675,7 @@ class DefaultStorageClass extends CacheManager {
5674
5675
  }
5675
5676
  }
5676
5677
 
5677
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5678
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5678
5679
  /*
5679
5680
  * Copyright (c) Microsoft Corporation. All rights reserved.
5680
5681
  * Licensed under the MIT License.
@@ -5736,10 +5737,11 @@ const IntFields = new Set([
5736
5737
  "networkRtt",
5737
5738
  "redirectBridgeTimeoutMs",
5738
5739
  "redirectBridgeMessageVersion",
5740
+ "popupRelayProtocolVersion",
5739
5741
  "fetchRetryCount",
5740
5742
  ]);
5741
5743
 
5742
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5744
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5743
5745
 
5744
5746
  /*
5745
5747
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5797,7 +5799,7 @@ class StubPerformanceClient {
5797
5799
  }
5798
5800
  }
5799
5801
 
5800
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5802
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5801
5803
 
5802
5804
  /*
5803
5805
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5895,7 +5897,7 @@ function isOidcProtocolMode(config) {
5895
5897
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5896
5898
  }
5897
5899
 
5898
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5900
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5899
5901
  /*
5900
5902
  * Copyright (c) Microsoft Corporation. All rights reserved.
5901
5903
  * Licensed under the MIT License.
@@ -5922,7 +5924,7 @@ function isOidcProtocolMode(config) {
5922
5924
  }
5923
5925
  }
5924
5926
 
5925
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5927
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5926
5928
 
5927
5929
  /*
5928
5930
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5943,7 +5945,7 @@ function createJoseHeaderError(code, correlationId) {
5943
5945
  return new JoseHeaderError(code, correlationId);
5944
5946
  }
5945
5947
 
5946
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5948
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5947
5949
  /*
5948
5950
  * Copyright (c) Microsoft Corporation. All rights reserved.
5949
5951
  * Licensed under the MIT License.
@@ -5968,7 +5970,7 @@ function isPlainObject(value) {
5968
5970
  return Object.getPrototypeOf(value) === proto;
5969
5971
  }
5970
5972
 
5971
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5973
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5972
5974
  /*
5973
5975
  * Copyright (c) Microsoft Corporation. All rights reserved.
5974
5976
  * Licensed under the MIT License.
@@ -5978,7 +5980,7 @@ const missingAlgError = "missing_alg_error";
5978
5980
  const missingJwkError = "missing_jwk_error";
5979
5981
  const invalidJwkError = "invalid_jwk_error";
5980
5982
 
5981
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5983
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
5982
5984
 
5983
5985
  /*
5984
5986
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6044,7 +6046,7 @@ class JoseHeader {
6044
6046
  }
6045
6047
  }
6046
6048
 
6047
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6049
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6048
6050
 
6049
6051
  /*
6050
6052
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6145,7 +6147,7 @@ class PopTokenGenerator {
6145
6147
  }
6146
6148
  }
6147
6149
 
6148
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6150
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6149
6151
 
6150
6152
  /*
6151
6153
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6300,7 +6302,7 @@ class DpopProofGenerator {
6300
6302
  }
6301
6303
  }
6302
6304
 
6303
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6305
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6304
6306
  /*
6305
6307
  * Copyright (c) Microsoft Corporation. All rights reserved.
6306
6308
  * Licensed under the MIT License.
@@ -6364,7 +6366,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6364
6366
  uiNotAllowed: uiNotAllowed
6365
6367
  });
6366
6368
 
6367
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6369
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6368
6370
 
6369
6371
  /*
6370
6372
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6431,7 +6433,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
6431
6433
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
6432
6434
  }
6433
6435
 
6434
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6436
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6435
6437
 
6436
6438
  /*
6437
6439
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6450,7 +6452,7 @@ class ServerError extends AuthError {
6450
6452
  }
6451
6453
  }
6452
6454
 
6453
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6455
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6454
6456
 
6455
6457
  /*
6456
6458
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6521,7 +6523,7 @@ function parseRequestState(base64Decode, state, correlationId) {
6521
6523
  }
6522
6524
  }
6523
6525
 
6524
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6526
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6525
6527
 
6526
6528
  /*
6527
6529
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6949,7 +6951,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6949
6951
  return baseAccount;
6950
6952
  }
6951
6953
 
6952
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6954
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6953
6955
  /*
6954
6956
  * Copyright (c) Microsoft Corporation. All rights reserved.
6955
6957
  * Licensed under the MIT License.
@@ -6959,7 +6961,7 @@ const CcsCredentialType = {
6959
6961
  UPN: "UPN",
6960
6962
  };
6961
6963
 
6962
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6964
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6963
6965
  /*
6964
6966
  * Copyright (c) Microsoft Corporation. All rights reserved.
6965
6967
  * Licensed under the MIT License.
@@ -6978,7 +6980,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
6978
6980
  }
6979
6981
  }
6980
6982
 
6981
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6983
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
6982
6984
 
6983
6985
  /*
6984
6986
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7002,7 +7004,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
7002
7004
  };
7003
7005
  }
7004
7006
 
7005
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7007
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7006
7008
 
7007
7009
  /*
7008
7010
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7092,7 +7094,7 @@ function getRetryAfterHeader(response) {
7092
7094
  return undefined;
7093
7095
  }
7094
7096
 
7095
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7097
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7096
7098
 
7097
7099
  /*
7098
7100
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7123,7 +7125,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
7123
7125
  return new NetworkError(error, httpStatus, responseHeaders);
7124
7126
  }
7125
7127
 
7126
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7128
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7127
7129
 
7128
7130
  /*
7129
7131
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7257,7 +7259,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
7257
7259
  return response;
7258
7260
  }
7259
7261
 
7260
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7262
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7261
7263
 
7262
7264
  /*
7263
7265
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7525,7 +7527,7 @@ class AuthorizationCodeClient {
7525
7527
  }
7526
7528
  }
7527
7529
 
7528
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7530
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7529
7531
 
7530
7532
  /*
7531
7533
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7755,7 +7757,7 @@ function extractLoginHint(account) {
7755
7757
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7756
7758
  }
7757
7759
 
7758
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7760
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
7759
7761
 
7760
7762
  /*
7761
7763
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8304,7 +8306,7 @@ class PerformanceClient {
8304
8306
  }
8305
8307
  }
8306
8308
 
8307
- /*! @azure/msal-common v16.16.2 2026-11-12 */
8309
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
8308
8310
 
8309
8311
  /*
8310
8312
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8539,7 +8541,7 @@ class RefreshTokenClient {
8539
8541
  }
8540
8542
  }
8541
8543
 
8542
- /*! @azure/msal-common v16.16.2 2026-11-12 */
8544
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
8543
8545
 
8544
8546
  /*
8545
8547
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8832,7 +8834,7 @@ class StubServerTelemetryManager extends ServerTelemetryManager {
8832
8834
  clearNativeBrokerErrorCode() { }
8833
8835
  }
8834
8836
 
8835
- /*! @azure/msal-common v16.16.2 2026-11-12 */
8837
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
8836
8838
 
8837
8839
  /*
8838
8840
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8959,7 +8961,7 @@ class SilentFlowClient {
8959
8961
  }
8960
8962
  }
8961
8963
 
8962
- /*! @azure/msal-common v16.16.2 2026-11-12 */
8964
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
8963
8965
 
8964
8966
  /*
8965
8967
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8975,7 +8977,7 @@ const StubbedNetworkModule = {
8975
8977
  },
8976
8978
  };
8977
8979
 
8978
- /*! @azure/msal-common v16.16.2 2026-11-12 */
8980
+ /*! @azure/msal-common v16.17.0 2026-11-18 */
8979
8981
 
8980
8982
  /*
8981
8983
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9142,6 +9144,13 @@ const UrlEncodeArr = "urlEncodeArr";
9142
9144
  const Encrypt = "encrypt";
9143
9145
  const Decrypt = "decrypt";
9144
9146
  const GenerateEarKey = "generateEarKey";
9147
+ const GenerateAsymmetricEarKey = "generateAsymmetricEarKey";
9148
+ const ImportAsymmetricEarKey = "importAsymmetricEarKey";
9149
+ const ImportAsymmetricEarPublicKey = "importAsymmetricEarPublicKey";
9150
+ const DeriveAsymmetricEarSecret = "deriveAsymmetricEarSecret";
9151
+ const AsymmetricEarConcatKdf = "asymmetricEarConcatKdf";
9152
+ const ImportAsymmetricEarContentKey = "importAsymmetricEarContentKey";
9153
+ const DecryptAsymmetricEarResponse = "decryptAsymmetricEarResponse";
9145
9154
  const DecryptEarResponse = "decryptEarResponse";
9146
9155
  const LoadAccount = "loadAccount";
9147
9156
  const LoadIdToken = "loadIdToken";
@@ -9212,11 +9221,13 @@ const tokenBindingKeyJwkThumbprintMismatch = "token_binding_key_jwk_thumbprint_m
9212
9221
  const failedToBuildHeaders = "failed_to_build_headers";
9213
9222
  const failedToParseHeaders = "failed_to_parse_headers";
9214
9223
  const failedToDecryptEarResponse = "failed_to_decrypt_ear_response";
9224
+ const asymmetricEarKeyError = "asymmetric_ear_key_error";
9215
9225
  const timedOut = "timed_out";
9216
9226
  const emptyResponse = "empty_response";
9217
9227
 
9218
9228
  var BrowserAuthErrorCodes = /*#__PURE__*/Object.freeze({
9219
9229
  __proto__: null,
9230
+ asymmetricEarKeyError: asymmetricEarKeyError,
9220
9231
  authCodeOrNativeAccountIdRequired: authCodeOrNativeAccountIdRequired,
9221
9232
  authCodeRequired: authCodeRequired,
9222
9233
  authRequestNotSetError: authRequestNotSetError,
@@ -9612,6 +9623,10 @@ const HKDF = "HKDF";
9612
9623
  const S256_HASH_ALG = "SHA-256";
9613
9624
  // JWK values used by browser-internal WebCrypto helpers.
9614
9625
  const JSON_WEB_KEY_CURVE_P256 = "P-256";
9626
+ const ECDH_P384_ALGORITHM = {
9627
+ name: "ECDH",
9628
+ namedCurve: "P-384",
9629
+ };
9615
9630
  const JSON_WEB_KEY_TYPE_EC = "EC";
9616
9631
  const JSON_WEB_KEY_TYPE_RSA = "RSA";
9617
9632
  const MISSING_JWK_KTY_SUBERROR = "missing_jwk_kty";
@@ -9749,6 +9764,16 @@ async function generateKeyPair(extractable, usages, algorithm) {
9749
9764
  async function exportJwk(key) {
9750
9765
  return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
9751
9766
  }
9767
+ /**
9768
+ * Imports key as Json Web Key (JWK), can set extractable and usages.
9769
+ * @param key
9770
+ * @param extractable
9771
+ * @param usages
9772
+ * @param algorithm
9773
+ */
9774
+ async function importJwk(key, extractable, usages, algorithm) {
9775
+ return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, algorithm, extractable, usages);
9776
+ }
9752
9777
  /**
9753
9778
  * Signs given data with given key.
9754
9779
  * @param key
@@ -9771,6 +9796,172 @@ async function generateEarKey() {
9771
9796
  };
9772
9797
  return base64Encode(JSON.stringify(jwk));
9773
9798
  }
9799
+ /**
9800
+ * Generates P-384 ECDH keys for request-scoped private sessionStorage and public wire metadata.
9801
+ * @internal
9802
+ */
9803
+ async function generateAsymmetricEarKey() {
9804
+ const keyPair = await generateKeyPair(true, ["deriveBits"], ECDH_P384_ALGORITHM);
9805
+ const publicJwk = await exportJwk(keyPair.publicKey);
9806
+ const privateJwk = await exportJwk(keyPair.privateKey);
9807
+ return {
9808
+ privateJwk,
9809
+ publicJwk,
9810
+ };
9811
+ }
9812
+ /**
9813
+ * Restores a private EAR key as non-exportable. The serialized sessionStorage copy remains exportable.
9814
+ * @internal
9815
+ */
9816
+ async function importAsymmetricEarKey(privateJwk, correlationId = "") {
9817
+ if (privateJwk?.kty !== "EC" ||
9818
+ privateJwk.crv !== "P-384" ||
9819
+ !privateJwk.d) {
9820
+ throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "invalid_private_key" /* AsymmetricEarSubErrors.InvalidPrivateKey */);
9821
+ }
9822
+ try {
9823
+ return await importJwk(privateJwk, false, ["deriveBits"], ECDH_P384_ALGORITHM);
9824
+ }
9825
+ catch {
9826
+ throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "private_key_import_failed" /* AsymmetricEarSubErrors.PrivateKeyImportFailed */);
9827
+ }
9828
+ }
9829
+ /**
9830
+ * Encodes the EAR client party information with a fresh 192-bit nonce.
9831
+ * @internal
9832
+ */
9833
+ function generateAsymmetricEarApv(publicJwk) {
9834
+ const point = new Uint8Array(concatEarBytes(new Uint8Array([4]), decodeEarBase64Url(publicJwk.x || ""), decodeEarBase64Url(publicJwk.y || "")));
9835
+ if (point.length !== 97) {
9836
+ throw createBrowserAuthError(asymmetricEarKeyError, "", "invalid_public_key_coordinates" /* AsymmetricEarSubErrors.InvalidPublicKeyCoordinates */);
9837
+ }
9838
+ const nonce = new Uint8Array(24);
9839
+ window.crypto.getRandomValues(nonce);
9840
+ return urlEncodeArr(new Uint8Array(concatEarBytes(lengthPrefixEarBytes(new TextEncoder().encode("EarClient")), lengthPrefixEarBytes(point), lengthPrefixEarBytes(nonce))));
9841
+ }
9842
+ /**
9843
+ * Authenticates and decrypts direct ECDH-ES/P-384/A256GCM using JOSE Concat KDF.
9844
+ * Party information is used byte-for-byte; the service need not echo the request APV.
9845
+ * @internal
9846
+ */
9847
+ async function decryptAsymmetricEarResponse(privateJwk, apv, earJwe, requestApv = apv, telemetry) {
9848
+ const correlationId = telemetry?.correlationId || "";
9849
+ const measure = (eventName, operation) => telemetry
9850
+ ? invokeAsync(operation, eventName, telemetry.logger, telemetry.performanceClient, correlationId)()
9851
+ : operation();
9852
+ if (apv !== requestApv) {
9853
+ throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "request_apv_mismatch" /* AsymmetricEarSubErrors.RequestApvMismatch */);
9854
+ }
9855
+ const parts = earJwe.split(".");
9856
+ if (parts.length !== 5 || parts[1] !== "") {
9857
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
9858
+ }
9859
+ let header;
9860
+ try {
9861
+ header = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(decodeEarBase64Url(parts[0], correlationId)));
9862
+ }
9863
+ catch {
9864
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
9865
+ }
9866
+ if (!header ||
9867
+ header.alg !== "ECDH-ES" ||
9868
+ header.enc !== "A256GCM" ||
9869
+ header.crit !== undefined ||
9870
+ header.zip !== undefined ||
9871
+ header.epk?.kty !== "EC" ||
9872
+ header.epk.crv !== "P-384" ||
9873
+ header.epk.d !== undefined ||
9874
+ (header.apv !== undefined && header.apv !== apv)) {
9875
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
9876
+ }
9877
+ const x = decodeEarBase64Url(header.epk.x, correlationId);
9878
+ const y = decodeEarBase64Url(header.epk.y, correlationId);
9879
+ const apuBytes = decodeEarBase64Url(header.apu, correlationId);
9880
+ const apvBytes = decodeEarBase64Url(apv, correlationId);
9881
+ const iv = decodeEarBase64Url(parts[2], correlationId);
9882
+ const ciphertext = decodeEarBase64Url(parts[3], correlationId);
9883
+ const tag = decodeEarBase64Url(parts[4], correlationId);
9884
+ if (x.length !== 48 ||
9885
+ y.length !== 48 ||
9886
+ iv.length !== 12 ||
9887
+ tag.length !== 16) {
9888
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
9889
+ }
9890
+ let key;
9891
+ try {
9892
+ const privateKey = await measure(ImportAsymmetricEarKey, () => importAsymmetricEarKey(privateJwk, correlationId));
9893
+ const publicKey = await measure(ImportAsymmetricEarPublicKey, () => importJwk({
9894
+ kty: "EC",
9895
+ crv: "P-384",
9896
+ x: header.epk.x,
9897
+ y: header.epk.y,
9898
+ }, false, [], ECDH_P384_ALGORITHM));
9899
+ const secret = new Uint8Array(await measure(DeriveAsymmetricEarSecret, () => window.crypto.subtle.deriveBits({ name: "ECDH", public: publicKey }, privateKey, 384)));
9900
+ // RFC 7518 section 4.6.2: one SHA-256 round produces the 256-bit content key.
9901
+ const input = new Uint8Array(concatEarBytes(earUint32(1), secret, lengthPrefixEarBytes(new TextEncoder().encode("A256GCM")), lengthPrefixEarBytes(apuBytes), lengthPrefixEarBytes(apvBytes), earUint32(256)));
9902
+ let derivedKey;
9903
+ try {
9904
+ derivedKey = await measure(AsymmetricEarConcatKdf, () => window.crypto.subtle.digest(S256_HASH_ALG, input));
9905
+ }
9906
+ finally {
9907
+ secret.fill(0);
9908
+ input.fill(0);
9909
+ }
9910
+ try {
9911
+ key = await measure(ImportAsymmetricEarContentKey, () => window.crypto.subtle.importKey(RAW, derivedKey, AES_GCM, false, [DECRYPT]));
9912
+ }
9913
+ finally {
9914
+ new Uint8Array(derivedKey).fill(0);
9915
+ }
9916
+ }
9917
+ catch (error) {
9918
+ if (error instanceof AuthError) {
9919
+ throw error;
9920
+ }
9921
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "content_encryption_key_derivation_failed" /* AsymmetricEarSubErrors.ContentEncryptionKeyDerivationFailed */);
9922
+ }
9923
+ try {
9924
+ const plaintext = await measure(DecryptAsymmetricEarResponse, () => window.crypto.subtle.decrypt({
9925
+ name: AES_GCM,
9926
+ iv,
9927
+ tagLength: 128,
9928
+ additionalData: new TextEncoder().encode(parts[0]),
9929
+ }, key, concatEarBytes(ciphertext, tag)));
9930
+ return new TextDecoder("utf-8", { fatal: true }).decode(plaintext);
9931
+ }
9932
+ catch {
9933
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "jwe_decryption_failed" /* AsymmetricEarSubErrors.JweDecryptionFailed */);
9934
+ }
9935
+ }
9936
+ /** Decodes canonical, unpadded JOSE base64url for asymmetric EAR only. */
9937
+ function decodeEarBase64Url(value, correlationId = "") {
9938
+ // Match the unpadded base64url alphabet only: letters, digits, '-' and '_'.
9939
+ if (typeof value !== "string" || !/^[A-Za-z0-9_-]+$/.test(value)) {
9940
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
9941
+ }
9942
+ const bytes = new Uint8Array(base64DecToArr(value));
9943
+ if (urlEncodeArr(bytes) !== value) {
9944
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
9945
+ }
9946
+ return bytes;
9947
+ }
9948
+ function earUint32(value) {
9949
+ const bytes = new Uint8Array(4);
9950
+ new DataView(bytes.buffer).setUint32(0, value);
9951
+ return bytes;
9952
+ }
9953
+ function concatEarBytes(...parts) {
9954
+ const bytes = new Uint8Array(parts.reduce((length, part) => length + part.length, 0));
9955
+ let offset = 0;
9956
+ for (const part of parts) {
9957
+ bytes.set(part, offset);
9958
+ offset += part.length;
9959
+ }
9960
+ return bytes.buffer;
9961
+ }
9962
+ function lengthPrefixEarBytes(bytes) {
9963
+ return new Uint8Array(concatEarBytes(earUint32(bytes.length), bytes));
9964
+ }
9774
9965
  /**
9775
9966
  * Parses earJwk for encryption key and returns CryptoKey object
9776
9967
  * @param earJwk
@@ -11710,7 +11901,7 @@ const EventType = {
11710
11901
 
11711
11902
  /* eslint-disable header/header */
11712
11903
  const name = "@azure/msal-browser";
11713
- const version = "5.29.1";
11904
+ const version = "5.30.0";
11714
11905
 
11715
11906
  /*
11716
11907
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -13017,8 +13208,7 @@ class BrowserCacheManager extends CacheManager {
13017
13208
  }
13018
13209
  }
13019
13210
  catch (e) {
13020
- this.logger.errorPii(`0ewsey ${encodedTokenRequest}`, correlationId);
13021
- this.logger.error(`0tvdic ${e}`, correlationId);
13211
+ this.logger.error("023ixj", correlationId);
13022
13212
  throw createBrowserAuthError(unableToParseTokenRequestCacheError, "");
13023
13213
  }
13024
13214
  return [parsedRequest, verifier];
@@ -14092,30 +14282,42 @@ function shouldUseEar(protocolMode, logger, performanceClient, correlationId, us
14092
14282
  * page (see `runPopupRelay`) back to the embedded frame that opened it. See
14093
14283
  * {@link BrowserAuthOptions.popupRelayUri}.
14094
14284
  *
14095
- * Kept dependency-free so both the relay-page entry (`./index.js`) and the
14096
- * client-side helpers (`./relayClient.js`) can import it without either bundle
14097
- * pulling in the other's dependencies.
14285
+ * Shared by the relay-page entry and client helpers without importing either
14286
+ * implementation into the other bundle.
14098
14287
  *
14099
14288
  * @internal
14100
14289
  */
14101
- const POPUP_RELAY_RESPONSE_TYPE = "msal:popup-relay-response:v1";
14290
+ const POPUP_RELAY_RESPONSE_TYPE = "msal:popup-relay-response:v1";
14291
+ /** @internal Response bound to an authenticated v2 relay document. */
14292
+ const POPUP_RELAY_V2_RESPONSE_TYPE = "msal:popup-relay-response:v2";
14293
+ /** @internal Ready signal for the authenticated popup-relay request handoff. */
14294
+ const POPUP_RELAY_READY_TYPE = "msal:popup-relay-ready:v2";
14295
+ /** @internal Request delivered only to the same-origin relay window. */
14296
+ const POPUP_RELAY_REQUEST_TYPE = "msal:popup-relay-request:v2";
14297
+ /** @internal Resolve the compatibility default without downgrading invalid versions. */
14298
+ function getPopupRelayProtocolVersion(version, correlationId = "") {
14299
+ if (version === undefined) {
14300
+ return 1;
14301
+ }
14302
+ if (version !== 1 && version !== 2) {
14303
+ throw createBrowserAuthError(popupRelayUnsupportedFlow, correlationId, "popup_relay_invalid_protocol");
14304
+ }
14305
+ return version;
14306
+ }
14102
14307
 
14103
14308
  /*
14104
14309
  * Copyright (c) Microsoft Corporation. All rights reserved.
14105
14310
  * Licensed under the MIT License.
14106
14311
  */
14107
14312
  /**
14108
- * Builds the URL of the popup-relay page to open. The action the relay page
14109
- * must perform (GET navigation or POST form) is carried in the page's hash
14110
- * (client-side only, never sent to a server), keyed by the per-request
14111
- * library-state `id` so the relay page can listen on the right BroadcastChannel
14112
- * and echo the id back. The relay URI is resolved against the app origin, so it
14113
- * must be same-origin as the embedded frame. See `runPopupRelay`.
14313
+ * Builds the same-origin relay URL. V1 preserves the fragment descriptor;
14314
+ * explicitly selected v2 carries only the id and retains the navigation for
14315
+ * the authenticated handoff.
14114
14316
  *
14115
14317
  * @internal
14116
14318
  */
14117
- function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
14118
- const req = { id, ...action };
14319
+ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId, protocolVersion) {
14320
+ const version = getPopupRelayProtocolVersion(protocolVersion, correlationId);
14119
14321
  const target = new URL(popupRelayUri, window.location.origin);
14120
14322
  /*
14121
14323
  * The relay page must be same-origin as the embedded frame: the response is
@@ -14128,7 +14330,12 @@ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
14128
14330
  throw createBrowserAuthError(popupRelayUnsupportedFlow, correlationId, "popup_relay_cross_origin");
14129
14331
  }
14130
14332
  const hashParams = new URLSearchParams();
14131
- hashParams.set("req", JSON.stringify(req));
14333
+ if (version === 1) {
14334
+ hashParams.set("req", JSON.stringify({ id, ...action }));
14335
+ }
14336
+ else {
14337
+ hashParams.set("id", id);
14338
+ }
14132
14339
  target.hash = hashParams.toString();
14133
14340
  return target.toString();
14134
14341
  }
@@ -14139,21 +14346,30 @@ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
14139
14346
  * partitioning blocks the BroadcastChannel the redirect bridge uses from
14140
14347
  * reaching the embedded frame.
14141
14348
  *
14142
- * The response is accepted only from the popup window we opened, on our own
14143
- * origin (the relay page is same-origin as the embedded frame), and only when
14144
- * it carries the matching per-request library-state id.
14349
+ * In v2, the retained navigation is sent once, after a ready signal from the popup
14350
+ * window we opened on our own origin with the matching library-state id.
14351
+ * Successful responses must also carry that handoff's relay-document nonce.
14352
+ * Setup failures can reject the request before the handoff completes.
14145
14353
  *
14146
14354
  * @internal
14147
14355
  */
14148
- async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow, performanceClient) {
14356
+ async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow, performanceClient, action, protocolVersion) {
14357
+ const version = getPopupRelayProtocolVersion(protocolVersion, request.correlationId);
14358
+ if (version === 2 && !action) {
14359
+ throw createBrowserAuthError(popupRelayUnsupportedFlow, request.correlationId, "popup_relay_bad_request");
14360
+ }
14149
14361
  return new Promise((resolve, reject) => {
14150
14362
  const correlationId = request.correlationId;
14151
14363
  logger.verbose("1d05g9", correlationId);
14152
- performanceClient.addFields({ redirectBridgeTimeoutMs: timeoutMs }, correlationId);
14364
+ performanceClient.addFields({
14365
+ redirectBridgeTimeoutMs: timeoutMs,
14366
+ popupRelayProtocolVersion: version,
14367
+ }, correlationId);
14153
14368
  const { libraryState } = parseRequestState(base64Decode, request.state || "", correlationId);
14154
14369
  const expectedId = libraryState.id;
14155
14370
  const expectedOrigin = window.location.origin;
14156
14371
  let settled = false;
14372
+ let handoffNonce = "";
14157
14373
  const cleanup = () => {
14158
14374
  window.removeEventListener("message", onMessage);
14159
14375
  clearTimeout(timeoutId);
@@ -14165,20 +14381,52 @@ async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow
14165
14381
  return;
14166
14382
  }
14167
14383
  const data = event.data;
14168
- if (!data ||
14169
- data.type !== POPUP_RELAY_RESPONSE_TYPE ||
14170
- data.id !== expectedId) {
14384
+ if (!data || data.id !== expectedId) {
14171
14385
  return;
14172
14386
  }
14173
14387
  if (settled) {
14174
14388
  return;
14175
14389
  }
14390
+ if (version === 2 && data.type === POPUP_RELAY_READY_TYPE) {
14391
+ if (handoffNonce ||
14392
+ typeof data.nonce !== "string" ||
14393
+ !data.nonce) {
14394
+ return;
14395
+ }
14396
+ handoffNonce = data.nonce;
14397
+ try {
14398
+ popupWindow.postMessage({
14399
+ type: POPUP_RELAY_REQUEST_TYPE,
14400
+ id: expectedId,
14401
+ nonce: handoffNonce,
14402
+ request: { id: expectedId, ...action },
14403
+ }, expectedOrigin);
14404
+ performanceClient.addFields({ "ext.popupRelayRequestSent": true }, correlationId);
14405
+ }
14406
+ catch {
14407
+ settled = true;
14408
+ cleanup();
14409
+ logger.error("0sx3jz", correlationId);
14410
+ reject(createBrowserAuthError(popupWindowError, correlationId, "popup_relay_handoff_failed"));
14411
+ }
14412
+ return;
14413
+ }
14414
+ const hasError = typeof data.error === "string" && data.error.length > 0;
14415
+ const responseType = version === 1
14416
+ ? POPUP_RELAY_RESPONSE_TYPE
14417
+ : POPUP_RELAY_V2_RESPONSE_TYPE;
14418
+ if (data.type !== responseType ||
14419
+ (version === 2 &&
14420
+ ((!handoffNonce && !hasError) ||
14421
+ (handoffNonce && data.nonce !== handoffNonce)))) {
14422
+ return;
14423
+ }
14176
14424
  settled = true;
14177
14425
  cleanup();
14178
- if (data.error) {
14179
- reject(createBrowserAuthError(data.error, correlationId));
14426
+ if (hasError) {
14427
+ reject(createBrowserAuthError(data.error, correlationId, data.subError));
14180
14428
  }
14181
- else if (data.payload) {
14429
+ else if (typeof data.payload === "string" && data.payload) {
14182
14430
  resolve(data.payload);
14183
14431
  }
14184
14432
  else {
@@ -15847,6 +16095,36 @@ function getAuthorizeFormAction(authority, request, parameters) {
15847
16095
  addCorrelationId(queryParams, request.correlationId);
15848
16096
  return getAuthorizeUrl(authority, queryParams);
15849
16097
  }
16098
+ /**
16099
+ * Prepares the selected EAR construction.
16100
+ * @internal
16101
+ */
16102
+ async function initializeEarRequest(config, request, logger, performanceClient) {
16103
+ if (!config.experimental.enableAsymmetricEar) {
16104
+ const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, logger, performanceClient, request.correlationId)();
16105
+ return {
16106
+ ...request,
16107
+ earJwk,
16108
+ asymmetricEar: undefined,
16109
+ };
16110
+ }
16111
+ try {
16112
+ const { privateJwk, publicJwk } = await invokeAsync(generateAsymmetricEarKey, GenerateAsymmetricEarKey, logger, performanceClient, request.correlationId)();
16113
+ const apv = generateAsymmetricEarApv(publicJwk);
16114
+ const earJwk = base64Encode(JSON.stringify(publicJwk));
16115
+ return {
16116
+ ...request,
16117
+ earJwk,
16118
+ asymmetricEar: { privateJwk, apv },
16119
+ };
16120
+ }
16121
+ catch (error) {
16122
+ if (error instanceof AuthError) {
16123
+ throw error;
16124
+ }
16125
+ throw createBrowserAuthError(asymmetricEarKeyError, request.correlationId, "request_initialization_failed" /* AsymmetricEarSubErrors.RequestInitializationFailed */);
16126
+ }
16127
+ }
15850
16128
  /**
15851
16129
  * Builds the action URL + POST-body fields for the EAR /authorize form.
15852
16130
  */
@@ -15856,7 +16134,18 @@ async function getEARFormData(config, authority, request, logger, performanceCli
15856
16134
  }
15857
16135
  const parameters = await getStandardParameters(config, authority, request, logger, performanceClient);
15858
16136
  addResponseType(parameters, OAuthResponseType.IDTOKEN_TOKEN_REFRESHTOKEN);
15859
- addEARParameters(parameters, request.earJwk);
16137
+ try {
16138
+ addEARParameters(parameters, request.earJwk, request.asymmetricEar
16139
+ ? base64Encode(JSON.stringify({
16140
+ alg: "ECDH-ES",
16141
+ enc: "A256GCM",
16142
+ apv: request.asymmetricEar.apv,
16143
+ }))
16144
+ : undefined);
16145
+ }
16146
+ catch {
16147
+ throw createBrowserAuthError(asymmetricEarKeyError, request.correlationId, "request_encoding_failed" /* AsymmetricEarSubErrors.RequestEncodingFailed */);
16148
+ }
15860
16149
  // Also add codeChallenge as backup in case EAR is not supported
15861
16150
  addCodeChallengeParams(parameters, request.codeChallenge, S256_CODE_CHALLENGE_METHOD);
15862
16151
  addExtraParameters(parameters, {
@@ -15940,12 +16229,14 @@ async function handleResponsePlatformBroker(request, accountId, apiId, config, b
15940
16229
  const browserCrypto = new CryptoOps(logger, performanceClient);
15941
16230
  const nativeInteractionClient = new PlatformAuthInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, config.system.navigationClient, apiId, performanceClient, platformAuthProvider, accountId, nativeStorage, request.correlationId, tokenBindingKeyManager);
15942
16231
  const { userRequestState } = parseRequestState(browserCrypto.base64Decode, request.state, request.correlationId);
16232
+ const brokerRequest = {
16233
+ ...request,
16234
+ state: userRequestState,
16235
+ prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
16236
+ };
16237
+ delete brokerRequest.asymmetricEar;
15943
16238
  try {
15944
- return await invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)({
15945
- ...request,
15946
- state: userRequestState,
15947
- prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
15948
- });
16239
+ return await invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)(brokerRequest);
15949
16240
  }
15950
16241
  catch (e) {
15951
16242
  await removeTokenBindingKeyOnFailure(request, tokenBindingKeyManager, logger, performanceClient);
@@ -16010,7 +16301,20 @@ async function handleResponseEAR(request, response, apiId, config, authority, br
16010
16301
  if (!request.earJwk) {
16011
16302
  throw createBrowserAuthError(earJwkEmpty, request.correlationId);
16012
16303
  }
16013
- const decryptedData = JSON.parse(await invokeAsync(decryptEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.earJwk, response.ear_jwe));
16304
+ let plaintext;
16305
+ if (request.asymmetricEar) {
16306
+ 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 });
16307
+ }
16308
+ else {
16309
+ plaintext = await invokeAsync(decryptEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.earJwk, response.ear_jwe);
16310
+ }
16311
+ let decryptedData;
16312
+ try {
16313
+ decryptedData = JSON.parse(plaintext);
16314
+ }
16315
+ catch {
16316
+ throw createBrowserAuthError(failedToDecryptEarResponse, request.correlationId, "invalid_decrypted_response_payload" /* AsymmetricEarSubErrors.InvalidDecryptedResponsePayload */);
16317
+ }
16014
16318
  if (decryptedData.accountId) {
16015
16319
  return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, decryptedData.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
16016
16320
  }
@@ -16301,6 +16605,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
16301
16605
  : "",
16302
16606
  postLogoutRedirectUri: "",
16303
16607
  popupRelayUri: "",
16608
+ popupRelayProtocolVersion: 1,
16304
16609
  clientCapabilities: [],
16305
16610
  OIDCOptions: {
16306
16611
  responseMode: ResponseMode$1.FRAGMENT,
@@ -16367,6 +16672,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
16367
16672
  client: new StubPerformanceClient(),
16368
16673
  };
16369
16674
  const DEFAULT_EXPERIMENTAL_OPTIONS = {
16675
+ enableAsymmetricEar: false,
16370
16676
  iframeTimeoutTelemetry: false,
16371
16677
  allowPlatformBrokerWithDOM: false,
16372
16678
  };
@@ -16420,9 +16726,16 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
16420
16726
  experimental: {
16421
16727
  ...DEFAULT_EXPERIMENTAL_OPTIONS,
16422
16728
  ...userInputExperimental,
16729
+ enableAsymmetricEar: userInputExperimental?.enableAsymmetricEar ?? false,
16423
16730
  },
16424
16731
  telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry },
16425
16732
  };
16733
+ if (overlayedConfig.experimental.enableAsymmetricEar &&
16734
+ overlayedConfig.system.protocolMode !== ProtocolMode.EAR) {
16735
+ const logger = new Logger(providedSystemOptions.loggerOptions, name, version);
16736
+ logger.warning("07xxx7", "");
16737
+ overlayedConfig.experimental.enableAsymmetricEar = false;
16738
+ }
16426
16739
  return overlayedConfig;
16427
16740
  }
16428
16741
 
@@ -17327,19 +17640,21 @@ class PopupClient extends StandardInteractionClient {
17327
17640
  /*
17328
17641
  * When a popup-relay page is configured, open it top-level
17329
17642
  * (same first-party origin) instead of navigating the popup
17330
- * straight to the IdP, and carry the /authorize URL in its hash.
17643
+ * straight to the IdP. V1 carries the action in the hash; v2
17644
+ * retains it for the authenticated handoff.
17331
17645
  * The relay page opens the IdP child popup and relays the
17332
17646
  * response back via postMessage (see waitForPopupResponse).
17333
17647
  */
17334
17648
  const popupRelayUri = this.config.auth.popupRelayUri;
17649
+ popupParams.relayAction = { method: "GET", url: navigateUrl };
17335
17650
  const popupNavigateUrl = popupRelayUri
17336
- ? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), { method: "GET", url: navigateUrl }, correlationId)
17651
+ ? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), popupParams.relayAction, correlationId, this.config.auth.popupRelayProtocolVersion)
17337
17652
  : navigateUrl;
17338
17653
  // Show the UI once the url has been created. Get the window handle for the popup.
17339
17654
  const popupWindow = this.initiateAuthRequest(popupNavigateUrl, popupParams);
17340
17655
  this.eventHandler.emitEvent(EventType.POPUP_OPENED, correlationId, exports.InteractionType.Popup, { popupWindow }, null);
17341
17656
  // Wait for the redirect bridge response
17342
- const responseString = await this.waitForPopupResponse(request, popupWindow, popupParams.popupWindowParent);
17657
+ const responseString = await this.waitForPopupResponse(request, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
17343
17658
  const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
17344
17659
  return await invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(popupRequest, serverParams, pkce.verifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
17345
17660
  }
@@ -17363,21 +17678,20 @@ class PopupClient extends StandardInteractionClient {
17363
17678
  const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
17364
17679
  // Get the frame handle for the silent request
17365
17680
  const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger, authority, azureCloudOptions, extraQueryParameters, account);
17366
- const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, this.logger, this.performanceClient, correlationId)();
17367
17681
  const pkce = pkceCodes ||
17368
17682
  (await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId));
17369
17683
  const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17370
- const popupRequest = {
17684
+ let popupRequest = {
17371
17685
  ...request,
17372
- earJwk: earJwk,
17373
17686
  codeChallenge: pkce.challenge,
17374
17687
  ...tokenBindingParams,
17375
17688
  popupOriginCheckDone: this.getPopupOriginCheckDone(popupParams.popupWindowParent),
17376
17689
  };
17377
17690
  try {
17691
+ popupRequest = await initializeEarRequest(this.config, popupRequest, this.logger, this.performanceClient);
17378
17692
  const popupWindow = await this.openPostFormPopup(popupRequest, discoveredAuthority, popupParams, correlationId, true);
17379
17693
  // Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
17380
- const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(popupRequest, popupWindow, popupParams.popupWindowParent);
17694
+ const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(popupRequest, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
17381
17695
  const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
17382
17696
  if (!serverParams.ear_jwe && serverParams.code) {
17383
17697
  const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, correlationId)({
@@ -17405,7 +17719,7 @@ class PopupClient extends StandardInteractionClient {
17405
17719
  const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger);
17406
17720
  const popupWindow = await this.openPostFormPopup(request, discoveredAuthority, popupParams, correlationId, false);
17407
17721
  // Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
17408
- const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(request, popupWindow, popupParams.popupWindowParent);
17722
+ const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(request, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
17409
17723
  const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
17410
17724
  return invokeAsync(handleResponseCode, HandleResponseCode, this.logger, this.performanceClient, correlationId)(request, serverParams, pkceVerifier, ApiId.acquireTokenPopup, this.config, authClient, this.browserStorage, this.nativeStorage, this.eventHandler, this.logger, this.performanceClient, this.platformAuthProvider, this.tokenBindingKeyManager);
17411
17725
  }
@@ -17461,21 +17775,22 @@ class PopupClient extends StandardInteractionClient {
17461
17775
  this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, validRequest.correlationId, exports.InteractionType.Popup, validRequest);
17462
17776
  /*
17463
17777
  * When a popup-relay page is configured, open it top-level (same
17464
- * first-party origin) and carry the end-session URL in its hash,
17465
- * exactly like the login flow. The relay page opens the IdP child
17778
+ * first-party origin), using the configured wire protocol for the
17779
+ * end-session URL. The relay page opens the IdP child
17466
17780
  * popup and the post-logout redirect page (running the redirect
17467
17781
  * bridge) relays completion back via postMessage — so logout works
17468
17782
  * from an embedded, cross-origin iframe where a direct popup to the
17469
17783
  * IdP cannot. See runPopupRelay / waitForPopupResponse.
17470
17784
  */
17471
17785
  const popupRelayUri = this.config.auth.popupRelayUri;
17786
+ popupParams.relayAction = { method: "GET", url: logoutUri };
17472
17787
  const popupNavigateUrl = popupRelayUri
17473
- ? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(validRequest.state || "", this.correlationId), { method: "GET", url: logoutUri }, this.correlationId)
17788
+ ? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(validRequest.state || "", this.correlationId), popupParams.relayAction, this.correlationId, this.config.auth.popupRelayProtocolVersion)
17474
17789
  : logoutUri;
17475
17790
  // Open the popup window to requestUrl.
17476
17791
  const popupWindow = this.openPopup(popupNavigateUrl, popupParams);
17477
17792
  this.eventHandler.emitEvent(EventType.POPUP_OPENED, validRequest.correlationId, exports.InteractionType.Popup, { popupWindow }, null);
17478
- await this.waitForPopupResponse(validRequest, popupWindow, popupParams.popupWindowParent).catch(() => {
17793
+ await this.waitForPopupResponse(validRequest, popupWindow, popupParams.popupWindowParent, popupParams.relayAction).catch(() => {
17479
17794
  // Swallow any errors related to monitoring the window. Server logout is best effort
17480
17795
  });
17481
17796
  if (mainWindowRedirectUri) {
@@ -17687,11 +18002,12 @@ class PopupClient extends StandardInteractionClient {
17687
18002
  ? getEARFormData
17688
18003
  : getCodeFormData;
17689
18004
  const formData = await getFormData(this.config, discoveredAuthority, request, this.logger, this.performanceClient);
17690
- const relayUrl = buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), {
18005
+ popupParams.relayAction = {
17691
18006
  method: "POST",
17692
18007
  action: formData.action,
17693
18008
  fields: formData.fields,
17694
- }, correlationId);
18009
+ };
18010
+ const relayUrl = buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), popupParams.relayAction, correlationId, this.config.auth.popupRelayProtocolVersion);
17695
18011
  return this.initiateAuthRequest(relayUrl, popupParams);
17696
18012
  }
17697
18013
  const popupWindow = popupParams.popup || this.openPopup("about:blank", popupParams);
@@ -17700,7 +18016,7 @@ class PopupClient extends StandardInteractionClient {
17700
18016
  form.submit();
17701
18017
  return popupWindow;
17702
18018
  }
17703
- async waitForPopupResponse(request, popupWindow, popupWindowParent) {
18019
+ async waitForPopupResponse(request, popupWindow, popupWindowParent, relayAction) {
17704
18020
  /*
17705
18021
  * When a popup-relay page is configured the response is relayed back to
17706
18022
  * this frame by the relay page via postMessage, and the relay popup's
@@ -17710,7 +18026,11 @@ class PopupClient extends StandardInteractionClient {
17710
18026
  * frame and which does not track the relay popup.
17711
18027
  */
17712
18028
  if (this.config.auth.popupRelayUri) {
17713
- return waitForPopupRelayResponse(this.config.system.popupBridgeTimeout, this.logger, request, popupWindow, this.performanceClient);
18029
+ if (this.config.auth.popupRelayProtocolVersion === 2 &&
18030
+ !relayAction) {
18031
+ throw createBrowserAuthError(popupRelayUnsupportedFlow, this.correlationId, "popup_relay_bad_request");
18032
+ }
18033
+ return waitForPopupRelayResponse(this.config.system.popupBridgeTimeout, this.logger, request, popupWindow, this.performanceClient, relayAction, this.config.auth.popupRelayProtocolVersion);
17714
18034
  }
17715
18035
  if (this.waitForPopupResponseHook) {
17716
18036
  return this.waitForPopupResponseHook(request, popupWindow, popupWindowParent);
@@ -17835,16 +18155,15 @@ class RedirectClient extends StandardInteractionClient {
17835
18155
  const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
17836
18156
  // Get the frame handle for the silent request
17837
18157
  const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger, authority, azureCloudOptions, extraQueryParameters, account);
17838
- const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, this.logger, this.performanceClient, correlationId)();
17839
18158
  const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
17840
18159
  const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17841
- const redirectRequest = {
18160
+ let redirectRequest = {
17842
18161
  ...request,
17843
- earJwk: earJwk,
17844
18162
  codeChallenge: pkceCodes.challenge,
17845
18163
  ...tokenBindingParams,
17846
18164
  };
17847
18165
  try {
18166
+ redirectRequest = await initializeEarRequest(this.config, redirectRequest, this.logger, this.performanceClient);
17848
18167
  if (!(await isTokenBindingKeyPersistedForRedirect(redirectRequest, this.tokenBindingKeyManager))) {
17849
18168
  throw createBrowserAuthError(cryptoKeyNotFound, this.correlationId);
17850
18169
  }
@@ -17857,9 +18176,10 @@ class RedirectClient extends StandardInteractionClient {
17857
18176
  }, this.config.system.redirectNavigationTimeout);
17858
18177
  });
17859
18178
  }
17860
- catch (e) {
18179
+ catch (error) {
18180
+ this.browserStorage.resetRequestCache(correlationId);
17861
18181
  await removeTokenBindingKeyOnFailure(redirectRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17862
- throw e;
18182
+ throw error;
17863
18183
  }
17864
18184
  }
17865
18185
  /**
@@ -18048,7 +18368,6 @@ class RedirectClient extends StandardInteractionClient {
18048
18368
  /**
18049
18369
  * Redirects window to given URL.
18050
18370
  * @param urlNavigate
18051
- * @param onRedirectNavigateRequest - onRedirectNavigate callback provided on the request
18052
18371
  */
18053
18372
  async initiateAuthRequest(requestUrl) {
18054
18373
  this.logger.verbose("0yaw2e", this.correlationId);
@@ -18336,13 +18655,11 @@ class SilentIframeClient extends StandardInteractionClient {
18336
18655
  async executeEarFlow(request) {
18337
18656
  const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
18338
18657
  const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger, authority, azureCloudOptions, extraQueryParameters, account);
18339
- const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, this.logger, this.performanceClient, correlationId)();
18340
18658
  const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
18341
- const silentRequest = {
18659
+ const silentRequest = await initializeEarRequest(this.config, {
18342
18660
  ...request,
18343
- earJwk: earJwk,
18344
18661
  codeChallenge: pkceCodes.challenge,
18345
- };
18662
+ }, this.logger, this.performanceClient);
18346
18663
  // Create the iframe, register the response listener, then navigate, so the listener is active before the iframe can respond.
18347
18664
  const iframe = createHiddenIframe();
18348
18665
  const responseType = this.config.auth.OIDCOptions.responseMode;
@@ -18704,6 +19021,7 @@ function prepareWebSilentRequest({ request, account, correlationId, config, }) {
18704
19021
  return {
18705
19022
  key: JSON.stringify({
18706
19023
  ...thumbprint,
19024
+ accountTenantId: account.tenantId,
18707
19025
  forceRefresh: !!request.forceRefresh,
18708
19026
  cacheLookupPolicy: request.cacheLookupPolicy ?? CacheLookupPolicy.Default,
18709
19027
  extraParameters: canonicalizeStringDict(request.extraParameters),