@azure/msal-browser 5.29.1 → 5.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (558) hide show
  1. package/README.md +4 -2
  2. package/dist/app/IPublicClientApplication.mjs +4 -1
  3. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  4. package/dist/app/PublicClientApplication.mjs +14 -2
  5. package/dist/app/PublicClientApplication.mjs.map +1 -1
  6. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +10 -23
  8. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  9. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  10. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +2 -3
  11. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  12. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +1 -1
  13. package/dist/cache/AccountManager.mjs +1 -1
  14. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  15. package/dist/cache/BrowserCacheManager.mjs +40 -4
  16. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  17. package/dist/cache/CacheHelpers.mjs +1 -1
  18. package/dist/cache/CacheKeys.mjs +1 -1
  19. package/dist/cache/CookieStorage.mjs +1 -1
  20. package/dist/cache/DatabaseStorage.mjs +1 -1
  21. package/dist/cache/EncryptedData.mjs +1 -1
  22. package/dist/cache/LocalStorage.mjs +1 -1
  23. package/dist/cache/MemoryStorage.mjs +1 -1
  24. package/dist/cache/SessionStorage.mjs +1 -1
  25. package/dist/cache/TokenCache.mjs +1 -1
  26. package/dist/config/Configuration.mjs +11 -2
  27. package/dist/config/Configuration.mjs.map +1 -1
  28. package/dist/controllers/NestedAppAuthController.mjs +26 -5
  29. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  30. package/dist/controllers/StandardController.mjs +44 -11
  31. package/dist/controllers/StandardController.mjs.map +1 -1
  32. package/dist/crypto/BrowserCrypto.mjs +189 -5
  33. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  34. package/dist/crypto/CryptoOps.mjs +1 -1
  35. package/dist/crypto/PkceGenerator.mjs +1 -1
  36. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  37. package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
  38. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  39. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -4
  40. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
  41. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +11 -4
  42. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  43. package/dist/custom_auth/core/CustomAuthAuthority.mjs +3 -3
  44. package/dist/custom_auth/core/CustomAuthAuthority.mjs.map +1 -1
  45. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -4
  51. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs.map +1 -1
  52. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -3
  53. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs.map +1 -1
  54. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  56. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -8
  57. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs.map +1 -1
  58. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  59. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -3
  60. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs.map +1 -1
  61. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -3
  62. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs.map +1 -1
  63. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  64. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  65. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -7
  66. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs.map +1 -1
  67. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +1 -2
  68. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -1
  69. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +1 -2
  70. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -1
  71. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +1 -1
  72. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs +1 -2
  73. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.mjs.map +1 -1
  74. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs +1 -2
  75. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.mjs.map +1 -1
  76. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +2 -5
  77. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -1
  78. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs +1 -2
  79. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.mjs.map +1 -1
  80. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +1 -1
  81. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +1 -2
  82. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -1
  83. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +1 -2
  84. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -1
  85. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +1 -2
  86. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -1
  87. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +1 -2
  88. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -1
  89. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs +2 -3
  90. package/dist/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -1
  91. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  92. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  93. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  94. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  95. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  96. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  97. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  98. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  99. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  100. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  101. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  102. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  103. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  104. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  105. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  106. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  107. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  108. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  109. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  110. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  111. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  112. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  113. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +32 -27
  114. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -1
  115. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +1 -1
  116. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +6 -2
  117. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -1
  118. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  119. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  120. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  121. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  122. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  123. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  124. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  125. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  126. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  127. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +1 -1
  128. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +7 -5
  129. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs.map +1 -1
  130. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +12 -3
  131. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -1
  132. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +1 -1
  133. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +9 -39
  134. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs.map +1 -1
  135. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +1 -1
  136. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +1 -1
  137. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +1 -1
  138. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -1
  139. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +1 -1
  140. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -1
  141. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  142. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  143. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +1 -1
  144. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  145. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  146. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  147. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  148. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  149. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  150. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  151. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  152. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  153. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  154. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  155. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  156. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +2 -1
  157. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
  158. package/dist/custom_auth/index.mjs +1 -1
  159. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  160. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  161. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  162. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  163. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  164. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  165. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  166. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  167. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  168. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  169. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  170. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +1 -2
  171. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -1
  172. package/dist/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateTransitionHandlerV2.mjs +1 -1
  173. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  174. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  175. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  176. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  177. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -3
  178. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs.map +1 -1
  179. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -3
  180. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs.map +1 -1
  181. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -3
  182. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs.map +1 -1
  183. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  184. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  185. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  186. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  187. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  188. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  189. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +1 -2
  190. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -1
  191. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInStateTransitionHandlerV2.mjs +1 -1
  192. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  193. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  194. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  195. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  196. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  197. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  198. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  199. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  200. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  201. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  202. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  203. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  204. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  205. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  206. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +1 -2
  207. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -1
  208. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountCodeRequiredStateV2.mjs +1 -1
  209. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountPasswordRequiredStateV2.mjs +1 -1
  210. package/dist/custom_auth/sign_up/auth_flow/v2/state/ExistingAccountStateTransitionHelperV2.mjs +1 -1
  211. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +1 -1
  212. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  213. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  214. package/dist/encode/Base64Decode.mjs +1 -1
  215. package/dist/encode/Base64Encode.mjs +1 -1
  216. package/dist/error/BrowserAuthError.mjs +1 -1
  217. package/dist/error/BrowserAuthErrorCodes.mjs +3 -2
  218. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
  219. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  220. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  221. package/dist/error/NativeAuthError.mjs +1 -1
  222. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  223. package/dist/error/NestedAppAuthError.mjs +1 -1
  224. package/dist/event/EventHandler.mjs +1 -1
  225. package/dist/event/EventMessage.mjs +1 -1
  226. package/dist/event/EventType.mjs +1 -1
  227. package/dist/index.mjs +1 -1
  228. package/dist/interaction_client/BaseInteractionClient.mjs +4 -2
  229. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  230. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  231. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +18 -5
  232. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  233. package/dist/interaction_client/PopupClient.mjs +27 -21
  234. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  235. package/dist/interaction_client/RedirectClient.mjs +8 -10
  236. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  237. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  238. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  239. package/dist/interaction_client/SilentIframeClient.mjs +5 -8
  240. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  241. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  242. package/dist/interaction_client/StandardInteractionClient.mjs +2 -1
  243. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  244. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  245. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  246. package/dist/log-strings-mapping.json +13 -9
  247. package/dist/naa/BridgeError.mjs +1 -1
  248. package/dist/naa/BridgeProxy.mjs +1 -1
  249. package/dist/naa/BridgeStatusCode.mjs +1 -1
  250. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  251. package/dist/navigation/NavigationClient.mjs +1 -1
  252. package/dist/network/FetchClient.mjs +1 -1
  253. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  254. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  255. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  256. package/dist/packageMetadata.mjs +2 -2
  257. package/dist/popup_relay/constants.mjs +24 -6
  258. package/dist/popup_relay/constants.mjs.map +1 -1
  259. package/dist/popup_relay/index.mjs +142 -44
  260. package/dist/popup_relay/index.mjs.map +1 -1
  261. package/dist/popup_relay/relayClient.mjs +66 -23
  262. package/dist/popup_relay/relayClient.mjs.map +1 -1
  263. package/dist/protocol/Authorize.mjs +71 -13
  264. package/dist/protocol/Authorize.mjs.map +1 -1
  265. package/dist/redirect_bridge/index.mjs +1 -1
  266. package/dist/request/RequestHelpers.mjs +2 -1
  267. package/dist/request/RequestHelpers.mjs.map +1 -1
  268. package/dist/request/SilentRequestHelpers.mjs +7 -4
  269. package/dist/request/SilentRequestHelpers.mjs.map +1 -1
  270. package/dist/response/ResponseHandler.mjs +1 -1
  271. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  272. package/dist/telemetry/BrowserPerformanceEvents.mjs +14 -2
  273. package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
  274. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  275. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  276. package/dist/utils/BrowserConstants.mjs +1 -1
  277. package/dist/utils/BrowserDetection.mjs +1 -1
  278. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  279. package/dist/utils/BrowserUtils.mjs +1 -1
  280. package/dist/utils/Helpers.mjs +1 -1
  281. package/dist/utils/IframeMonitor.mjs +1 -1
  282. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  283. package/dist/utils/PopupMonitor.mjs +1 -1
  284. package/dist/utils/PopupOriginCheck.mjs +1 -1
  285. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  286. package/dist/webBrokerBridge/PerfEventNames.mjs +1 -1
  287. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  288. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  289. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  290. package/dist/webBrokerBridge/index.mjs +1 -1
  291. package/lib/custom-auth-path/log-strings-mapping.json +13 -9
  292. package/lib/custom-auth-path/msal-custom-auth.cjs +764 -314
  293. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  294. package/lib/custom-auth-path/msal-custom-auth.js +764 -314
  295. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  296. package/lib/log-strings-mapping.json +13 -9
  297. package/lib/msal-browser.cjs +791 -215
  298. package/lib/msal-browser.cjs.map +1 -1
  299. package/lib/msal-browser.js +791 -215
  300. package/lib/msal-browser.js.map +1 -1
  301. package/lib/msal-browser.min.js +2 -2
  302. package/lib/popup-relay/msal-popup-relay.cjs +231 -60
  303. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  304. package/lib/popup-relay/msal-popup-relay.js +231 -60
  305. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  306. package/lib/popup-relay/msal-popup-relay.min.js +2 -2
  307. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  308. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  309. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  310. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  311. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  312. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +1 -1
  313. package/package.json +2 -2
  314. package/src/app/IPublicClientApplication.ts +16 -0
  315. package/src/app/PublicClientApplication.ts +22 -0
  316. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +11 -44
  317. package/src/broker/nativeBroker/PlatformAuthProvider.ts +1 -2
  318. package/src/broker/nativeBroker/PlatformAuthResponse.ts +2 -6
  319. package/src/cache/BrowserCacheManager.ts +66 -6
  320. package/src/config/Configuration.ts +35 -0
  321. package/src/controllers/NestedAppAuthController.ts +35 -2
  322. package/src/controllers/StandardController.ts +76 -12
  323. package/src/controllers/UnknownOperatingContextController.ts +10 -0
  324. package/src/crypto/BrowserCrypto.ts +367 -2
  325. package/src/custom_auth/CustomAuthActionInputs.ts +0 -9
  326. package/src/custom_auth/CustomAuthPublicClientApplication.ts +0 -3
  327. package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +0 -3
  328. package/src/custom_auth/controller/CustomAuthStandardController.ts +15 -2
  329. package/src/custom_auth/core/CustomAuthAuthority.ts +2 -1
  330. package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.ts +0 -3
  331. package/src/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.ts +0 -2
  332. package/src/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.ts +0 -7
  333. package/src/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.ts +0 -2
  334. package/src/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.ts +0 -2
  335. package/src/custom_auth/core/auth_flow/mfa/state/MfaState.ts +0 -6
  336. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.ts +0 -1
  337. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +0 -1
  338. package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +0 -4
  339. package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +0 -1
  340. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.ts +0 -1
  341. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.ts +0 -2
  342. package/src/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.ts +0 -2
  343. package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +0 -2
  344. package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +0 -2
  345. package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +0 -2
  346. package/src/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.ts +0 -2
  347. package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +0 -2
  348. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.ts +0 -1
  349. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +0 -3
  350. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.ts +0 -1
  351. package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +0 -1
  352. package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +0 -1
  353. package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +0 -1
  354. package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +0 -1
  355. package/src/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.ts +8 -6
  356. package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +1 -0
  357. package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +43 -29
  358. package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +21 -2
  359. package/src/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.ts +12 -8
  360. package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +35 -4
  361. package/src/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.ts +10 -47
  362. package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +1 -0
  363. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +9 -0
  364. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +5 -5
  365. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +2 -5
  366. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +2 -4
  367. package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +1 -0
  368. package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +0 -2
  369. package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +0 -1
  370. package/src/custom_auth/sign_in/auth_flow/result/SignInResult.ts +0 -2
  371. package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.ts +0 -2
  372. package/src/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.ts +0 -2
  373. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +0 -2
  374. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +0 -2
  375. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +0 -1
  376. package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +0 -2
  377. package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +0 -2
  378. package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +0 -1
  379. package/src/error/AsymmetricEarSubErrors.ts +18 -0
  380. package/src/error/BrowserAuthErrorCodes.ts +1 -0
  381. package/src/interaction_client/BaseInteractionClient.ts +6 -1
  382. package/src/interaction_client/PlatformAuthInteractionClient.ts +28 -8
  383. package/src/interaction_client/PopupClient.ts +59 -29
  384. package/src/interaction_client/RedirectClient.ts +10 -13
  385. package/src/interaction_client/SilentIframeClient.ts +9 -13
  386. package/src/interaction_client/StandardInteractionClient.ts +1 -0
  387. package/src/packageMetadata.ts +1 -1
  388. package/src/popup_relay/constants.ts +34 -3
  389. package/src/popup_relay/index.ts +200 -45
  390. package/src/popup_relay/relayClient.ts +108 -24
  391. package/src/protocol/Authorize.ts +123 -11
  392. package/src/request/EndSessionPopupRequest.ts +3 -0
  393. package/src/request/PopupRequest.ts +1 -0
  394. package/src/request/RedirectRequest.ts +4 -0
  395. package/src/request/RequestHelpers.ts +5 -0
  396. package/src/request/SilentRequestHelpers.ts +10 -4
  397. package/src/request/SsoSilentRequest.ts +1 -0
  398. package/src/telemetry/BrowserPerformanceEvents.ts +14 -0
  399. package/types/app/IPublicClientApplication.d.ts +8 -0
  400. package/types/app/IPublicClientApplication.d.ts.map +1 -1
  401. package/types/app/PublicClientApplication.d.ts +6 -1
  402. package/types/app/PublicClientApplication.d.ts.map +1 -1
  403. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +0 -1
  404. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  405. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  406. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +2 -6
  407. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
  408. package/types/cache/BrowserCacheManager.d.ts +20 -2
  409. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  410. package/types/config/Configuration.d.ts +14 -0
  411. package/types/config/Configuration.d.ts.map +1 -1
  412. package/types/controllers/NestedAppAuthController.d.ts +5 -0
  413. package/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  414. package/types/controllers/StandardController.d.ts +4 -0
  415. package/types/controllers/StandardController.d.ts.map +1 -1
  416. package/types/controllers/UnknownOperatingContextController.d.ts +5 -0
  417. package/types/controllers/UnknownOperatingContextController.d.ts.map +1 -1
  418. package/types/crypto/BrowserCrypto.d.ts +34 -0
  419. package/types/crypto/BrowserCrypto.d.ts.map +1 -1
  420. package/types/custom_auth/CustomAuthActionInputs.d.ts +0 -9
  421. package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  422. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  423. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +0 -3
  424. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
  425. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +0 -3
  426. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -1
  427. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  428. package/types/custom_auth/core/CustomAuthAuthority.d.ts.map +1 -1
  429. package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts +0 -3
  430. package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.d.ts.map +1 -1
  431. package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts +0 -2
  432. package/types/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.d.ts.map +1 -1
  433. package/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts +0 -7
  434. package/types/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.d.ts.map +1 -1
  435. package/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts +0 -2
  436. package/types/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.d.ts.map +1 -1
  437. package/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts +0 -2
  438. package/types/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.d.ts.map +1 -1
  439. package/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts +0 -6
  440. package/types/custom_auth/core/auth_flow/mfa/state/MfaState.d.ts.map +1 -1
  441. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts +0 -1
  442. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodRegistrationV2.d.ts.map +1 -1
  443. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +0 -1
  444. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -1
  445. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +0 -4
  446. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -1
  447. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +0 -1
  448. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -1
  449. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts +0 -1
  450. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorV2.d.ts.map +1 -1
  451. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts +0 -2
  452. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodRegistrationChallengeResultV2.d.ts.map +1 -1
  453. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts +0 -2
  454. package/types/custom_auth/core/auth_flow/v2/result/AuthMethodVerificationSubmitChallengeResultV2.d.ts.map +1 -1
  455. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +0 -2
  456. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -1
  457. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +0 -2
  458. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -1
  459. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +0 -2
  460. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -1
  461. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +0 -2
  462. package/types/custom_auth/core/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -1
  463. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +0 -2
  464. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -1
  465. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts +0 -1
  466. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodRegistrationRequiredStateV2.d.ts.map +1 -1
  467. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +0 -1
  468. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -1
  469. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts +0 -1
  470. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodVerificationRequiredStateV2.d.ts.map +1 -1
  471. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +0 -1
  472. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -1
  473. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +0 -1
  474. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -1
  475. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +0 -1
  476. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -1
  477. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +0 -1
  478. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -1
  479. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +0 -1
  480. package/types/custom_auth/core/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -1
  481. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +1 -0
  482. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -1
  483. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +3 -2
  484. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -1
  485. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +10 -1
  486. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -1
  487. package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts +1 -1
  488. package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts.map +1 -1
  489. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -1
  490. package/types/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.d.ts.map +1 -1
  491. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +1 -0
  492. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -1
  493. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +8 -0
  494. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -1
  495. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts +4 -5
  496. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -1
  497. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +3 -6
  498. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -1
  499. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +2 -5
  500. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -1
  501. package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  502. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +0 -2
  503. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -1
  504. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +0 -1
  505. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -1
  506. package/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts +0 -2
  507. package/types/custom_auth/sign_in/auth_flow/result/SignInResult.d.ts.map +1 -1
  508. package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts +0 -2
  509. package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.d.ts.map +1 -1
  510. package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts +0 -2
  511. package/types/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.d.ts.map +1 -1
  512. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +0 -2
  513. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -1
  514. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +0 -2
  515. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -1
  516. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +0 -1
  517. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -1
  518. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +0 -2
  519. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -1
  520. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +0 -2
  521. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -1
  522. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +0 -1
  523. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -1
  524. package/types/error/AsymmetricEarSubErrors.d.ts +14 -0
  525. package/types/error/AsymmetricEarSubErrors.d.ts.map +1 -0
  526. package/types/error/BrowserAuthErrorCodes.d.ts +1 -0
  527. package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
  528. package/types/interaction_client/BaseInteractionClient.d.ts +3 -2
  529. package/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  530. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  531. package/types/interaction_client/PopupClient.d.ts +3 -1
  532. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  533. package/types/interaction_client/RedirectClient.d.ts +0 -1
  534. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  535. package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  536. package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  537. package/types/packageMetadata.d.ts +1 -1
  538. package/types/popup_relay/constants.d.ts +10 -3
  539. package/types/popup_relay/constants.d.ts.map +1 -1
  540. package/types/popup_relay/index.d.ts +27 -11
  541. package/types/popup_relay/index.d.ts.map +1 -1
  542. package/types/popup_relay/relayClient.d.ts +9 -11
  543. package/types/popup_relay/relayClient.d.ts.map +1 -1
  544. package/types/protocol/Authorize.d.ts +5 -0
  545. package/types/protocol/Authorize.d.ts.map +1 -1
  546. package/types/request/EndSessionPopupRequest.d.ts +3 -0
  547. package/types/request/EndSessionPopupRequest.d.ts.map +1 -1
  548. package/types/request/PopupRequest.d.ts +1 -1
  549. package/types/request/PopupRequest.d.ts.map +1 -1
  550. package/types/request/RedirectRequest.d.ts +4 -1
  551. package/types/request/RedirectRequest.d.ts.map +1 -1
  552. package/types/request/RequestHelpers.d.ts.map +1 -1
  553. package/types/request/SilentRequestHelpers.d.ts +1 -1
  554. package/types/request/SilentRequestHelpers.d.ts.map +1 -1
  555. package/types/request/SsoSilentRequest.d.ts +1 -1
  556. package/types/request/SsoSilentRequest.d.ts.map +1 -1
  557. package/types/telemetry/BrowserPerformanceEvents.d.ts +12 -0
  558. package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v5.29.1 2026-11-12 */
1
+ /*! @azure/msal-browser v5.31.0 2026-12-02 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
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.18.0 2026-12-02 */
1031
1031
 
1032
1032
  /*
1033
1033
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1047,21 +1047,38 @@ class AuthenticationHeaderParser {
1047
1047
  * @returns
1048
1048
  */
1049
1049
  getShrNonce() {
1050
- // Attempt to parse nonce from Authentiacation-Info
1050
+ // Attempt to parse nonce from Authentication-Info
1051
1051
  const authenticationInfo = getResponseHeader(this.headers, HeaderNames.AuthenticationInfo);
1052
1052
  if (authenticationInfo) {
1053
- const authenticationInfoChallenges = this.parseChallenges(authenticationInfo);
1054
- if (authenticationInfoChallenges.nextnonce) {
1055
- return authenticationInfoChallenges.nextnonce;
1053
+ // Also support the legacy PoP-prefixed Authentication-Info form.
1054
+ const parameters = this.parseChallenges(authenticationInfo.trim().replace(/^PoP[ \t]+/i, ""));
1055
+ for (const parameter of parameters) {
1056
+ const nextNonce = getHeaderParameter(parameter, "nextnonce");
1057
+ if (nextNonce) {
1058
+ return nextNonce;
1059
+ }
1056
1060
  }
1057
1061
  throw createClientConfigurationError(invalidAuthenticationHeader, "");
1058
1062
  }
1059
1063
  // Attempt to parse nonce from WWW-Authenticate
1060
1064
  const wwwAuthenticate = getResponseHeader(this.headers, HeaderNames.WWWAuthenticate);
1061
1065
  if (wwwAuthenticate) {
1062
- const wwwAuthenticateChallenges = this.parseChallenges(wwwAuthenticate);
1063
- if (wwwAuthenticateChallenges.nonce) {
1064
- return wwwAuthenticateChallenges.nonce;
1066
+ let isPopChallenge = false;
1067
+ for (const parameter of this.parseChallenges(wwwAuthenticate)) {
1068
+ const scheme = /^[^ \t=]+/.exec(parameter)?.[0] || "";
1069
+ const remainder = parameter.slice(scheme.length).trim();
1070
+ let authParameter = parameter;
1071
+ // A scheme starts a new challenge; whitespace before '=' does not.
1072
+ if (scheme && !remainder.startsWith("=")) {
1073
+ isPopChallenge = scheme.toLowerCase() === "pop";
1074
+ authParameter = remainder;
1075
+ }
1076
+ if (isPopChallenge) {
1077
+ const nonce = getHeaderParameter(authParameter, "nonce");
1078
+ if (nonce) {
1079
+ return nonce;
1080
+ }
1081
+ }
1065
1082
  }
1066
1083
  throw createClientConfigurationError(invalidAuthenticationHeader, "");
1067
1084
  }
@@ -1069,24 +1086,53 @@ class AuthenticationHeaderParser {
1069
1086
  throw createClientConfigurationError(missingNonceAuthenticationHeader, "");
1070
1087
  }
1071
1088
  /**
1072
- * Parses an HTTP header's challenge set into a key/value map.
1089
+ * Splits authentication parameters without splitting commas inside quoted strings.
1073
1090
  * @param header
1074
1091
  * @returns
1075
1092
  */
1076
1093
  parseChallenges(header) {
1077
- const schemeSeparator = header.indexOf(" ");
1078
- const challenges = header.substr(schemeSeparator + 1).split(",");
1079
- const challengeMap = {};
1080
- challenges.forEach((challenge) => {
1081
- const [key, value] = challenge.split("=");
1082
- // Remove escaped quotation marks (', ") from challenge string to keep only the challenge value
1083
- challengeMap[key] = unescape(value.replace(/['"]+/g, ""));
1084
- });
1085
- return challengeMap;
1094
+ const parameters = [];
1095
+ let inQuotes = false;
1096
+ let start = 0;
1097
+ for (let i = 0; i < header.length; i++) {
1098
+ const character = header[i];
1099
+ if (inQuotes && character === "\\") {
1100
+ i++;
1101
+ }
1102
+ else if (character === '"') {
1103
+ inQuotes = !inQuotes;
1104
+ }
1105
+ else if (character === "," && !inQuotes) {
1106
+ parameters.push(header.slice(start, i).trim());
1107
+ start = i + 1;
1108
+ }
1109
+ }
1110
+ if (!inQuotes) {
1111
+ parameters.push(header.slice(start).trim());
1112
+ }
1113
+ return parameters;
1114
+ }
1115
+ }
1116
+ /**
1117
+ * Reads a named authentication parameter, removing only HTTP quoted-string syntax.
1118
+ * @param parameter - A single authentication parameter.
1119
+ * @param name - The parameter name to read.
1120
+ * @returns The opaque parameter value, or undefined if the name does not match.
1121
+ */
1122
+ function getHeaderParameter(parameter, name) {
1123
+ const separator = parameter.indexOf("=");
1124
+ if (separator === -1 ||
1125
+ parameter.slice(0, separator).trim().toLowerCase() !== name) {
1126
+ return undefined;
1086
1127
  }
1128
+ const value = parameter.slice(separator + 1).trim();
1129
+ if (value.startsWith('"') && value.endsWith('"')) {
1130
+ return value.slice(1, -1).replace(/\\(.)/g, "$1");
1131
+ }
1132
+ return value;
1087
1133
  }
1088
1134
 
1089
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1135
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1090
1136
  /*
1091
1137
  * Copyright (c) Microsoft Corporation. All rights reserved.
1092
1138
  * Licensed under the MIT License.
@@ -1098,7 +1144,7 @@ function isOpenIdConfigResponse(response) {
1098
1144
  response.hasOwnProperty("jwks_uri"));
1099
1145
  }
1100
1146
 
1101
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1147
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1102
1148
  /*
1103
1149
  * Copyright (c) Microsoft Corporation. All rights reserved.
1104
1150
  * Licensed under the MIT License.
@@ -1178,7 +1224,7 @@ class StringUtils {
1178
1224
  }
1179
1225
  }
1180
1226
 
1181
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1227
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1182
1228
 
1183
1229
  /*
1184
1230
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1365,7 +1411,7 @@ class UrlString {
1365
1411
  }
1366
1412
  }
1367
1413
 
1368
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1414
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1369
1415
 
1370
1416
  /*
1371
1417
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1519,7 +1565,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1519
1565
  return null;
1520
1566
  }
1521
1567
 
1522
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1568
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1523
1569
  /*
1524
1570
  * Copyright (c) Microsoft Corporation. All rights reserved.
1525
1571
  * Licensed under the MIT License.
@@ -1537,7 +1583,7 @@ const AzureCloudInstance = {
1537
1583
  AzureUsGovernment: "https://login.microsoftonline.us",
1538
1584
  };
1539
1585
 
1540
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1586
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1541
1587
  /*
1542
1588
  * Copyright (c) Microsoft Corporation. All rights reserved.
1543
1589
  * Licensed under the MIT License.
@@ -1547,7 +1593,7 @@ function isCloudInstanceDiscoveryResponse(response) {
1547
1593
  response.hasOwnProperty("metadata"));
1548
1594
  }
1549
1595
 
1550
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1596
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1551
1597
  /*
1552
1598
  * Copyright (c) Microsoft Corporation. All rights reserved.
1553
1599
  * Licensed under the MIT License.
@@ -1557,7 +1603,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
1557
1603
  response.hasOwnProperty("error_description"));
1558
1604
  }
1559
1605
 
1560
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1606
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1561
1607
  /*
1562
1608
  * Copyright (c) Microsoft Corporation. All rights reserved.
1563
1609
  * Licensed under the MIT License.
@@ -1628,7 +1674,7 @@ const RegionDiscoveryGetCurrentVersion = "regionDiscoveryGetCurrentVersion";
1628
1674
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1629
1675
  const SetUserData = "setUserData";
1630
1676
 
1631
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1677
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1632
1678
  /*
1633
1679
  * Copyright (c) Microsoft Corporation. All rights reserved.
1634
1680
  * Licensed under the MIT License.
@@ -1722,7 +1768,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
1722
1768
  };
1723
1769
  };
1724
1770
 
1725
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1771
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1726
1772
 
1727
1773
  /*
1728
1774
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1851,7 +1897,7 @@ RegionDiscovery.IMDS_OPTIONS = {
1851
1897
  },
1852
1898
  };
1853
1899
 
1854
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1900
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1855
1901
  /*
1856
1902
  * Copyright (c) Microsoft Corporation. All rights reserved.
1857
1903
  * Licensed under the MIT License.
@@ -1916,7 +1962,7 @@ function wasClockTurnedBack(cachedAt) {
1916
1962
  return cachedAtSec > nowSeconds();
1917
1963
  }
1918
1964
 
1919
- /*! @azure/msal-common v16.16.2 2026-11-12 */
1965
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
1920
1966
 
1921
1967
  /*
1922
1968
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2203,7 +2249,7 @@ function serializeAttributeTokens(attributeTokens) {
2203
2249
  return [...attributeTokens].sort().join(" ");
2204
2250
  }
2205
2251
 
2206
- /*! @azure/msal-common v16.16.2 2026-11-12 */
2252
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
2207
2253
 
2208
2254
  /*
2209
2255
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3174,7 +3220,7 @@ function buildStaticAuthorityOptions(authOptions) {
3174
3220
  };
3175
3221
  }
3176
3222
 
3177
- /*! @azure/msal-common v16.16.2 2026-11-12 */
3223
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
3178
3224
 
3179
3225
  /*
3180
3226
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3208,7 +3254,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
3208
3254
  }
3209
3255
  }
3210
3256
 
3211
- /*! @azure/msal-common v16.16.2 2026-11-12 */
3257
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
3212
3258
 
3213
3259
  /*
3214
3260
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3404,7 +3450,7 @@ class ScopeSet {
3404
3450
  }
3405
3451
  }
3406
3452
 
3407
- /*! @azure/msal-common v16.16.2 2026-11-12 */
3453
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
3408
3454
 
3409
3455
  /*
3410
3456
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3872,12 +3918,13 @@ function addBrokerParameters(parameters, brokerClientId, brokerRedirectUri) {
3872
3918
  * Add EAR (Encrypted Authorize Response) request parameters
3873
3919
  * @param parameters
3874
3920
  * @param jwk
3921
+ * @param jweCrypto - Base64-encoded encryption metadata; defaults to symmetric EAR.
3875
3922
  */
3876
- function addEARParameters(parameters, jwk) {
3923
+ function addEARParameters(parameters, jwk, jweCrypto) {
3877
3924
  parameters.set(EAR_JWK, encodeURIComponent(jwk));
3878
- // ear_jwe_crypto will always have value: {"alg":"dir","enc":"A256GCM"} so we can hardcode this
3925
+ // Default symmetric EAR metadata; asymmetric requests supply their APV.
3879
3926
  const jweCryptoB64Encoded = "eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0";
3880
- parameters.set(EAR_JWE_CRYPTO, jweCryptoB64Encoded);
3927
+ parameters.set(EAR_JWE_CRYPTO, jweCrypto ?? jweCryptoB64Encoded);
3881
3928
  }
3882
3929
  function addResource(parameters, resource) {
3883
3930
  if (resource) {
@@ -3904,7 +3951,7 @@ function addAttributeTokens(parameters, attributeTokens) {
3904
3951
  }
3905
3952
  }
3906
3953
 
3907
- /*! @azure/msal-common v16.16.2 2026-11-12 */
3954
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
3908
3955
 
3909
3956
  /*
3910
3957
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4035,7 +4082,7 @@ function validateUrl(url, logger, correlationId) {
4035
4082
  }
4036
4083
  }
4037
4084
 
4038
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4085
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
4039
4086
 
4040
4087
  /*
4041
4088
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4083,7 +4130,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
4083
4130
  },
4084
4131
  };
4085
4132
 
4086
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4133
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
4087
4134
 
4088
4135
  /*
4089
4136
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4106,7 +4153,7 @@ const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
4106
4153
  },
4107
4154
  };
4108
4155
 
4109
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4156
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
4110
4157
  /*
4111
4158
  * Copyright (c) Microsoft Corporation. All rights reserved.
4112
4159
  * Licensed under the MIT License.
@@ -4395,12 +4442,12 @@ class Logger {
4395
4442
  }
4396
4443
  }
4397
4444
 
4398
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4445
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
4399
4446
  /* eslint-disable header/header */
4400
4447
  const name$1 = "@azure/msal-common";
4401
- const version$1 = "16.16.2";
4448
+ const version$1 = "16.18.0";
4402
4449
 
4403
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4450
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
4404
4451
  /*
4405
4452
  * Copyright (c) Microsoft Corporation. All rights reserved.
4406
4453
  * Licensed under the MIT License.
@@ -4408,7 +4455,7 @@ const version$1 = "16.16.2";
4408
4455
  const cacheQuotaExceeded = "cache_quota_exceeded";
4409
4456
  const cacheErrorUnknown = "cache_error_unknown";
4410
4457
 
4411
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4458
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
4412
4459
 
4413
4460
  /*
4414
4461
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4446,7 +4493,7 @@ function createCacheError(e) {
4446
4493
  }
4447
4494
  }
4448
4495
 
4449
- /*! @azure/msal-common v16.16.2 2026-11-12 */
4496
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
4450
4497
 
4451
4498
  /*
4452
4499
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5674,7 +5721,7 @@ class DefaultStorageClass extends CacheManager {
5674
5721
  }
5675
5722
  }
5676
5723
 
5677
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5724
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
5678
5725
  /*
5679
5726
  * Copyright (c) Microsoft Corporation. All rights reserved.
5680
5727
  * Licensed under the MIT License.
@@ -5736,10 +5783,11 @@ const IntFields = new Set([
5736
5783
  "networkRtt",
5737
5784
  "redirectBridgeTimeoutMs",
5738
5785
  "redirectBridgeMessageVersion",
5786
+ "popupRelayProtocolVersion",
5739
5787
  "fetchRetryCount",
5740
5788
  ]);
5741
5789
 
5742
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5790
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
5743
5791
 
5744
5792
  /*
5745
5793
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5797,7 +5845,7 @@ class StubPerformanceClient {
5797
5845
  }
5798
5846
  }
5799
5847
 
5800
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5848
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
5801
5849
 
5802
5850
  /*
5803
5851
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5851,7 +5899,7 @@ const DEFAULT_TELEMETRY_OPTIONS = {
5851
5899
  * @returns Configuration
5852
5900
  * @internal
5853
5901
  */
5854
- function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, tokenBindingKeyManager: tokenBindingKeyManager, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
5902
+ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, tokenBindingKeyManager: tokenBindingKeyManager, dpopNonceProvider: dpopNonceProvider, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
5855
5903
  const loggerOptions = {
5856
5904
  ...DEFAULT_LOGGER_IMPLEMENTATION,
5857
5905
  ...userLoggerOption,
@@ -5866,6 +5914,7 @@ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions:
5866
5914
  networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
5867
5915
  cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
5868
5916
  tokenBindingKeyManager: resolvedTokenBindingKeyManager,
5917
+ dpopNonceProvider,
5869
5918
  clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
5870
5919
  libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
5871
5920
  telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
@@ -5895,7 +5944,7 @@ function isOidcProtocolMode(config) {
5895
5944
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5896
5945
  }
5897
5946
 
5898
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5947
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
5899
5948
  /*
5900
5949
  * Copyright (c) Microsoft Corporation. All rights reserved.
5901
5950
  * Licensed under the MIT License.
@@ -5922,7 +5971,7 @@ function isOidcProtocolMode(config) {
5922
5971
  }
5923
5972
  }
5924
5973
 
5925
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5974
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
5926
5975
 
5927
5976
  /*
5928
5977
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5943,7 +5992,7 @@ function createJoseHeaderError(code, correlationId) {
5943
5992
  return new JoseHeaderError(code, correlationId);
5944
5993
  }
5945
5994
 
5946
- /*! @azure/msal-common v16.16.2 2026-11-12 */
5995
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
5947
5996
  /*
5948
5997
  * Copyright (c) Microsoft Corporation. All rights reserved.
5949
5998
  * Licensed under the MIT License.
@@ -5968,7 +6017,7 @@ function isPlainObject(value) {
5968
6017
  return Object.getPrototypeOf(value) === proto;
5969
6018
  }
5970
6019
 
5971
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6020
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
5972
6021
  /*
5973
6022
  * Copyright (c) Microsoft Corporation. All rights reserved.
5974
6023
  * Licensed under the MIT License.
@@ -5978,7 +6027,7 @@ const missingAlgError = "missing_alg_error";
5978
6027
  const missingJwkError = "missing_jwk_error";
5979
6028
  const invalidJwkError = "invalid_jwk_error";
5980
6029
 
5981
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6030
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
5982
6031
 
5983
6032
  /*
5984
6033
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6044,7 +6093,7 @@ class JoseHeader {
6044
6093
  }
6045
6094
  }
6046
6095
 
6047
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6096
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6048
6097
 
6049
6098
  /*
6050
6099
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6145,7 +6194,50 @@ class PopTokenGenerator {
6145
6194
  }
6146
6195
  }
6147
6196
 
6148
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6197
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6198
+
6199
+ /*
6200
+ * Copyright (c) Microsoft Corporation. All rights reserved.
6201
+ * Licensed under the MIT License.
6202
+ */
6203
+ /**
6204
+ * Validates that a DPoP nonce is a non-empty string and returns the opaque
6205
+ * value unchanged.
6206
+ * @internal
6207
+ */
6208
+ function validateDpopNonce(nonce, correlationId = "") {
6209
+ if (typeof nonce !== "string" || nonce.length === 0) {
6210
+ throw createClientConfigurationError(invalidDpopNonce, correlationId);
6211
+ }
6212
+ return nonce;
6213
+ }
6214
+ /**
6215
+ * Returns the normalized HTTPS origin used to scope a resource-server nonce.
6216
+ * @internal
6217
+ */
6218
+ function canonicalizeDpopResourceServer(resourceRequestUri, correlationId = "") {
6219
+ if (typeof resourceRequestUri !== "string" ||
6220
+ !/^https:\/\//i.test(resourceRequestUri)) {
6221
+ throw createClientConfigurationError(invalidDpopHtu, correlationId);
6222
+ }
6223
+ let parsedUrl;
6224
+ try {
6225
+ parsedUrl = new URL(resourceRequestUri);
6226
+ }
6227
+ catch {
6228
+ throw createClientConfigurationError(invalidDpopHtu, correlationId);
6229
+ }
6230
+ if (parsedUrl.protocol !== "https:" ||
6231
+ parsedUrl.origin === "null" ||
6232
+ !parsedUrl.hostname ||
6233
+ parsedUrl.username ||
6234
+ parsedUrl.password) {
6235
+ throw createClientConfigurationError(invalidDpopHtu, correlationId);
6236
+ }
6237
+ return parsedUrl.origin;
6238
+ }
6239
+
6240
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6149
6241
 
6150
6242
  /*
6151
6243
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6190,11 +6282,6 @@ function normalizeHtu(url, correlationId) {
6190
6282
  parsedUrl.hash = "";
6191
6283
  return parsedUrl.href;
6192
6284
  }
6193
- function validateDpopNonce(nonce, correlationId) {
6194
- if (nonce !== undefined && nonce.trim().length === 0) {
6195
- throw createClientConfigurationError(invalidDpopNonce, correlationId);
6196
- }
6197
- }
6198
6285
  /**
6199
6286
  * Validates and normalizes the HTTP resource context for a DPoP-bound request.
6200
6287
  * @internal
@@ -6238,7 +6325,6 @@ class DpopProofGenerator {
6238
6325
  * - jti is a fresh CSPRNG-backed unique identifier for every proof.
6239
6326
  */
6240
6327
  buildTokenProofClaims(params, correlationId = "") {
6241
- validateDpopNonce(params.nonce, correlationId);
6242
6328
  const claims = {
6243
6329
  jti: this.cryptoUtils.createNewGuid(),
6244
6330
  htm: "POST",
@@ -6246,7 +6332,7 @@ class DpopProofGenerator {
6246
6332
  iat: nowSeconds(),
6247
6333
  };
6248
6334
  if (params.nonce !== undefined) {
6249
- claims.nonce = params.nonce;
6335
+ claims.nonce = validateDpopNonce(params.nonce, correlationId);
6250
6336
  }
6251
6337
  return claims;
6252
6338
  }
@@ -6264,7 +6350,6 @@ class DpopProofGenerator {
6264
6350
  * - jti is a fresh CSPRNG-backed unique identifier for every proof.
6265
6351
  */
6266
6352
  buildResourceProofClaims(params, correlationId = "") {
6267
- validateDpopNonce(params.nonce, correlationId);
6268
6353
  const resourceContext = normalizeDpopResourceRequestContext(params, correlationId);
6269
6354
  const claims = {
6270
6355
  jti: this.cryptoUtils.createNewGuid(),
@@ -6274,7 +6359,7 @@ class DpopProofGenerator {
6274
6359
  iat: nowSeconds(),
6275
6360
  };
6276
6361
  if (params.nonce !== undefined) {
6277
- claims.nonce = params.nonce;
6362
+ claims.nonce = validateDpopNonce(params.nonce, correlationId);
6278
6363
  }
6279
6364
  return claims;
6280
6365
  }
@@ -6300,7 +6385,7 @@ class DpopProofGenerator {
6300
6385
  }
6301
6386
  }
6302
6387
 
6303
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6388
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6304
6389
  /*
6305
6390
  * Copyright (c) Microsoft Corporation. All rights reserved.
6306
6391
  * Licensed under the MIT License.
@@ -6364,7 +6449,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6364
6449
  uiNotAllowed: uiNotAllowed
6365
6450
  });
6366
6451
 
6367
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6452
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6368
6453
 
6369
6454
  /*
6370
6455
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6431,7 +6516,7 @@ function createInteractionRequiredAuthError(errorCode, correlationId, errorMessa
6431
6516
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
6432
6517
  }
6433
6518
 
6434
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6519
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6435
6520
 
6436
6521
  /*
6437
6522
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6450,7 +6535,7 @@ class ServerError extends AuthError {
6450
6535
  }
6451
6536
  }
6452
6537
 
6453
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6538
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6454
6539
 
6455
6540
  /*
6456
6541
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6521,18 +6606,29 @@ function parseRequestState(base64Decode, state, correlationId) {
6521
6606
  }
6522
6607
  }
6523
6608
 
6524
- /*! @azure/msal-common v16.16.2 2026-11-12 */
6609
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6525
6610
 
6526
6611
  /*
6527
6612
  * Copyright (c) Microsoft Corporation. All rights reserved.
6528
6613
  * Licensed under the MIT License.
6529
6614
  */
6615
+ /*
6616
+ * Retains the signing key for fresh proofs on deduplicated calls without
6617
+ * exposing it on the public AuthenticationResult.
6618
+ */
6619
+ const dpopKeyIdByAuthenticationResult = new WeakMap();
6620
+ function getDpopNonceForRequest(dpopNonceProvider, request) {
6621
+ if (!request.resourceRequestUri || !dpopNonceProvider) {
6622
+ return undefined;
6623
+ }
6624
+ return dpopNonceProvider.getDpopNonce(request.resourceRequestUri, request.correlationId);
6625
+ }
6530
6626
  /**
6531
6627
  * Class that handles response parsing.
6532
6628
  * @internal
6533
6629
  */
6534
6630
  class ResponseHandler {
6535
- constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) {
6631
+ constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, dpopNonceProvider) {
6536
6632
  this.clientId = clientId;
6537
6633
  this.cacheStorage = cacheStorage;
6538
6634
  this.cryptoObj = cryptoObj;
@@ -6541,6 +6637,7 @@ class ResponseHandler {
6541
6637
  this.performanceClient = performanceClient;
6542
6638
  this.serializableCache = serializableCache;
6543
6639
  this.persistencePlugin = persistencePlugin;
6640
+ this.dpopNonceProvider = dpopNonceProvider;
6544
6641
  }
6545
6642
  /**
6546
6643
  * Function which validates server authorization token response.
@@ -6679,6 +6776,7 @@ class ResponseHandler {
6679
6776
  requestState: requestStateObj,
6680
6777
  requestId: serverRequestId,
6681
6778
  tokenBindingKeyManager: this.tokenBindingKeyManager,
6779
+ dpopNonceProvider: this.dpopNonceProvider,
6682
6780
  });
6683
6781
  }
6684
6782
  }
@@ -6698,6 +6796,7 @@ class ResponseHandler {
6698
6796
  serverTokenResponse,
6699
6797
  requestId: serverRequestId,
6700
6798
  tokenBindingKeyManager: this.tokenBindingKeyManager,
6799
+ dpopNonceProvider: this.dpopNonceProvider,
6701
6800
  });
6702
6801
  }
6703
6802
  /**
@@ -6795,7 +6894,7 @@ class ResponseHandler {
6795
6894
  * @param stateString
6796
6895
  */
6797
6896
  static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, performanceClient, options = {}) {
6798
- const { idTokenClaims, requestState, serverTokenResponse, requestId, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, } = options;
6897
+ const { idTokenClaims, requestState, serverTokenResponse, requestId, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, dpopNonceProvider, } = options;
6799
6898
  let accessToken = "";
6800
6899
  let responseScopes = [];
6801
6900
  let expiresOn = null;
@@ -6803,8 +6902,13 @@ class ResponseHandler {
6803
6902
  let refreshOn;
6804
6903
  let familyId = "";
6805
6904
  let dpopProof;
6905
+ const cachedAccessTokenType = cacheRecord.accessToken?.tokenType || "";
6906
+ const isDpopAccessToken = cachedAccessTokenType.toLowerCase() ===
6907
+ AuthenticationScheme$1.DPOP.toLowerCase();
6908
+ const resultTokenType = isDpopAccessToken
6909
+ ? AuthenticationScheme$1.DPOP
6910
+ : cachedAccessTokenType;
6806
6911
  if (cacheRecord.accessToken) {
6807
- const accessTokenType = cacheRecord.accessToken.tokenType?.toLowerCase();
6808
6912
  /*
6809
6913
  * if the request object has `popKid` property, `signPopToken` will be set to false and
6810
6914
  * the token will be returned unsigned
@@ -6822,15 +6926,17 @@ class ResponseHandler {
6822
6926
  else {
6823
6927
  accessToken = cacheRecord.accessToken.secret;
6824
6928
  }
6825
- if (accessTokenType ===
6826
- AuthenticationScheme$1.DPOP.toLowerCase()) {
6929
+ if (isDpopAccessToken) {
6827
6930
  if (!cacheRecord.accessToken.keyId) {
6828
6931
  throw createClientAuthError(keyIdMissing, request.correlationId);
6829
6932
  }
6830
6933
  const dpopProofGenerator = new DpopProofGenerator(cryptoObj, tokenBindingKeyManager);
6934
+ const dpopNonce = getDpopNonceForRequest(dpopNonceProvider, request);
6935
+ performanceClient?.addFields({ dpopNonceAppliedToProof: Boolean(dpopNonce) }, request.correlationId);
6831
6936
  dpopProof = await dpopProofGenerator.generateResourceProof({
6832
6937
  htu: request.resourceRequestUri,
6833
6938
  htm: request.resourceRequestMethod,
6939
+ nonce: dpopNonce,
6834
6940
  accessToken: cacheRecord.accessToken.secret,
6835
6941
  }, cacheRecord.accessToken.keyId, request.correlationId);
6836
6942
  }
@@ -6878,7 +6984,7 @@ class ResponseHandler {
6878
6984
  ? updateAccountTenantProfileData(getAccountInfo(cacheRecord.account), undefined, // tenantProfile optional
6879
6985
  idTokenClaims, cacheRecord.idToken?.secret)
6880
6986
  : null;
6881
- return {
6987
+ const authenticationResult = {
6882
6988
  authority: authority.canonicalAuthority,
6883
6989
  uniqueId: uid,
6884
6990
  tenantId: tid,
@@ -6895,16 +7001,49 @@ class ResponseHandler {
6895
7001
  correlationId: request.correlationId,
6896
7002
  requestId: requestId || "",
6897
7003
  familyId: familyId,
6898
- tokenType: cacheRecord.accessToken?.tokenType?.toLowerCase() ===
6899
- AuthenticationScheme$1.DPOP.toLowerCase()
6900
- ? AuthenticationScheme$1.DPOP
6901
- : cacheRecord.accessToken?.tokenType || "",
7004
+ tokenType: resultTokenType,
6902
7005
  state: requestState ? requestState.userRequestState : "",
6903
7006
  cloudGraphHostName: cacheRecord.account?.cloudGraphHostName || "",
6904
7007
  msGraphHost: cacheRecord.account?.msGraphHost || "",
6905
7008
  code: serverTokenResponse?.spa_code,
6906
7009
  fromPlatformBroker: false,
6907
7010
  };
7011
+ if (isDpopAccessToken && cacheRecord.accessToken?.keyId) {
7012
+ ResponseHandler.setDpopKeyId(authenticationResult, cacheRecord.accessToken.keyId);
7013
+ }
7014
+ return authenticationResult;
7015
+ }
7016
+ /**
7017
+ * Retains an MSAL-owned DPoP key for fresh proofs on deduplicated calls.
7018
+ * @internal
7019
+ */
7020
+ static setDpopKeyId(authenticationResult, keyId) {
7021
+ dpopKeyIdByAuthenticationResult.set(authenticationResult, keyId);
7022
+ }
7023
+ /**
7024
+ * Returns whether MSAL can generate another proof for this result.
7025
+ * @internal
7026
+ */
7027
+ static hasDpopKeyId(authenticationResult) {
7028
+ return dpopKeyIdByAuthenticationResult.has(authenticationResult);
7029
+ }
7030
+ /**
7031
+ * Generates a fresh resource proof for a previously constructed DPoP result.
7032
+ * @internal
7033
+ */
7034
+ static async generateDpopResourceProof(cryptoObj, authenticationResult, request, performanceClient, options = {}) {
7035
+ const keyId = dpopKeyIdByAuthenticationResult.get(authenticationResult);
7036
+ if (!keyId) {
7037
+ throw createClientAuthError(keyIdMissing, request.correlationId);
7038
+ }
7039
+ const dpopNonce = getDpopNonceForRequest(options.dpopNonceProvider, request);
7040
+ performanceClient.addFields({ dpopNonceAppliedToProof: Boolean(dpopNonce) }, request.correlationId);
7041
+ return new DpopProofGenerator(cryptoObj, options.tokenBindingKeyManager ?? DEFAULT_TOKEN_BINDING_KEY_MANAGER).generateResourceProof({
7042
+ htu: request.resourceRequestUri,
7043
+ htm: request.resourceRequestMethod,
7044
+ nonce: dpopNonce,
7045
+ accessToken: authenticationResult.accessToken,
7046
+ }, keyId, request.correlationId);
6908
7047
  }
6909
7048
  }
6910
7049
  /** @internal */
@@ -6949,7 +7088,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
6949
7088
  return baseAccount;
6950
7089
  }
6951
7090
 
6952
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7091
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6953
7092
  /*
6954
7093
  * Copyright (c) Microsoft Corporation. All rights reserved.
6955
7094
  * Licensed under the MIT License.
@@ -6959,7 +7098,7 @@ const CcsCredentialType = {
6959
7098
  UPN: "UPN",
6960
7099
  };
6961
7100
 
6962
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7101
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6963
7102
  /*
6964
7103
  * Copyright (c) Microsoft Corporation. All rights reserved.
6965
7104
  * Licensed under the MIT License.
@@ -6978,7 +7117,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint, fmiP
6978
7117
  }
6979
7118
  }
6980
7119
 
6981
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7120
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
6982
7121
 
6983
7122
  /*
6984
7123
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7002,7 +7141,7 @@ function getRequestThumbprint(clientId, request, homeAccountId) {
7002
7141
  };
7003
7142
  }
7004
7143
 
7005
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7144
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
7006
7145
 
7007
7146
  /*
7008
7147
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7092,7 +7231,7 @@ function getRetryAfterHeader(response) {
7092
7231
  return undefined;
7093
7232
  }
7094
7233
 
7095
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7234
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
7096
7235
 
7097
7236
  /*
7098
7237
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7123,7 +7262,7 @@ function createNetworkError(error, httpStatus, responseHeaders, additionalError)
7123
7262
  return new NetworkError(error, httpStatus, responseHeaders);
7124
7263
  }
7125
7264
 
7126
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7265
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
7127
7266
 
7128
7267
  /*
7129
7268
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7257,7 +7396,7 @@ async function sendPostRequest(thumbprint, tokenEndpoint, options, correlationId
7257
7396
  return response;
7258
7397
  }
7259
7398
 
7260
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7399
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
7261
7400
 
7262
7401
  /*
7263
7402
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7308,7 +7447,7 @@ class AuthorizationCodeClient {
7308
7447
  const response = await invokeAsync(this.executeTokenRequest.bind(this), AuthClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(this.authority, request, this.serverTelemetryManager);
7309
7448
  // Retrieve requestId from response headers
7310
7449
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
7311
- const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager);
7450
+ const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager, this.config.dpopNonceProvider);
7312
7451
  // Validate response. This function throws a server error if an error is returned by the server.
7313
7452
  responseHandler.validateTokenResponse(response.body, request.correlationId);
7314
7453
  return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, authCodePayload, undefined, undefined, undefined, requestId);
@@ -7525,7 +7664,7 @@ class AuthorizationCodeClient {
7525
7664
  }
7526
7665
  }
7527
7666
 
7528
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7667
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
7529
7668
 
7530
7669
  /*
7531
7670
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7755,7 +7894,7 @@ function extractLoginHint(account) {
7755
7894
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7756
7895
  }
7757
7896
 
7758
- /*! @azure/msal-common v16.16.2 2026-11-12 */
7897
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
7759
7898
 
7760
7899
  /*
7761
7900
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8304,7 +8443,7 @@ class PerformanceClient {
8304
8443
  }
8305
8444
  }
8306
8445
 
8307
- /*! @azure/msal-common v16.16.2 2026-11-12 */
8446
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
8308
8447
 
8309
8448
  /*
8310
8449
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8339,7 +8478,7 @@ class RefreshTokenClient {
8339
8478
  const response = await invokeAsync(this.executeTokenRequest.bind(this), RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);
8340
8479
  // Retrieve requestId from response headers
8341
8480
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
8342
- const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager);
8481
+ const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager, this.config.dpopNonceProvider);
8343
8482
  responseHandler.validateTokenResponse(response.body, request.correlationId);
8344
8483
  return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, undefined, undefined, true, request.forceCache, requestId);
8345
8484
  }
@@ -8539,7 +8678,7 @@ class RefreshTokenClient {
8539
8678
  }
8540
8679
  }
8541
8680
 
8542
- /*! @azure/msal-common v16.16.2 2026-11-12 */
8681
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
8543
8682
 
8544
8683
  /*
8545
8684
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8832,7 +8971,7 @@ class StubServerTelemetryManager extends ServerTelemetryManager {
8832
8971
  clearNativeBrokerErrorCode() { }
8833
8972
  }
8834
8973
 
8835
- /*! @azure/msal-common v16.16.2 2026-11-12 */
8974
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
8836
8975
 
8837
8976
  /*
8838
8977
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8955,11 +9094,12 @@ class SilentFlowClient {
8955
9094
  return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, this.performanceClient, {
8956
9095
  idTokenClaims,
8957
9096
  tokenBindingKeyManager: this.config.tokenBindingKeyManager,
9097
+ dpopNonceProvider: this.config.dpopNonceProvider,
8958
9098
  });
8959
9099
  }
8960
9100
  }
8961
9101
 
8962
- /*! @azure/msal-common v16.16.2 2026-11-12 */
9102
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
8963
9103
 
8964
9104
  /*
8965
9105
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8975,7 +9115,7 @@ const StubbedNetworkModule = {
8975
9115
  },
8976
9116
  };
8977
9117
 
8978
- /*! @azure/msal-common v16.16.2 2026-11-12 */
9118
+ /*! @azure/msal-common v16.18.0 2026-12-02 */
8979
9119
 
8980
9120
  /*
8981
9121
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9027,6 +9167,11 @@ const AcquireTokenByRefreshToken = "acquireTokenByRefreshToken";
9027
9167
  * Internal API for acquireTokenSilent.
9028
9168
  */
9029
9169
  const AcquireTokenSilentAsync = "acquireTokenSilentAsync";
9170
+ /**
9171
+ * loadDpopNonce API in StandardController (msal-browser).
9172
+ * Stores a resource-server DPoP nonce in controller-owned memory.
9173
+ */
9174
+ const StandardControllerLoadDpopNonce = "standardControllerLoadDpopNonce";
9030
9175
  /**
9031
9176
  * provisionTokenBindingKey API in TokenBindingKeyManager class (msal-browser).
9032
9177
  * Used to provision token-binding key material and return a key identifier.
@@ -9142,6 +9287,13 @@ const UrlEncodeArr = "urlEncodeArr";
9142
9287
  const Encrypt = "encrypt";
9143
9288
  const Decrypt = "decrypt";
9144
9289
  const GenerateEarKey = "generateEarKey";
9290
+ const GenerateAsymmetricEarKey = "generateAsymmetricEarKey";
9291
+ const ImportAsymmetricEarKey = "importAsymmetricEarKey";
9292
+ const ImportAsymmetricEarPublicKey = "importAsymmetricEarPublicKey";
9293
+ const DeriveAsymmetricEarSecret = "deriveAsymmetricEarSecret";
9294
+ const AsymmetricEarConcatKdf = "asymmetricEarConcatKdf";
9295
+ const ImportAsymmetricEarContentKey = "importAsymmetricEarContentKey";
9296
+ const DecryptAsymmetricEarResponse = "decryptAsymmetricEarResponse";
9145
9297
  const DecryptEarResponse = "decryptEarResponse";
9146
9298
  const LoadAccount = "loadAccount";
9147
9299
  const LoadIdToken = "loadIdToken";
@@ -9212,11 +9364,13 @@ const tokenBindingKeyJwkThumbprintMismatch = "token_binding_key_jwk_thumbprint_m
9212
9364
  const failedToBuildHeaders = "failed_to_build_headers";
9213
9365
  const failedToParseHeaders = "failed_to_parse_headers";
9214
9366
  const failedToDecryptEarResponse = "failed_to_decrypt_ear_response";
9367
+ const asymmetricEarKeyError = "asymmetric_ear_key_error";
9215
9368
  const timedOut = "timed_out";
9216
9369
  const emptyResponse = "empty_response";
9217
9370
 
9218
9371
  var BrowserAuthErrorCodes = /*#__PURE__*/Object.freeze({
9219
9372
  __proto__: null,
9373
+ asymmetricEarKeyError: asymmetricEarKeyError,
9220
9374
  authCodeOrNativeAccountIdRequired: authCodeOrNativeAccountIdRequired,
9221
9375
  authCodeRequired: authCodeRequired,
9222
9376
  authRequestNotSetError: authRequestNotSetError,
@@ -9612,6 +9766,10 @@ const HKDF = "HKDF";
9612
9766
  const S256_HASH_ALG = "SHA-256";
9613
9767
  // JWK values used by browser-internal WebCrypto helpers.
9614
9768
  const JSON_WEB_KEY_CURVE_P256 = "P-256";
9769
+ const ECDH_P384_ALGORITHM = {
9770
+ name: "ECDH",
9771
+ namedCurve: "P-384",
9772
+ };
9615
9773
  const JSON_WEB_KEY_TYPE_EC = "EC";
9616
9774
  const JSON_WEB_KEY_TYPE_RSA = "RSA";
9617
9775
  const MISSING_JWK_KTY_SUBERROR = "missing_jwk_kty";
@@ -9749,6 +9907,16 @@ async function generateKeyPair(extractable, usages, algorithm) {
9749
9907
  async function exportJwk(key) {
9750
9908
  return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
9751
9909
  }
9910
+ /**
9911
+ * Imports key as Json Web Key (JWK), can set extractable and usages.
9912
+ * @param key
9913
+ * @param extractable
9914
+ * @param usages
9915
+ * @param algorithm
9916
+ */
9917
+ async function importJwk(key, extractable, usages, algorithm) {
9918
+ return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, algorithm, extractable, usages);
9919
+ }
9752
9920
  /**
9753
9921
  * Signs given data with given key.
9754
9922
  * @param key
@@ -9771,6 +9939,172 @@ async function generateEarKey() {
9771
9939
  };
9772
9940
  return base64Encode(JSON.stringify(jwk));
9773
9941
  }
9942
+ /**
9943
+ * Generates P-384 ECDH keys for request-scoped private sessionStorage and public wire metadata.
9944
+ * @internal
9945
+ */
9946
+ async function generateAsymmetricEarKey() {
9947
+ const keyPair = await generateKeyPair(true, ["deriveBits"], ECDH_P384_ALGORITHM);
9948
+ const publicJwk = await exportJwk(keyPair.publicKey);
9949
+ const privateJwk = await exportJwk(keyPair.privateKey);
9950
+ return {
9951
+ privateJwk,
9952
+ publicJwk,
9953
+ };
9954
+ }
9955
+ /**
9956
+ * Restores a private EAR key as non-exportable. The serialized sessionStorage copy remains exportable.
9957
+ * @internal
9958
+ */
9959
+ async function importAsymmetricEarKey(privateJwk, correlationId = "") {
9960
+ if (privateJwk?.kty !== "EC" ||
9961
+ privateJwk.crv !== "P-384" ||
9962
+ !privateJwk.d) {
9963
+ throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "invalid_private_key" /* AsymmetricEarSubErrors.InvalidPrivateKey */);
9964
+ }
9965
+ try {
9966
+ return await importJwk(privateJwk, false, ["deriveBits"], ECDH_P384_ALGORITHM);
9967
+ }
9968
+ catch {
9969
+ throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "private_key_import_failed" /* AsymmetricEarSubErrors.PrivateKeyImportFailed */);
9970
+ }
9971
+ }
9972
+ /**
9973
+ * Encodes the EAR client party information with a fresh 192-bit nonce.
9974
+ * @internal
9975
+ */
9976
+ function generateAsymmetricEarApv(publicJwk) {
9977
+ const point = new Uint8Array(concatEarBytes(new Uint8Array([4]), decodeEarBase64Url(publicJwk.x || ""), decodeEarBase64Url(publicJwk.y || "")));
9978
+ if (point.length !== 97) {
9979
+ throw createBrowserAuthError(asymmetricEarKeyError, "", "invalid_public_key_coordinates" /* AsymmetricEarSubErrors.InvalidPublicKeyCoordinates */);
9980
+ }
9981
+ const nonce = new Uint8Array(24);
9982
+ window.crypto.getRandomValues(nonce);
9983
+ return urlEncodeArr(new Uint8Array(concatEarBytes(lengthPrefixEarBytes(new TextEncoder().encode("EarClient")), lengthPrefixEarBytes(point), lengthPrefixEarBytes(nonce))));
9984
+ }
9985
+ /**
9986
+ * Authenticates and decrypts direct ECDH-ES/P-384/A256GCM using JOSE Concat KDF.
9987
+ * Party information is used byte-for-byte; the service need not echo the request APV.
9988
+ * @internal
9989
+ */
9990
+ async function decryptAsymmetricEarResponse(privateJwk, apv, earJwe, requestApv = apv, telemetry) {
9991
+ const correlationId = telemetry?.correlationId || "";
9992
+ const measure = (eventName, operation) => telemetry
9993
+ ? invokeAsync(operation, eventName, telemetry.logger, telemetry.performanceClient, correlationId)()
9994
+ : operation();
9995
+ if (apv !== requestApv) {
9996
+ throw createBrowserAuthError(asymmetricEarKeyError, correlationId, "request_apv_mismatch" /* AsymmetricEarSubErrors.RequestApvMismatch */);
9997
+ }
9998
+ const parts = earJwe.split(".");
9999
+ if (parts.length !== 5 || parts[1] !== "") {
10000
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
10001
+ }
10002
+ let header;
10003
+ try {
10004
+ header = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(decodeEarBase64Url(parts[0], correlationId)));
10005
+ }
10006
+ catch {
10007
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
10008
+ }
10009
+ if (!header ||
10010
+ header.alg !== "ECDH-ES" ||
10011
+ header.enc !== "A256GCM" ||
10012
+ header.crit !== undefined ||
10013
+ header.zip !== undefined ||
10014
+ header.epk?.kty !== "EC" ||
10015
+ header.epk.crv !== "P-384" ||
10016
+ header.epk.d !== undefined ||
10017
+ (header.apv !== undefined && header.apv !== apv)) {
10018
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
10019
+ }
10020
+ const x = decodeEarBase64Url(header.epk.x, correlationId);
10021
+ const y = decodeEarBase64Url(header.epk.y, correlationId);
10022
+ const apuBytes = decodeEarBase64Url(header.apu, correlationId);
10023
+ const apvBytes = decodeEarBase64Url(apv, correlationId);
10024
+ const iv = decodeEarBase64Url(parts[2], correlationId);
10025
+ const ciphertext = decodeEarBase64Url(parts[3], correlationId);
10026
+ const tag = decodeEarBase64Url(parts[4], correlationId);
10027
+ if (x.length !== 48 ||
10028
+ y.length !== 48 ||
10029
+ iv.length !== 12 ||
10030
+ tag.length !== 16) {
10031
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
10032
+ }
10033
+ let key;
10034
+ try {
10035
+ const privateKey = await measure(ImportAsymmetricEarKey, () => importAsymmetricEarKey(privateJwk, correlationId));
10036
+ const publicKey = await measure(ImportAsymmetricEarPublicKey, () => importJwk({
10037
+ kty: "EC",
10038
+ crv: "P-384",
10039
+ x: header.epk.x,
10040
+ y: header.epk.y,
10041
+ }, false, [], ECDH_P384_ALGORITHM));
10042
+ const secret = new Uint8Array(await measure(DeriveAsymmetricEarSecret, () => window.crypto.subtle.deriveBits({ name: "ECDH", public: publicKey }, privateKey, 384)));
10043
+ // RFC 7518 section 4.6.2: one SHA-256 round produces the 256-bit content key.
10044
+ const input = new Uint8Array(concatEarBytes(earUint32(1), secret, lengthPrefixEarBytes(new TextEncoder().encode("A256GCM")), lengthPrefixEarBytes(apuBytes), lengthPrefixEarBytes(apvBytes), earUint32(256)));
10045
+ let derivedKey;
10046
+ try {
10047
+ derivedKey = await measure(AsymmetricEarConcatKdf, () => window.crypto.subtle.digest(S256_HASH_ALG, input));
10048
+ }
10049
+ finally {
10050
+ secret.fill(0);
10051
+ input.fill(0);
10052
+ }
10053
+ try {
10054
+ key = await measure(ImportAsymmetricEarContentKey, () => window.crypto.subtle.importKey(RAW, derivedKey, AES_GCM, false, [DECRYPT]));
10055
+ }
10056
+ finally {
10057
+ new Uint8Array(derivedKey).fill(0);
10058
+ }
10059
+ }
10060
+ catch (error) {
10061
+ if (error instanceof AuthError) {
10062
+ throw error;
10063
+ }
10064
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "content_encryption_key_derivation_failed" /* AsymmetricEarSubErrors.ContentEncryptionKeyDerivationFailed */);
10065
+ }
10066
+ try {
10067
+ const plaintext = await measure(DecryptAsymmetricEarResponse, () => window.crypto.subtle.decrypt({
10068
+ name: AES_GCM,
10069
+ iv,
10070
+ tagLength: 128,
10071
+ additionalData: new TextEncoder().encode(parts[0]),
10072
+ }, key, concatEarBytes(ciphertext, tag)));
10073
+ return new TextDecoder("utf-8", { fatal: true }).decode(plaintext);
10074
+ }
10075
+ catch {
10076
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "jwe_decryption_failed" /* AsymmetricEarSubErrors.JweDecryptionFailed */);
10077
+ }
10078
+ }
10079
+ /** Decodes canonical, unpadded JOSE base64url for asymmetric EAR only. */
10080
+ function decodeEarBase64Url(value, correlationId = "") {
10081
+ // Match the unpadded base64url alphabet only: letters, digits, '-' and '_'.
10082
+ if (typeof value !== "string" || !/^[A-Za-z0-9_-]+$/.test(value)) {
10083
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
10084
+ }
10085
+ const bytes = new Uint8Array(base64DecToArr(value));
10086
+ if (urlEncodeArr(bytes) !== value) {
10087
+ throw createBrowserAuthError(failedToDecryptEarResponse, correlationId, "invalid_jwe_format_or_header" /* AsymmetricEarSubErrors.InvalidJweFormatOrHeader */);
10088
+ }
10089
+ return bytes;
10090
+ }
10091
+ function earUint32(value) {
10092
+ const bytes = new Uint8Array(4);
10093
+ new DataView(bytes.buffer).setUint32(0, value);
10094
+ return bytes;
10095
+ }
10096
+ function concatEarBytes(...parts) {
10097
+ const bytes = new Uint8Array(parts.reduce((length, part) => length + part.length, 0));
10098
+ let offset = 0;
10099
+ for (const part of parts) {
10100
+ bytes.set(part, offset);
10101
+ offset += part.length;
10102
+ }
10103
+ return bytes.buffer;
10104
+ }
10105
+ function lengthPrefixEarBytes(bytes) {
10106
+ return new Uint8Array(concatEarBytes(earUint32(bytes.length), bytes));
10107
+ }
9774
10108
  /**
9775
10109
  * Parses earJwk for encryption key and returns CryptoKey object
9776
10110
  * @param earJwk
@@ -9804,7 +10138,9 @@ async function decryptEarResponse(earJwk, earJwe) {
9804
10138
  const iv = base64DecToArr(earJweParts[2]);
9805
10139
  const ciphertext = base64DecToArr(earJweParts[3]);
9806
10140
  const tag = base64DecToArr(earJweParts[4]);
9807
- const tagLengthBits = tag.byteLength * 8;
10141
+ if (tag.byteLength !== 16) {
10142
+ throw new Error("Invalid AES-GCM authentication tag length");
10143
+ }
9808
10144
  // Concat ciphertext and tag
9809
10145
  const encryptedData = new Uint8Array(ciphertext.length + tag.length);
9810
10146
  encryptedData.set(ciphertext);
@@ -9812,7 +10148,7 @@ async function decryptEarResponse(earJwk, earJwe) {
9812
10148
  const decryptedData = await window.crypto.subtle.decrypt({
9813
10149
  name: AES_GCM,
9814
10150
  iv: iv,
9815
- tagLength: tagLengthBits,
10151
+ tagLength: 128,
9816
10152
  additionalData: header,
9817
10153
  }, key, encryptedData);
9818
10154
  return new TextDecoder().decode(decryptedData);
@@ -11710,7 +12046,7 @@ const EventType = {
11710
12046
 
11711
12047
  /* eslint-disable header/header */
11712
12048
  const name = "@azure/msal-browser";
11713
- const version = "5.29.1";
12049
+ const version = "5.31.0";
11714
12050
 
11715
12051
  /*
11716
12052
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -11732,6 +12068,7 @@ function removeElementFromArray(array, element) {
11732
12068
  * Copyright (c) Microsoft Corporation. All rights reserved.
11733
12069
  * Licensed under the MIT License.
11734
12070
  */
12071
+ const MAX_RESOURCE_SERVER_NONCES = 50;
11735
12072
  /**
11736
12073
  * Reason an old-schema cache entry was removed during migration.
11737
12074
  */
@@ -11747,6 +12084,7 @@ const MigrationRemovalReason = {
11747
12084
  class BrowserCacheManager extends CacheManager {
11748
12085
  constructor(clientId, cacheConfig, cryptoImpl, logger, performanceClient, eventHandler, staticAuthorityOptions, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) {
11749
12086
  super(clientId, cryptoImpl, logger, performanceClient, staticAuthorityOptions, tokenBindingKeyManager);
12087
+ this.dpopNonces = new Map();
11750
12088
  this.cacheConfig = cacheConfig;
11751
12089
  this.logger = logger;
11752
12090
  this.internalStorage = new MemoryStorage();
@@ -12767,6 +13105,40 @@ class BrowserCacheManager extends CacheManager {
12767
13105
  const version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) || "";
12768
13106
  return [sku, version];
12769
13107
  }
13108
+ /**
13109
+ * Stores a validated resource-server DPoP nonce in PCA-local memory.
13110
+ * @internal
13111
+ */
13112
+ setDpopNonce(resourceRequestUri, dpopNonce, correlationId = "") {
13113
+ const resourceServer = canonicalizeDpopResourceServer(resourceRequestUri, correlationId);
13114
+ const validatedNonce = validateDpopNonce(dpopNonce, correlationId);
13115
+ // Reinsert replacements so eviction remains oldest-write ordered.
13116
+ this.dpopNonces.delete(resourceServer);
13117
+ this.dpopNonces.set(resourceServer, validatedNonce);
13118
+ if (this.dpopNonces.size > MAX_RESOURCE_SERVER_NONCES) {
13119
+ const oldestResourceServer = this.dpopNonces.keys().next().value;
13120
+ if (oldestResourceServer) {
13121
+ this.dpopNonces.delete(oldestResourceServer);
13122
+ }
13123
+ this.performanceClient.incrementFields({ "ext.dpopNonceCacheEvictionCount": 1 }, correlationId);
13124
+ }
13125
+ }
13126
+ /**
13127
+ * Reads the current resource-server DPoP nonce from PCA-local memory.
13128
+ * This optional structural capability is consumed by msal-common without
13129
+ * adding methods to the CacheManager abstraction.
13130
+ * @internal
13131
+ */
13132
+ getDpopNonce(resourceRequestUri, correlationId = "") {
13133
+ return this.dpopNonces.get(canonicalizeDpopResourceServer(resourceRequestUri, correlationId));
13134
+ }
13135
+ /**
13136
+ * Clears all PCA-local DPoP nonce state.
13137
+ * @internal
13138
+ */
13139
+ clearDpopNonces() {
13140
+ this.dpopNonces.clear();
13141
+ }
12770
13142
  /**
12771
13143
  *
12772
13144
  * @param key
@@ -12911,6 +13283,7 @@ class BrowserCacheManager extends CacheManager {
12911
13283
  }
12912
13284
  });
12913
13285
  this.internalStorage.clear();
13286
+ this.dpopNonces.clear();
12914
13287
  }
12915
13288
  /**
12916
13289
  * Prepend msal.<client-id> to each key
@@ -13017,8 +13390,7 @@ class BrowserCacheManager extends CacheManager {
13017
13390
  }
13018
13391
  }
13019
13392
  catch (e) {
13020
- this.logger.errorPii(`0ewsey ${encodedTokenRequest}`, correlationId);
13021
- this.logger.error(`0tvdic ${e}`, correlationId);
13393
+ this.logger.error("023ixj", correlationId);
13022
13394
  throw createBrowserAuthError(unableToParseTokenRequestCacheError, "");
13023
13395
  }
13024
13396
  return [parsedRequest, verifier];
@@ -13442,7 +13814,7 @@ class EventHandler {
13442
13814
  * Licensed under the MIT License.
13443
13815
  */
13444
13816
  class BaseInteractionClient {
13445
- constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager) {
13817
+ constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager, dpopNonceProvider) {
13446
13818
  this.config = config;
13447
13819
  this.browserStorage = storageImpl;
13448
13820
  this.browserCrypto = browserCrypto;
@@ -13456,6 +13828,7 @@ class BaseInteractionClient {
13456
13828
  this.tokenBindingKeyManager =
13457
13829
  tokenBindingKeyManager ||
13458
13830
  new TokenBindingKeyManager(this.logger, this.performanceClient);
13831
+ this.dpopNonceProvider = dpopNonceProvider ?? storageImpl;
13459
13832
  }
13460
13833
  }
13461
13834
  /**
@@ -13554,6 +13927,7 @@ async function getDiscoveredAuthority(config, correlationId, performanceClient,
13554
13927
  * @returns A promise that resolves when the cache has been cleared.
13555
13928
  */
13556
13929
  async function clearCacheOnLogout(browserStorage, browserCrypto, logger, correlationId, account) {
13930
+ browserStorage.clearDpopNonces();
13557
13931
  if (account) {
13558
13932
  // Clear given account.
13559
13933
  try {
@@ -13701,6 +14075,7 @@ async function initializeBaseRequest(request, config, performanceClient, logger,
13701
14075
  }
13702
14076
  logger.verbose(`1ecmns ${validatedRequest.authenticationScheme}`, correlationId);
13703
14077
  }
14078
+ performanceClient.addFields({ authenticationScheme: validatedRequest.authenticationScheme }, correlationId);
13704
14079
  return validatedRequest;
13705
14080
  }
13706
14081
  async function initializeSilentRequest(request, account, config, performanceClient, logger) {
@@ -13975,6 +14350,7 @@ class StandardInteractionClient extends BaseInteractionClient {
13975
14350
  },
13976
14351
  cryptoInterface: this.browserCrypto,
13977
14352
  tokenBindingKeyManager: this.tokenBindingKeyManager,
14353
+ dpopNonceProvider: this.dpopNonceProvider,
13978
14354
  networkInterface: this.networkClient,
13979
14355
  storageInterface: this.browserStorage,
13980
14356
  serverTelemetryManager: serverTelemetryManager,
@@ -14092,30 +14468,42 @@ function shouldUseEar(protocolMode, logger, performanceClient, correlationId, us
14092
14468
  * page (see `runPopupRelay`) back to the embedded frame that opened it. See
14093
14469
  * {@link BrowserAuthOptions.popupRelayUri}.
14094
14470
  *
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.
14471
+ * Shared by the relay-page entry and client helpers without importing either
14472
+ * implementation into the other bundle.
14098
14473
  *
14099
14474
  * @internal
14100
14475
  */
14101
- const POPUP_RELAY_RESPONSE_TYPE = "msal:popup-relay-response:v1";
14476
+ const POPUP_RELAY_RESPONSE_TYPE = "msal:popup-relay-response:v1";
14477
+ /** @internal Response bound to an authenticated v2 relay document. */
14478
+ const POPUP_RELAY_V2_RESPONSE_TYPE = "msal:popup-relay-response:v2";
14479
+ /** @internal Ready signal for the authenticated popup-relay request handoff. */
14480
+ const POPUP_RELAY_READY_TYPE = "msal:popup-relay-ready:v2";
14481
+ /** @internal Request delivered only to the same-origin relay window. */
14482
+ const POPUP_RELAY_REQUEST_TYPE = "msal:popup-relay-request:v2";
14483
+ /** @internal Resolve the compatibility default without downgrading invalid versions. */
14484
+ function getPopupRelayProtocolVersion(version, correlationId = "") {
14485
+ if (version === undefined) {
14486
+ return 1;
14487
+ }
14488
+ if (version !== 1 && version !== 2) {
14489
+ throw createBrowserAuthError(popupRelayUnsupportedFlow, correlationId, "popup_relay_invalid_protocol");
14490
+ }
14491
+ return version;
14492
+ }
14102
14493
 
14103
14494
  /*
14104
14495
  * Copyright (c) Microsoft Corporation. All rights reserved.
14105
14496
  * Licensed under the MIT License.
14106
14497
  */
14107
14498
  /**
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`.
14499
+ * Builds the same-origin relay URL. V1 preserves the fragment descriptor;
14500
+ * explicitly selected v2 carries only the id and retains the navigation for
14501
+ * the authenticated handoff.
14114
14502
  *
14115
14503
  * @internal
14116
14504
  */
14117
- function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
14118
- const req = { id, ...action };
14505
+ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId, protocolVersion) {
14506
+ const version = getPopupRelayProtocolVersion(protocolVersion, correlationId);
14119
14507
  const target = new URL(popupRelayUri, window.location.origin);
14120
14508
  /*
14121
14509
  * The relay page must be same-origin as the embedded frame: the response is
@@ -14128,7 +14516,12 @@ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
14128
14516
  throw createBrowserAuthError(popupRelayUnsupportedFlow, correlationId, "popup_relay_cross_origin");
14129
14517
  }
14130
14518
  const hashParams = new URLSearchParams();
14131
- hashParams.set("req", JSON.stringify(req));
14519
+ if (version === 1) {
14520
+ hashParams.set("req", JSON.stringify({ id, ...action }));
14521
+ }
14522
+ else {
14523
+ hashParams.set("id", id);
14524
+ }
14132
14525
  target.hash = hashParams.toString();
14133
14526
  return target.toString();
14134
14527
  }
@@ -14139,21 +14532,30 @@ function buildPopupRelayUrl(popupRelayUri, id, action, correlationId) {
14139
14532
  * partitioning blocks the BroadcastChannel the redirect bridge uses from
14140
14533
  * reaching the embedded frame.
14141
14534
  *
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.
14535
+ * In v2, the retained navigation is sent once, after a ready signal from the popup
14536
+ * window we opened on our own origin with the matching library-state id.
14537
+ * Successful responses must also carry that handoff's relay-document nonce.
14538
+ * Setup failures can reject the request before the handoff completes.
14145
14539
  *
14146
14540
  * @internal
14147
14541
  */
14148
- async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow, performanceClient) {
14542
+ async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow, performanceClient, action, protocolVersion) {
14543
+ const version = getPopupRelayProtocolVersion(protocolVersion, request.correlationId);
14544
+ if (version === 2 && !action) {
14545
+ throw createBrowserAuthError(popupRelayUnsupportedFlow, request.correlationId, "popup_relay_bad_request");
14546
+ }
14149
14547
  return new Promise((resolve, reject) => {
14150
14548
  const correlationId = request.correlationId;
14151
14549
  logger.verbose("1d05g9", correlationId);
14152
- performanceClient.addFields({ redirectBridgeTimeoutMs: timeoutMs }, correlationId);
14550
+ performanceClient.addFields({
14551
+ redirectBridgeTimeoutMs: timeoutMs,
14552
+ popupRelayProtocolVersion: version,
14553
+ }, correlationId);
14153
14554
  const { libraryState } = parseRequestState(base64Decode, request.state || "", correlationId);
14154
14555
  const expectedId = libraryState.id;
14155
14556
  const expectedOrigin = window.location.origin;
14156
14557
  let settled = false;
14558
+ let handoffNonce = "";
14157
14559
  const cleanup = () => {
14158
14560
  window.removeEventListener("message", onMessage);
14159
14561
  clearTimeout(timeoutId);
@@ -14165,20 +14567,52 @@ async function waitForPopupRelayResponse(timeoutMs, logger, request, popupWindow
14165
14567
  return;
14166
14568
  }
14167
14569
  const data = event.data;
14168
- if (!data ||
14169
- data.type !== POPUP_RELAY_RESPONSE_TYPE ||
14170
- data.id !== expectedId) {
14570
+ if (!data || data.id !== expectedId) {
14171
14571
  return;
14172
14572
  }
14173
14573
  if (settled) {
14174
14574
  return;
14175
14575
  }
14576
+ if (version === 2 && data.type === POPUP_RELAY_READY_TYPE) {
14577
+ if (handoffNonce ||
14578
+ typeof data.nonce !== "string" ||
14579
+ !data.nonce) {
14580
+ return;
14581
+ }
14582
+ handoffNonce = data.nonce;
14583
+ try {
14584
+ popupWindow.postMessage({
14585
+ type: POPUP_RELAY_REQUEST_TYPE,
14586
+ id: expectedId,
14587
+ nonce: handoffNonce,
14588
+ request: { id: expectedId, ...action },
14589
+ }, expectedOrigin);
14590
+ performanceClient.addFields({ "ext.popupRelayRequestSent": true }, correlationId);
14591
+ }
14592
+ catch {
14593
+ settled = true;
14594
+ cleanup();
14595
+ logger.error("0sx3jz", correlationId);
14596
+ reject(createBrowserAuthError(popupWindowError, correlationId, "popup_relay_handoff_failed"));
14597
+ }
14598
+ return;
14599
+ }
14600
+ const hasError = typeof data.error === "string" && data.error.length > 0;
14601
+ const responseType = version === 1
14602
+ ? POPUP_RELAY_RESPONSE_TYPE
14603
+ : POPUP_RELAY_V2_RESPONSE_TYPE;
14604
+ if (data.type !== responseType ||
14605
+ (version === 2 &&
14606
+ ((!handoffNonce && !hasError) ||
14607
+ (handoffNonce && data.nonce !== handoffNonce)))) {
14608
+ return;
14609
+ }
14176
14610
  settled = true;
14177
14611
  cleanup();
14178
- if (data.error) {
14179
- reject(createBrowserAuthError(data.error, correlationId));
14612
+ if (hasError) {
14613
+ reject(createBrowserAuthError(data.error, correlationId, data.subError));
14180
14614
  }
14181
- else if (data.payload) {
14615
+ else if (typeof data.payload === "string" && data.payload) {
14182
14616
  resolve(data.payload);
14183
14617
  }
14184
14618
  else {
@@ -14557,7 +14991,7 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14557
14991
  this.accountId = accountId;
14558
14992
  this.platformAuthProvider = provider;
14559
14993
  this.nativeStorageManager = nativeStorageImpl;
14560
- this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, this.tokenBindingKeyManager);
14994
+ this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, this.tokenBindingKeyManager, browserStorage);
14561
14995
  const extensionName = this.platformAuthProvider.getExtensionName();
14562
14996
  this.skus = ServerTelemetryManager.makeExtraSkuString({
14563
14997
  libraryName: BrowserConstants.MSAL_SKU,
@@ -14942,6 +15376,11 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
14942
15376
  const shouldRemoveGeneratedDpopKey = isL3DpopResponse ||
14943
15377
  (this.isDpopBrokerRequest(request) &&
14944
15378
  storeInCache?.accessToken === false);
15379
+ if (dpopBrokerOutcome === "L1" &&
15380
+ !shouldRemoveGeneratedDpopKey &&
15381
+ request.keyId) {
15382
+ ResponseHandler.setDpopKeyId(result, request.keyId);
15383
+ }
14945
15384
  if (shouldRemoveGeneratedDpopKey) {
14946
15385
  await this.resetGeneratedDpopRequestKey(request);
14947
15386
  }
@@ -15210,7 +15649,12 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
15210
15649
  const configClaims = request.skipBrokerClaims && !!request.embeddedClientId
15211
15650
  ? undefined
15212
15651
  : this.config.auth.clientCapabilities;
15213
- const { scopes, claims, dpopNonce } = request;
15652
+ const { scopes, claims } = request;
15653
+ const dpopNonce = request.authenticationScheme ===
15654
+ AuthenticationScheme$1.DPOP &&
15655
+ request.resourceRequestUri
15656
+ ? this.browserStorage.getDpopNonce(request.resourceRequestUri, this.correlationId)
15657
+ : undefined;
15214
15658
  const scopeSet = new ScopeSet([...(scopes || []), ...OIDC_DEFAULT_SCOPES$1], this.correlationId);
15215
15659
  const mergedClaims = buildMergedClaims$1(claims, configClaims?.length ? configClaims : undefined);
15216
15660
  const hasAttributeTokens = !!request.attributeTokens?.length;
@@ -15520,11 +15964,14 @@ class PlatformAuthInteractionClient extends BaseInteractionClient {
15520
15964
  return brokerProof;
15521
15965
  }
15522
15966
  const dpopProofGenerator = new DpopProofGenerator(this.browserCrypto, this.tokenBindingKeyManager);
15967
+ const currentNonce = request.resourceRequestUri
15968
+ ? this.browserStorage.getDpopNonce(request.resourceRequestUri, this.correlationId)
15969
+ : undefined;
15523
15970
  return dpopProofGenerator.generateResourceProof({
15524
15971
  htu: request.resourceRequestUri,
15525
15972
  htm: request.resourceRequestMethod,
15526
15973
  accessToken: response.access_token,
15527
- nonce: request.extraParametersNoCache?.pop_nonce,
15974
+ nonce: currentNonce ?? request.extraParametersNoCache?.pop_nonce,
15528
15975
  }, request.keyId, this.correlationId);
15529
15976
  }
15530
15977
  /**
@@ -15847,6 +16294,36 @@ function getAuthorizeFormAction(authority, request, parameters) {
15847
16294
  addCorrelationId(queryParams, request.correlationId);
15848
16295
  return getAuthorizeUrl(authority, queryParams);
15849
16296
  }
16297
+ /**
16298
+ * Prepares the selected EAR construction.
16299
+ * @internal
16300
+ */
16301
+ async function initializeEarRequest(config, request, logger, performanceClient) {
16302
+ if (!config.experimental.enableAsymmetricEar) {
16303
+ const earJwk = await invokeAsync(generateEarKey, GenerateEarKey, logger, performanceClient, request.correlationId)();
16304
+ return {
16305
+ ...request,
16306
+ earJwk,
16307
+ asymmetricEar: undefined,
16308
+ };
16309
+ }
16310
+ try {
16311
+ const { privateJwk, publicJwk } = await invokeAsync(generateAsymmetricEarKey, GenerateAsymmetricEarKey, logger, performanceClient, request.correlationId)();
16312
+ const apv = generateAsymmetricEarApv(publicJwk);
16313
+ const earJwk = base64Encode(JSON.stringify(publicJwk));
16314
+ return {
16315
+ ...request,
16316
+ earJwk,
16317
+ asymmetricEar: { privateJwk, apv },
16318
+ };
16319
+ }
16320
+ catch (error) {
16321
+ if (error instanceof AuthError) {
16322
+ throw error;
16323
+ }
16324
+ throw createBrowserAuthError(asymmetricEarKeyError, request.correlationId, "request_initialization_failed" /* AsymmetricEarSubErrors.RequestInitializationFailed */);
16325
+ }
16326
+ }
15850
16327
  /**
15851
16328
  * Builds the action URL + POST-body fields for the EAR /authorize form.
15852
16329
  */
@@ -15856,7 +16333,18 @@ async function getEARFormData(config, authority, request, logger, performanceCli
15856
16333
  }
15857
16334
  const parameters = await getStandardParameters(config, authority, request, logger, performanceClient);
15858
16335
  addResponseType(parameters, OAuthResponseType.IDTOKEN_TOKEN_REFRESHTOKEN);
15859
- addEARParameters(parameters, request.earJwk);
16336
+ try {
16337
+ addEARParameters(parameters, request.earJwk, request.asymmetricEar
16338
+ ? base64Encode(JSON.stringify({
16339
+ alg: "ECDH-ES",
16340
+ enc: "A256GCM",
16341
+ apv: request.asymmetricEar.apv,
16342
+ }))
16343
+ : undefined);
16344
+ }
16345
+ catch {
16346
+ throw createBrowserAuthError(asymmetricEarKeyError, request.correlationId, "request_encoding_failed" /* AsymmetricEarSubErrors.RequestEncodingFailed */);
16347
+ }
15860
16348
  // Also add codeChallenge as backup in case EAR is not supported
15861
16349
  addCodeChallengeParams(parameters, request.codeChallenge, S256_CODE_CHALLENGE_METHOD);
15862
16350
  addExtraParameters(parameters, {
@@ -15940,12 +16428,14 @@ async function handleResponsePlatformBroker(request, accountId, apiId, config, b
15940
16428
  const browserCrypto = new CryptoOps(logger, performanceClient);
15941
16429
  const nativeInteractionClient = new PlatformAuthInteractionClient(config, browserStorage, browserCrypto, logger, eventHandler, config.system.navigationClient, apiId, performanceClient, platformAuthProvider, accountId, nativeStorage, request.correlationId, tokenBindingKeyManager);
15942
16430
  const { userRequestState } = parseRequestState(browserCrypto.base64Decode, request.state, request.correlationId);
16431
+ const brokerRequest = {
16432
+ ...request,
16433
+ state: userRequestState,
16434
+ prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
16435
+ };
16436
+ delete brokerRequest.asymmetricEar;
15943
16437
  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
- });
16438
+ return await invokeAsync(nativeInteractionClient.acquireToken.bind(nativeInteractionClient), NativeInteractionClientAcquireToken, logger, performanceClient, request.correlationId)(brokerRequest);
15949
16439
  }
15950
16440
  catch (e) {
15951
16441
  await removeTokenBindingKeyOnFailure(request, tokenBindingKeyManager, logger, performanceClient);
@@ -15969,6 +16459,7 @@ async function handleResponseCode(request, response, codeVerifier, apiId, config
15969
16459
  // Instrument clientdata telemetry fields from the authorize response
15970
16460
  instrumentClientData(response, request.correlationId, performanceClient);
15971
16461
  if (response.accountId) {
16462
+ validateAuthorizationResponse(response, request.state, request.correlationId);
15972
16463
  return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, response.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
15973
16464
  }
15974
16465
  const authCodeRequest = {
@@ -16010,7 +16501,20 @@ async function handleResponseEAR(request, response, apiId, config, authority, br
16010
16501
  if (!request.earJwk) {
16011
16502
  throw createBrowserAuthError(earJwkEmpty, request.correlationId);
16012
16503
  }
16013
- const decryptedData = JSON.parse(await invokeAsync(decryptEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.earJwk, response.ear_jwe));
16504
+ let plaintext;
16505
+ if (request.asymmetricEar) {
16506
+ 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 });
16507
+ }
16508
+ else {
16509
+ plaintext = await invokeAsync(decryptEarResponse, DecryptEarResponse, logger, performanceClient, request.correlationId)(request.earJwk, response.ear_jwe);
16510
+ }
16511
+ let decryptedData;
16512
+ try {
16513
+ decryptedData = JSON.parse(plaintext);
16514
+ }
16515
+ catch {
16516
+ throw createBrowserAuthError(failedToDecryptEarResponse, request.correlationId, "invalid_decrypted_response_payload" /* AsymmetricEarSubErrors.InvalidDecryptedResponsePayload */);
16517
+ }
16014
16518
  if (decryptedData.accountId) {
16015
16519
  return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, decryptedData.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider, tokenBindingKeyManager);
16016
16520
  }
@@ -16301,6 +16805,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
16301
16805
  : "",
16302
16806
  postLogoutRedirectUri: "",
16303
16807
  popupRelayUri: "",
16808
+ popupRelayProtocolVersion: 1,
16304
16809
  clientCapabilities: [],
16305
16810
  OIDCOptions: {
16306
16811
  responseMode: ResponseMode$1.FRAGMENT,
@@ -16367,6 +16872,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
16367
16872
  client: new StubPerformanceClient(),
16368
16873
  };
16369
16874
  const DEFAULT_EXPERIMENTAL_OPTIONS = {
16875
+ enableAsymmetricEar: false,
16370
16876
  iframeTimeoutTelemetry: false,
16371
16877
  allowPlatformBrokerWithDOM: false,
16372
16878
  };
@@ -16420,9 +16926,16 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
16420
16926
  experimental: {
16421
16927
  ...DEFAULT_EXPERIMENTAL_OPTIONS,
16422
16928
  ...userInputExperimental,
16929
+ enableAsymmetricEar: userInputExperimental?.enableAsymmetricEar ?? false,
16423
16930
  },
16424
16931
  telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry },
16425
16932
  };
16933
+ if (overlayedConfig.experimental.enableAsymmetricEar &&
16934
+ overlayedConfig.system.protocolMode !== ProtocolMode.EAR) {
16935
+ const logger = new Logger(providedSystemOptions.loggerOptions, name, version);
16936
+ logger.warning("07xxx7", "");
16937
+ overlayedConfig.experimental.enableAsymmetricEar = false;
16938
+ }
16426
16939
  return overlayedConfig;
16427
16940
  }
16428
16941
 
@@ -16804,7 +17317,6 @@ class PlatformAuthExtensionHandler {
16804
17317
  * Copyright (c) Microsoft Corporation. All rights reserved.
16805
17318
  * Licensed under the MIT License.
16806
17319
  */
16807
- const PLATFORM_AUTH_DOM_DPOP_NOT_SUPPORTED = "platform_auth_dom_dpop_not_supported";
16808
17320
  class PlatformAuthDOMHandler {
16809
17321
  constructor(logger, performanceClient, correlationId) {
16810
17322
  this.logger = logger;
@@ -16884,11 +17396,9 @@ class PlatformAuthDOMHandler {
16884
17396
  });
16885
17397
  this.logger.trace(`02bcil ${this.platformAuthType}`, correlationId);
16886
17398
  try {
16887
- if (request.tokenType?.trim().toLowerCase() ===
16888
- PlatformAuthTokenType.DPOP_WITH_PROOF) {
16889
- throw createBrowserAuthError(PLATFORM_AUTH_DOM_DPOP_NOT_SUPPORTED, correlationId);
16890
- }
16891
17399
  const platformDOMRequest = invoke(this.initializePlatformDOMRequest.bind(this), PlatformAuthDOMInitializeRequest, this.logger, this.performanceClient, correlationId)(request);
17400
+ request.bindingPreferenceSent =
17401
+ platformDOMRequest.preferBinding !== undefined;
16892
17402
  const response =
16893
17403
  // @ts-ignore
16894
17404
  await window.navigator.platformAuthentication.executeGetToken(platformDOMRequest);
@@ -16933,8 +17443,12 @@ class PlatformAuthDOMHandler {
16933
17443
  preferBinding: preferBinding,
16934
17444
  enclave: enclave,
16935
17445
  requestConfirmation: reqCnf,
16936
- extraParametersNoCache,
17446
+ extraParametersNoCache: extraParametersNoCache && {
17447
+ ...extraParametersNoCache,
17448
+ },
16937
17449
  };
17450
+ delete platformDOMRequest.extraParameters?.bindingPreferenceSent;
17451
+ delete platformDOMRequest.extraParametersNoCache?.bindingPreferenceSent;
16938
17452
  return platformDOMRequest;
16939
17453
  }
16940
17454
  validatePlatformBrokerResponse(response, correlationId) {
@@ -16951,7 +17465,8 @@ class PlatformAuthDOMHandler {
16951
17465
  requiredKeys.every((key) => Object.prototype.hasOwnProperty.call(response, key));
16952
17466
  if (response &&
16953
17467
  Object.prototype.hasOwnProperty.call(response, "isSuccess")) {
16954
- if (isValid) {
17468
+ if (isValid &&
17469
+ response.isSuccess === true) {
16955
17470
  this.logger.trace(`0h4vei ${this.platformAuthType}`, correlationId);
16956
17471
  try {
16957
17472
  const validatedResponse = this.convertToPlatformBrokerResponse(response, correlationId);
@@ -17004,7 +17519,6 @@ class PlatformAuthDOMHandler {
17004
17519
  convertToPlatformBrokerResponse(response, correlationId) {
17005
17520
  this.logger.trace(`14913t ${this.platformAuthType}`, correlationId);
17006
17521
  const responseProperties = response.properties || {};
17007
- const bindingAttested = this.parseDOMBoolean(responseProperties.binding_attested, "binding_attested", correlationId);
17008
17522
  const nativeResponse = {
17009
17523
  access_token: response.accessToken,
17010
17524
  id_token: response.idToken,
@@ -17016,21 +17530,9 @@ class PlatformAuthDOMHandler {
17016
17530
  properties: responseProperties,
17017
17531
  extendedLifetimeToken: response.extendedLifetimeToken ?? false,
17018
17532
  shr: response.proofOfPossessionPayload,
17019
- token_type: responseProperties.token_type,
17020
- DPoP: responseProperties.dpop_proof,
17021
- binding_attested: bindingAttested,
17022
17533
  };
17023
17534
  return nativeResponse;
17024
17535
  }
17025
- parseDOMBoolean(value, propertyName, correlationId) {
17026
- if (value === undefined) {
17027
- return undefined;
17028
- }
17029
- if (value === "true" || value === "false") {
17030
- return value === "true";
17031
- }
17032
- throw createAuthError(unexpectedError, correlationId, `Platform broker returned invalid ${propertyName} value.`);
17033
- }
17034
17536
  getDOMExtraParams(extraParameters, correlationId) {
17035
17537
  try {
17036
17538
  const stringifiedProperties = {};
@@ -17143,8 +17645,7 @@ function isPlatformAuthAllowed(config, logger, correlationId, platformAuthProvid
17143
17645
  const schemeSupported = !authenticationScheme ||
17144
17646
  authenticationScheme === AuthenticationScheme$1.BEARER ||
17145
17647
  authenticationScheme === AuthenticationScheme$1.POP ||
17146
- (authenticationScheme === AuthenticationScheme$1.DPOP &&
17147
- !(platformAuthProvider instanceof PlatformAuthDOMHandler));
17648
+ authenticationScheme === AuthenticationScheme$1.DPOP;
17148
17649
  const fields = {
17149
17650
  allowPlatformBroker: config.system.allowPlatformBroker,
17150
17651
  ...(config.system.allowPlatformBroker && {
@@ -17327,19 +17828,21 @@ class PopupClient extends StandardInteractionClient {
17327
17828
  /*
17328
17829
  * When a popup-relay page is configured, open it top-level
17329
17830
  * (same first-party origin) instead of navigating the popup
17330
- * straight to the IdP, and carry the /authorize URL in its hash.
17831
+ * straight to the IdP. V1 carries the action in the hash; v2
17832
+ * retains it for the authenticated handoff.
17331
17833
  * The relay page opens the IdP child popup and relays the
17332
17834
  * response back via postMessage (see waitForPopupResponse).
17333
17835
  */
17334
17836
  const popupRelayUri = this.config.auth.popupRelayUri;
17837
+ popupParams.relayAction = { method: "GET", url: navigateUrl };
17335
17838
  const popupNavigateUrl = popupRelayUri
17336
- ? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), { method: "GET", url: navigateUrl }, correlationId)
17839
+ ? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), popupParams.relayAction, correlationId, this.config.auth.popupRelayProtocolVersion)
17337
17840
  : navigateUrl;
17338
17841
  // Show the UI once the url has been created. Get the window handle for the popup.
17339
17842
  const popupWindow = this.initiateAuthRequest(popupNavigateUrl, popupParams);
17340
17843
  this.eventHandler.emitEvent(EventType.POPUP_OPENED, correlationId, exports.InteractionType.Popup, { popupWindow }, null);
17341
17844
  // Wait for the redirect bridge response
17342
- const responseString = await this.waitForPopupResponse(request, popupWindow, popupParams.popupWindowParent);
17845
+ const responseString = await this.waitForPopupResponse(request, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
17343
17846
  const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
17344
17847
  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
17848
  }
@@ -17363,21 +17866,20 @@ class PopupClient extends StandardInteractionClient {
17363
17866
  const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
17364
17867
  // Get the frame handle for the silent request
17365
17868
  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
17869
  const pkce = pkceCodes ||
17368
17870
  (await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId));
17369
17871
  const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17370
- const popupRequest = {
17872
+ let popupRequest = {
17371
17873
  ...request,
17372
- earJwk: earJwk,
17373
17874
  codeChallenge: pkce.challenge,
17374
17875
  ...tokenBindingParams,
17375
17876
  popupOriginCheckDone: this.getPopupOriginCheckDone(popupParams.popupWindowParent),
17376
17877
  };
17377
17878
  try {
17879
+ popupRequest = await initializeEarRequest(this.config, popupRequest, this.logger, this.performanceClient);
17378
17880
  const popupWindow = await this.openPostFormPopup(popupRequest, discoveredAuthority, popupParams, correlationId, true);
17379
17881
  // 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);
17882
+ const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(popupRequest, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
17381
17883
  const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
17382
17884
  if (!serverParams.ear_jwe && serverParams.code) {
17383
17885
  const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, correlationId)({
@@ -17405,7 +17907,7 @@ class PopupClient extends StandardInteractionClient {
17405
17907
  const discoveredAuthority = await invokeAsync(getDiscoveredAuthority, StandardInteractionClientGetDiscoveredAuthority, this.logger, this.performanceClient, correlationId)(this.config, this.correlationId, this.performanceClient, this.browserStorage, this.logger);
17406
17908
  const popupWindow = await this.openPostFormPopup(request, discoveredAuthority, popupParams, correlationId, false);
17407
17909
  // 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);
17910
+ const responseString = await invokeAsync(this.waitForPopupResponse.bind(this), SilentHandlerMonitorIframeForHash, this.logger, this.performanceClient, correlationId)(request, popupWindow, popupParams.popupWindowParent, popupParams.relayAction);
17409
17911
  const serverParams = invoke(deserializeResponse, DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.responseMode, this.logger, this.correlationId);
17410
17912
  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
17913
  }
@@ -17461,21 +17963,22 @@ class PopupClient extends StandardInteractionClient {
17461
17963
  this.eventHandler.emitEvent(EventType.LOGOUT_SUCCESS, validRequest.correlationId, exports.InteractionType.Popup, validRequest);
17462
17964
  /*
17463
17965
  * 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
17966
+ * first-party origin), using the configured wire protocol for the
17967
+ * end-session URL. The relay page opens the IdP child
17466
17968
  * popup and the post-logout redirect page (running the redirect
17467
17969
  * bridge) relays completion back via postMessage — so logout works
17468
17970
  * from an embedded, cross-origin iframe where a direct popup to the
17469
17971
  * IdP cannot. See runPopupRelay / waitForPopupResponse.
17470
17972
  */
17471
17973
  const popupRelayUri = this.config.auth.popupRelayUri;
17974
+ popupParams.relayAction = { method: "GET", url: logoutUri };
17472
17975
  const popupNavigateUrl = popupRelayUri
17473
- ? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(validRequest.state || "", this.correlationId), { method: "GET", url: logoutUri }, this.correlationId)
17976
+ ? buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(validRequest.state || "", this.correlationId), popupParams.relayAction, this.correlationId, this.config.auth.popupRelayProtocolVersion)
17474
17977
  : logoutUri;
17475
17978
  // Open the popup window to requestUrl.
17476
17979
  const popupWindow = this.openPopup(popupNavigateUrl, popupParams);
17477
17980
  this.eventHandler.emitEvent(EventType.POPUP_OPENED, validRequest.correlationId, exports.InteractionType.Popup, { popupWindow }, null);
17478
- await this.waitForPopupResponse(validRequest, popupWindow, popupParams.popupWindowParent).catch(() => {
17981
+ await this.waitForPopupResponse(validRequest, popupWindow, popupParams.popupWindowParent, popupParams.relayAction).catch(() => {
17479
17982
  // Swallow any errors related to monitoring the window. Server logout is best effort
17480
17983
  });
17481
17984
  if (mainWindowRedirectUri) {
@@ -17687,11 +18190,12 @@ class PopupClient extends StandardInteractionClient {
17687
18190
  ? getEARFormData
17688
18191
  : getCodeFormData;
17689
18192
  const formData = await getFormData(this.config, discoveredAuthority, request, this.logger, this.performanceClient);
17690
- const relayUrl = buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), {
18193
+ popupParams.relayAction = {
17691
18194
  method: "POST",
17692
18195
  action: formData.action,
17693
18196
  fields: formData.fields,
17694
- }, correlationId);
18197
+ };
18198
+ const relayUrl = buildPopupRelayUrl(popupRelayUri, this.getRelayStateId(request.state, correlationId), popupParams.relayAction, correlationId, this.config.auth.popupRelayProtocolVersion);
17695
18199
  return this.initiateAuthRequest(relayUrl, popupParams);
17696
18200
  }
17697
18201
  const popupWindow = popupParams.popup || this.openPopup("about:blank", popupParams);
@@ -17700,7 +18204,7 @@ class PopupClient extends StandardInteractionClient {
17700
18204
  form.submit();
17701
18205
  return popupWindow;
17702
18206
  }
17703
- async waitForPopupResponse(request, popupWindow, popupWindowParent) {
18207
+ async waitForPopupResponse(request, popupWindow, popupWindowParent, relayAction) {
17704
18208
  /*
17705
18209
  * When a popup-relay page is configured the response is relayed back to
17706
18210
  * this frame by the relay page via postMessage, and the relay popup's
@@ -17710,7 +18214,11 @@ class PopupClient extends StandardInteractionClient {
17710
18214
  * frame and which does not track the relay popup.
17711
18215
  */
17712
18216
  if (this.config.auth.popupRelayUri) {
17713
- return waitForPopupRelayResponse(this.config.system.popupBridgeTimeout, this.logger, request, popupWindow, this.performanceClient);
18217
+ if (this.config.auth.popupRelayProtocolVersion === 2 &&
18218
+ !relayAction) {
18219
+ throw createBrowserAuthError(popupRelayUnsupportedFlow, this.correlationId, "popup_relay_bad_request");
18220
+ }
18221
+ return waitForPopupRelayResponse(this.config.system.popupBridgeTimeout, this.logger, request, popupWindow, this.performanceClient, relayAction, this.config.auth.popupRelayProtocolVersion);
17714
18222
  }
17715
18223
  if (this.waitForPopupResponseHook) {
17716
18224
  return this.waitForPopupResponseHook(request, popupWindow, popupWindowParent);
@@ -17835,16 +18343,15 @@ class RedirectClient extends StandardInteractionClient {
17835
18343
  const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
17836
18344
  // Get the frame handle for the silent request
17837
18345
  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
18346
  const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
17840
18347
  const tokenBindingParams = await getTokenBindingRequestParams(request, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17841
- const redirectRequest = {
18348
+ let redirectRequest = {
17842
18349
  ...request,
17843
- earJwk: earJwk,
17844
18350
  codeChallenge: pkceCodes.challenge,
17845
18351
  ...tokenBindingParams,
17846
18352
  };
17847
18353
  try {
18354
+ redirectRequest = await initializeEarRequest(this.config, redirectRequest, this.logger, this.performanceClient);
17848
18355
  if (!(await isTokenBindingKeyPersistedForRedirect(redirectRequest, this.tokenBindingKeyManager))) {
17849
18356
  throw createBrowserAuthError(cryptoKeyNotFound, this.correlationId);
17850
18357
  }
@@ -17857,9 +18364,10 @@ class RedirectClient extends StandardInteractionClient {
17857
18364
  }, this.config.system.redirectNavigationTimeout);
17858
18365
  });
17859
18366
  }
17860
- catch (e) {
18367
+ catch (error) {
18368
+ this.browserStorage.resetRequestCache(correlationId);
17861
18369
  await removeTokenBindingKeyOnFailure(redirectRequest, this.tokenBindingKeyManager, this.logger, this.performanceClient);
17862
- throw e;
18370
+ throw error;
17863
18371
  }
17864
18372
  }
17865
18373
  /**
@@ -18048,7 +18556,6 @@ class RedirectClient extends StandardInteractionClient {
18048
18556
  /**
18049
18557
  * Redirects window to given URL.
18050
18558
  * @param urlNavigate
18051
- * @param onRedirectNavigateRequest - onRedirectNavigate callback provided on the request
18052
18559
  */
18053
18560
  async initiateAuthRequest(requestUrl) {
18054
18561
  this.logger.verbose("0yaw2e", this.correlationId);
@@ -18336,13 +18843,11 @@ class SilentIframeClient extends StandardInteractionClient {
18336
18843
  async executeEarFlow(request) {
18337
18844
  const { correlationId, authority, azureCloudOptions, extraQueryParameters, account, } = request;
18338
18845
  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
18846
  const pkceCodes = await invokeAsync(generatePkceCodes, GeneratePkceCodes, this.logger, this.performanceClient, correlationId)(this.performanceClient, this.logger, correlationId);
18341
- const silentRequest = {
18847
+ const silentRequest = await initializeEarRequest(this.config, {
18342
18848
  ...request,
18343
- earJwk: earJwk,
18344
18849
  codeChallenge: pkceCodes.challenge,
18345
- };
18850
+ }, this.logger, this.performanceClient);
18346
18851
  // Create the iframe, register the response listener, then navigate, so the listener is active before the iframe can respond.
18347
18852
  const iframe = createHiddenIframe();
18348
18853
  const responseType = this.config.auth.OIDCOptions.responseMode;
@@ -18704,6 +19209,7 @@ function prepareWebSilentRequest({ request, account, correlationId, config, }) {
18704
19209
  return {
18705
19210
  key: JSON.stringify({
18706
19211
  ...thumbprint,
19212
+ accountTenantId: account.tenantId,
18707
19213
  forceRefresh: !!request.forceRefresh,
18708
19214
  cacheLookupPolicy: request.cacheLookupPolicy ?? CacheLookupPolicy.Default,
18709
19215
  extraParameters: canonicalizeStringDict(request.extraParameters),
@@ -18722,7 +19228,10 @@ function preparePlatformSilentRequest({ request, account, config, }) {
18722
19228
  account,
18723
19229
  });
18724
19230
  return {
18725
- key: `platform:${getPlatformSilentRequestKey(platformRequest, config)}`,
19231
+ key: platformRequest.authenticationScheme ===
19232
+ AuthenticationScheme$1.DPOP
19233
+ ? undefined
19234
+ : `platform:${getPlatformSilentRequestKey(platformRequest, config)}`,
18726
19235
  request: platformRequest,
18727
19236
  account: platformRequest.account,
18728
19237
  };
@@ -18754,7 +19263,6 @@ function getPlatformSilentRequestKey(request, config) {
18754
19263
  loginHint: request.loginHint,
18755
19264
  popKid: request.popKid,
18756
19265
  shrNonce: request.shrNonce,
18757
- dpopNonce: request.dpopNonce,
18758
19266
  skipBrokerClaims: request.embeddedClientId
18759
19267
  ? !!request.skipBrokerClaims
18760
19268
  : undefined,
@@ -20003,6 +20511,16 @@ class StandardController {
20003
20511
  getLogger() {
20004
20512
  return this.logger;
20005
20513
  }
20514
+ /**
20515
+ * Stores a resource-server DPoP nonce for the matching HTTPS origin.
20516
+ */
20517
+ async loadDpopNonce(resourceRequestUri, dpopNonce) {
20518
+ blockNonBrowserEnvironment();
20519
+ const correlationId = createNewGuid();
20520
+ return invokeAsync(async () => {
20521
+ this.browserStorage.setDpopNonce(resourceRequestUri, dpopNonce, correlationId);
20522
+ }, StandardControllerLoadDpopNonce, this.logger, this.performanceClient, correlationId)();
20523
+ }
20006
20524
  /**
20007
20525
  * Replaces the default logger set in configurations with new Logger with new configurations
20008
20526
  * @param logger Logger instance
@@ -20157,32 +20675,55 @@ class StandardController {
20157
20675
  correlationId,
20158
20676
  config: this.config,
20159
20677
  }, this.platformAuthProvider, this.logger, this.performanceClient);
20160
- const shouldDeduplicate = preparedRequest.request.authenticationScheme !==
20161
- AuthenticationScheme$1.DPOP;
20678
+ const requestKey = preparedRequest.key;
20679
+ const shouldDeduplicate = requestKey !== undefined;
20162
20680
  const inProgressRequest = shouldDeduplicate
20163
- ? this.activeSilentTokenRequests.get(preparedRequest.key)
20681
+ ? this.activeSilentTokenRequests.get(requestKey)
20164
20682
  : undefined;
20165
20683
  if (typeof inProgressRequest === "undefined") {
20166
20684
  this.logger.verbose(shouldDeduplicate
20167
20685
  ? "0fcjbk"
20168
- : "acquireTokenSilent called for DPoP request, starting an independent operation", correlationId);
20686
+ : "acquireTokenSilent called for platform DPoP request, starting an independent operation", correlationId);
20169
20687
  this.performanceClient.addFields({ deduped: false }, correlationId);
20170
20688
  const activeRequest = invokeAsync(this.acquireTokenSilentAsync.bind(this), AcquireTokenSilentAsync, this.logger, this.performanceClient, correlationId)({
20171
20689
  ...preparedRequest.request,
20172
20690
  correlationId,
20173
20691
  }, preparedRequest.account);
20174
- if (!shouldDeduplicate) {
20692
+ if (requestKey === undefined) {
20175
20693
  return activeRequest;
20176
20694
  }
20177
- this.activeSilentTokenRequests.set(preparedRequest.key, activeRequest);
20695
+ this.activeSilentTokenRequests.set(requestKey, activeRequest);
20178
20696
  return activeRequest.finally(() => {
20179
- this.activeSilentTokenRequests.delete(preparedRequest.key);
20697
+ this.activeSilentTokenRequests.delete(requestKey);
20180
20698
  });
20181
20699
  }
20182
20700
  else {
20183
20701
  this.logger.verbose("1yq7nb", correlationId);
20184
20702
  this.performanceClient.addFields({ deduped: true }, correlationId);
20185
- return inProgressRequest;
20703
+ const joiningRequest = {
20704
+ ...preparedRequest.request,
20705
+ correlationId,
20706
+ };
20707
+ const result = await inProgressRequest;
20708
+ if (joiningRequest.authenticationScheme !==
20709
+ AuthenticationScheme$1.DPOP) {
20710
+ return result;
20711
+ }
20712
+ if (result.fromPlatformBroker &&
20713
+ !ResponseHandler.hasDpopKeyId(result)) {
20714
+ return invokeAsync(this.acquireTokenSilentAsync.bind(this), AcquireTokenSilentAsync, this.logger, this.performanceClient, correlationId)(joiningRequest, result.account || preparedRequest.account);
20715
+ }
20716
+ const dpopProof = await ResponseHandler.generateDpopResourceProof(this.browserCrypto, result, {
20717
+ ...joiningRequest,
20718
+ authority: joiningRequest.authority || this.config.auth.authority,
20719
+ }, this.performanceClient, {
20720
+ tokenBindingKeyManager: this.tokenBindingKeyManager,
20721
+ dpopNonceProvider: this.browserStorage,
20722
+ });
20723
+ return {
20724
+ ...result,
20725
+ dpopProof,
20726
+ };
20186
20727
  }
20187
20728
  }
20188
20729
  /**
@@ -20950,8 +21491,21 @@ class NestedAppAuthController {
20950
21491
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
20951
21492
  isBroker) {
20952
21493
  const initCorrelationId = request?.correlationId || createNewGuid();
20953
- await this.browserStorage.initialize(initCorrelationId);
20954
- return Promise.resolve();
21494
+ const initMeasurement = this.performanceClient.startMeasurement(InitializeClientApplication, initCorrelationId);
21495
+ initMeasurement.add({
21496
+ nestedAppAuthRequest: true,
21497
+ bridgeType: "NAA",
21498
+ });
21499
+ try {
21500
+ await invokeAsync(this.browserStorage.initialize.bind(this.browserStorage), InitializeCache, this.logger, this.performanceClient, initCorrelationId)(initCorrelationId);
21501
+ }
21502
+ catch (error) {
21503
+ initMeasurement.discard();
21504
+ throw error;
21505
+ }
21506
+ initMeasurement.end({
21507
+ success: true,
21508
+ });
20955
21509
  }
20956
21510
  /**
20957
21511
  * Validate the incoming request and add correlationId if not present
@@ -21360,6 +21914,13 @@ class NestedAppAuthController {
21360
21914
  async clearCache(logoutRequest) {
21361
21915
  throw NestedAppAuthError.createUnsupportedError(logoutRequest?.correlationId);
21362
21916
  }
21917
+ /**
21918
+ * Rejects DPoP nonce loading until nested app authentication supports
21919
+ * forwarding the complete resource proof context.
21920
+ */
21921
+ loadDpopNonce() {
21922
+ return Promise.reject(NestedAppAuthError.createUnsupportedError());
21923
+ }
21363
21924
  async hydrateCache(result, request) {
21364
21925
  this.logger.verbose("16jycr", result.correlationId);
21365
21926
  const accountEntity = createAccountEntityFromAccountInfo(result.account, result.cloudGraphHostName, result.msGraphHost);
@@ -21989,6 +22550,12 @@ class PublicClientApplication {
21989
22550
  getActiveAccount() {
21990
22551
  return this.controller.getActiveAccount();
21991
22552
  }
22553
+ /**
22554
+ * Stores an opaque resource-server DPoP nonce for the matching HTTPS origin.
22555
+ */
22556
+ loadDpopNonce(resourceRequestUri, dpopNonce) {
22557
+ return this.controller.loadDpopNonce(resourceRequestUri, dpopNonce);
22558
+ }
21992
22559
  /**
21993
22560
  * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
21994
22561
  * @param sku
@@ -22035,10 +22602,11 @@ class PublicClientApplication {
22035
22602
  * @param configuration
22036
22603
  * @param correlationId
22037
22604
  * @param pcaFactory
22605
+ * @param standardPcaFactory
22038
22606
  * @returns IPublicClientApplication
22039
22607
  *
22040
22608
  */
22041
- async function createNestablePublicClientApplication(configuration, correlationId, pcaFactory) {
22609
+ async function createNestablePublicClientApplication(configuration, correlationId, pcaFactory, standardPcaFactory) {
22042
22610
  const nestedAppAuth = new NestedAppOperatingContext(configuration);
22043
22611
  await nestedAppAuth.initialize(correlationId);
22044
22612
  if (nestedAppAuth.isAvailable()) {
@@ -22050,6 +22618,11 @@ async function createNestablePublicClientApplication(configuration, correlationI
22050
22618
  await nestablePCA.initialize({ correlationId: cid });
22051
22619
  return nestablePCA;
22052
22620
  }
22621
+ if (standardPcaFactory) {
22622
+ const standardPCA = standardPcaFactory(configuration);
22623
+ await standardPCA.initialize(correlationId ? { correlationId } : undefined);
22624
+ return standardPCA;
22625
+ }
22053
22626
  return createStandardPublicClientApplication(configuration);
22054
22627
  }
22055
22628
  /**
@@ -22182,6 +22755,9 @@ const stubbedPublicClientApplication = {
22182
22755
  clearCache: () => {
22183
22756
  return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
22184
22757
  },
22758
+ loadDpopNonce: () => {
22759
+ return Promise.reject(createBrowserConfigurationAuthError(stubbedPublicClientApplicationCalled, ""));
22760
+ },
22185
22761
  };
22186
22762
 
22187
22763
  /*