@azure/msal-browser 5.22.0 → 5.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (574) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  4. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +133 -29
  5. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +178 -64
  7. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -1
  8. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +61 -22
  9. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -1
  10. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs +49 -0
  11. package/dist/broker/nativeBroker/PlatformAuthRequest.mjs.map +1 -0
  12. package/dist/cache/AccountManager.mjs +1 -1
  13. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  14. package/dist/cache/BrowserCacheManager.mjs +1 -1
  15. package/dist/cache/CacheHelpers.mjs +1 -1
  16. package/dist/cache/CacheKeys.mjs +1 -1
  17. package/dist/cache/CookieStorage.mjs +1 -1
  18. package/dist/cache/DatabaseStorage.mjs +1 -1
  19. package/dist/cache/EncryptedData.mjs +1 -1
  20. package/dist/cache/LocalStorage.mjs +97 -29
  21. package/dist/cache/LocalStorage.mjs.map +1 -1
  22. package/dist/cache/MemoryStorage.mjs +1 -1
  23. package/dist/cache/SessionStorage.mjs +1 -1
  24. package/dist/cache/TokenCache.mjs +1 -1
  25. package/dist/config/Configuration.mjs +1 -1
  26. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  27. package/dist/controllers/StandardController.mjs +10 -10
  28. package/dist/controllers/StandardController.mjs.map +1 -1
  29. package/dist/crypto/BrowserCrypto.mjs +1 -1
  30. package/dist/crypto/CryptoOps.mjs +1 -1
  31. package/dist/crypto/PkceGenerator.mjs +1 -1
  32. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  33. package/dist/crypto/TokenBindingKeyManager.mjs +1 -1
  34. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  35. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +27 -2
  36. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs.map +1 -1
  37. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +192 -2
  38. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  39. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  54. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  55. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  56. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs +21 -0
  57. package/dist/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.mjs.map +1 -0
  58. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs +80 -0
  59. package/dist/custom_auth/core/auth_flow/v2/CustomAuthResultV2.mjs.map +1 -0
  60. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.mjs +102 -0
  61. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.mjs.map +1 -0
  62. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs +12 -0
  63. package/dist/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.mjs.map +1 -0
  64. package/dist/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.mjs +20 -0
  65. package/dist/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.mjs.map +1 -0
  66. package/dist/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.mjs +36 -0
  67. package/dist/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.mjs.map +1 -0
  68. package/dist/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.mjs +29 -0
  69. package/dist/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.mjs.map +1 -0
  70. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs +76 -0
  71. package/dist/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.mjs.map +1 -0
  72. package/dist/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.mjs +36 -0
  73. package/dist/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.mjs.map +1 -0
  74. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs +36 -0
  75. package/dist/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.mjs.map +1 -0
  76. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs +134 -0
  77. package/dist/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.mjs.map +1 -0
  78. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs +23 -0
  79. package/dist/custom_auth/core/auth_flow/v2/state/CompletedStateV2.mjs.map +1 -0
  80. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs +22 -0
  81. package/dist/custom_auth/core/auth_flow/v2/state/FailedStateV2.mjs.map +1 -0
  82. package/dist/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.mjs +61 -0
  83. package/dist/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.mjs.map +1 -0
  84. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs +87 -0
  85. package/dist/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.mjs.map +1 -0
  86. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +3 -2
  87. package/dist/custom_auth/core/error/CustomAuthApiError.mjs.map +1 -1
  88. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  89. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  90. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  91. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  92. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  93. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  94. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  95. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  96. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  97. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  98. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  99. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  100. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  101. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  102. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  103. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  104. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  105. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  106. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  107. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  108. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  109. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs +602 -0
  110. package/dist/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.mjs.map +1 -0
  111. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs +67 -0
  112. package/dist/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.mjs.map +1 -0
  113. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs +46 -0
  114. package/dist/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.mjs.map +1 -0
  115. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  116. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  117. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +3 -2
  118. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs.map +1 -1
  119. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  120. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  121. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  122. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  123. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  124. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  125. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs +30 -0
  126. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.mjs.map +1 -0
  127. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs +193 -0
  128. package/dist/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.mjs.map +1 -0
  129. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs +236 -0
  130. package/dist/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.mjs.map +1 -0
  131. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs +26 -0
  132. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.mjs.map +1 -0
  133. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs +66 -0
  134. package/dist/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.mjs.map +1 -0
  135. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs +97 -0
  136. package/dist/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.mjs.map +1 -0
  137. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs +56 -0
  138. package/dist/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.mjs.map +1 -0
  139. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs +23 -0
  140. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.mjs.map +1 -0
  141. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs +14 -0
  142. package/dist/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.mjs.map +1 -0
  143. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  144. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +3 -2
  145. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs.map +1 -1
  146. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs +38 -0
  147. package/dist/custom_auth/core/telemetry/FlowApiIdHelperV2.mjs.map +1 -0
  148. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +20 -3
  149. package/dist/custom_auth/core/telemetry/PublicApiId.mjs.map +1 -1
  150. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  151. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  152. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  153. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  154. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  155. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  156. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  157. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  158. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  159. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  160. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  161. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  162. package/dist/custom_auth/index.mjs +23 -1
  163. package/dist/custom_auth/index.mjs.map +1 -1
  164. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  165. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  166. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  167. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  168. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  169. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  170. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  171. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  172. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  173. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  174. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  175. package/dist/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.mjs +29 -0
  176. package/dist/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.mjs.map +1 -0
  177. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs +59 -0
  178. package/dist/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.mjs.map +1 -0
  179. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  180. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  181. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  182. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  183. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  184. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  185. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  186. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  187. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  188. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  189. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  190. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  191. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  192. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.mjs +18 -0
  193. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.mjs.map +1 -0
  194. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.mjs +37 -0
  195. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.mjs.map +1 -0
  196. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.mjs +23 -0
  197. package/dist/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.mjs.map +1 -0
  198. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs +70 -0
  199. package/dist/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.mjs.map +1 -0
  200. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs +61 -0
  201. package/dist/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.mjs.map +1 -0
  202. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  203. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  204. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  205. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  206. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  207. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  208. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  209. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  210. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  211. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  212. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  213. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  214. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  215. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  216. package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.mjs +25 -0
  217. package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.mjs.map +1 -0
  218. package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.mjs +33 -0
  219. package/dist/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.mjs.map +1 -0
  220. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs +40 -0
  221. package/dist/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.mjs.map +1 -0
  222. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs +25 -0
  223. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.mjs.map +1 -0
  224. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs +47 -0
  225. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.mjs.map +1 -0
  226. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs +60 -0
  227. package/dist/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.mjs.map +1 -0
  228. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  229. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  230. package/dist/encode/Base64Decode.mjs +1 -1
  231. package/dist/encode/Base64Encode.mjs +1 -1
  232. package/dist/error/BrowserAuthError.mjs +1 -1
  233. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  234. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  235. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  236. package/dist/error/NativeAuthError.mjs +1 -1
  237. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  238. package/dist/error/NestedAppAuthError.mjs +1 -1
  239. package/dist/event/EventHandler.mjs +1 -1
  240. package/dist/event/EventMessage.mjs +1 -1
  241. package/dist/event/EventType.mjs +1 -1
  242. package/dist/index.mjs +1 -1
  243. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  244. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  245. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +21 -14
  246. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  247. package/dist/interaction_client/PopupClient.mjs +1 -1
  248. package/dist/interaction_client/RedirectClient.mjs +11 -8
  249. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  250. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  251. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  252. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  253. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  254. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  255. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  256. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  257. package/dist/log-strings-mapping.json +1381 -1185
  258. package/dist/naa/BridgeError.mjs +1 -1
  259. package/dist/naa/BridgeProxy.mjs +1 -1
  260. package/dist/naa/BridgeStatusCode.mjs +1 -1
  261. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  262. package/dist/navigation/NavigationClient.mjs +1 -1
  263. package/dist/network/FetchClient.mjs +1 -1
  264. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  265. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  266. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  267. package/dist/packageMetadata.mjs +2 -2
  268. package/dist/popup_relay/constants.mjs +1 -1
  269. package/dist/popup_relay/index.mjs +1 -1
  270. package/dist/popup_relay/relayClient.mjs +1 -1
  271. package/dist/protocol/Authorize.mjs +1 -1
  272. package/dist/redirect_bridge/index.mjs +1 -1
  273. package/dist/request/RequestHelpers.mjs +1 -1
  274. package/dist/response/ResponseHandler.mjs +1 -1
  275. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  276. package/dist/telemetry/BrowserPerformanceEvents.mjs +16 -2
  277. package/dist/telemetry/BrowserPerformanceEvents.mjs.map +1 -1
  278. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  279. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  280. package/dist/utils/BrowserConstants.mjs +1 -1
  281. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  282. package/dist/utils/BrowserUtils.mjs +1 -1
  283. package/dist/utils/Helpers.mjs +1 -1
  284. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  285. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +1 -1
  286. package/dist/webBrokerBridge/PerfEventNames.mjs +38 -0
  287. package/dist/webBrokerBridge/PerfEventNames.mjs.map +1 -0
  288. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +1 -1
  289. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +1 -1
  290. package/dist/webBrokerBridge/adapter/CrossVersionRequestAdapter.mjs +1 -1
  291. package/dist/webBrokerBridge/index.mjs +2 -1
  292. package/dist/webBrokerBridge/index.mjs.map +1 -1
  293. package/lib/custom-auth-path/log-strings-mapping.json +215 -19
  294. package/lib/custom-auth-path/msal-custom-auth.cjs +3571 -479
  295. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  296. package/lib/custom-auth-path/msal-custom-auth.js +3571 -479
  297. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  298. package/lib/log-strings-mapping.json +23 -11
  299. package/lib/msal-browser.cjs +622 -233
  300. package/lib/msal-browser.cjs.map +1 -1
  301. package/lib/msal-browser.js +622 -233
  302. package/lib/msal-browser.js.map +1 -1
  303. package/lib/msal-browser.min.js +2 -2
  304. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  305. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  306. package/lib/popup-relay/msal-popup-relay.js +2 -2
  307. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  308. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  309. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  310. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  311. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  312. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  313. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  314. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs +59 -1
  315. package/lib/web-broker-bridge/msal-web-broker-bridge.cjs.map +1 -1
  316. package/package.json +3 -3
  317. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +217 -45
  318. package/src/broker/nativeBroker/PlatformAuthExtensionHandler.ts +261 -107
  319. package/src/broker/nativeBroker/PlatformAuthProvider.ts +92 -37
  320. package/src/broker/nativeBroker/PlatformAuthRequest.ts +118 -6
  321. package/src/broker/nativeBroker/PlatformAuthResponse.ts +14 -1
  322. package/src/cache/LocalStorage.ts +135 -28
  323. package/src/controllers/StandardController.ts +17 -23
  324. package/src/custom_auth/CustomAuthActionInputs.ts +11 -0
  325. package/src/custom_auth/CustomAuthPublicClientApplication.ts +40 -4
  326. package/src/custom_auth/ICustomAuthPublicClientApplicationV2.ts +44 -0
  327. package/src/custom_auth/controller/CustomAuthStandardController.ts +360 -1
  328. package/src/custom_auth/controller/ICustomAuthStandardController.ts +14 -0
  329. package/src/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.ts +18 -0
  330. package/src/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.ts +20 -0
  331. package/src/custom_auth/core/auth_flow/v2/CustomAuthResultV2.ts +133 -0
  332. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.ts +146 -0
  333. package/src/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.ts +8 -0
  334. package/src/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.ts +15 -0
  335. package/src/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.ts +33 -0
  336. package/src/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.ts +25 -0
  337. package/src/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.ts +18 -0
  338. package/src/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.ts +26 -0
  339. package/src/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.ts +26 -0
  340. package/src/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.ts +25 -0
  341. package/src/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.ts +30 -0
  342. package/src/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.ts +40 -0
  343. package/src/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.ts +100 -0
  344. package/src/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.ts +59 -0
  345. package/src/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.ts +53 -0
  346. package/src/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.ts +196 -0
  347. package/src/custom_auth/core/auth_flow/v2/state/CompletedStateV2.ts +16 -0
  348. package/src/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.ts +44 -0
  349. package/src/custom_auth/core/auth_flow/v2/state/FailedStateV2.ts +15 -0
  350. package/src/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.ts +76 -0
  351. package/src/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.ts +119 -0
  352. package/src/custom_auth/core/error/CustomAuthApiError.ts +3 -1
  353. package/src/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.ts +35 -0
  354. package/src/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.ts +1145 -0
  355. package/src/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.ts +150 -0
  356. package/src/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.ts +66 -0
  357. package/src/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.ts +185 -0
  358. package/src/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.ts +1 -0
  359. package/src/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.ts +30 -0
  360. package/src/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.ts +423 -0
  361. package/src/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.ts +553 -0
  362. package/src/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.ts +24 -0
  363. package/src/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.ts +81 -0
  364. package/src/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.ts +177 -0
  365. package/src/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.ts +129 -0
  366. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.ts +68 -0
  367. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.ts +50 -0
  368. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/HalResource.ts +20 -0
  369. package/src/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.ts +202 -0
  370. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.ts +111 -0
  371. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.ts +26 -0
  372. package/src/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.ts +44 -0
  373. package/src/custom_auth/core/telemetry/FlowApiIdHelperV2.ts +64 -0
  374. package/src/custom_auth/core/telemetry/PublicApiId.ts +18 -0
  375. package/src/custom_auth/index.ts +96 -0
  376. package/src/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.ts +25 -0
  377. package/src/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.ts +33 -0
  378. package/src/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.ts +69 -0
  379. package/src/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateParametersV2.ts +9 -0
  380. package/src/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.ts +13 -0
  381. package/src/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.ts +35 -0
  382. package/src/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.ts +19 -0
  383. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.ts +31 -0
  384. package/src/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.ts +32 -0
  385. package/src/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.ts +22 -0
  386. package/src/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.ts +96 -0
  387. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.ts +83 -0
  388. package/src/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.ts +12 -0
  389. package/src/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.ts +21 -0
  390. package/src/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.ts +32 -0
  391. package/src/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.ts +28 -0
  392. package/src/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.ts +20 -0
  393. package/src/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.ts +48 -0
  394. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.ts +34 -0
  395. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.ts +63 -0
  396. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.ts +24 -0
  397. package/src/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.ts +112 -0
  398. package/src/interaction_client/PlatformAuthInteractionClient.ts +79 -17
  399. package/src/interaction_client/RedirectClient.ts +15 -5
  400. package/src/packageMetadata.ts +1 -1
  401. package/src/telemetry/BrowserPerformanceEvents.ts +20 -0
  402. package/src/webBrokerBridge/PerfEventNames.ts +43 -0
  403. package/src/webBrokerBridge/index.ts +26 -0
  404. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +3 -1
  405. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  406. package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts +3 -1
  407. package/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -1
  408. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts +1 -1
  409. package/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -1
  410. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +68 -5
  411. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
  412. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts +12 -1
  413. package/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -1
  414. package/types/cache/LocalStorage.d.ts +4 -5
  415. package/types/cache/LocalStorage.d.ts.map +1 -1
  416. package/types/controllers/StandardController.d.ts.map +1 -1
  417. package/types/custom_auth/CustomAuthActionInputs.d.ts +7 -0
  418. package/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  419. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  420. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts +27 -5
  421. package/types/custom_auth/CustomAuthPublicClientApplication.d.ts.map +1 -1
  422. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts +30 -0
  423. package/types/custom_auth/ICustomAuthPublicClientApplicationV2.d.ts.map +1 -0
  424. package/types/custom_auth/controller/CustomAuthStandardController.d.ts +11 -2
  425. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  426. package/types/custom_auth/controller/ICustomAuthStandardController.d.ts +7 -1
  427. package/types/custom_auth/controller/ICustomAuthStandardController.d.ts.map +1 -1
  428. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts +14 -0
  429. package/types/custom_auth/core/auth_flow/v2/AuthenticationMethodV2.d.ts.map +1 -0
  430. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts +14 -0
  431. package/types/custom_auth/core/auth_flow/v2/CustomAuthFlowScenarioV2.d.ts.map +1 -0
  432. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts +53 -0
  433. package/types/custom_auth/core/auth_flow/v2/CustomAuthResultV2.d.ts.map +1 -0
  434. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.d.ts +40 -0
  435. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorBaseV2.d.ts.map +1 -0
  436. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts +4 -0
  437. package/types/custom_auth/core/auth_flow/v2/error/AuthFlowErrorSubcodesV2.d.ts.map +1 -0
  438. package/types/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.d.ts +11 -0
  439. package/types/custom_auth/core/auth_flow/v2/error/RequestChallengeErrorV2.d.ts.map +1 -0
  440. package/types/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.d.ts +23 -0
  441. package/types/custom_auth/core/auth_flow/v2/error/ResetPasswordStartErrorV2.d.ts.map +1 -0
  442. package/types/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.d.ts +18 -0
  443. package/types/custom_auth/core/auth_flow/v2/error/VerifyChallengeErrorV2.d.ts.map +1 -0
  444. package/types/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.d.ts +7 -0
  445. package/types/custom_auth/core/auth_flow/v2/result/MFARequestChallengeResultV2.d.ts.map +1 -0
  446. package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts +15 -0
  447. package/types/custom_auth/core/auth_flow/v2/result/MFAResendChallengeResultV2.d.ts.map +1 -0
  448. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts +16 -0
  449. package/types/custom_auth/core/auth_flow/v2/result/MFASubmitChallengeResultV2.d.ts.map +1 -0
  450. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts +16 -0
  451. package/types/custom_auth/core/auth_flow/v2/result/RequestChallengeResultV2.d.ts.map +1 -0
  452. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts +18 -0
  453. package/types/custom_auth/core/auth_flow/v2/result/ResetPasswordStartResultV2.d.ts.map +1 -0
  454. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts +23 -0
  455. package/types/custom_auth/core/auth_flow/v2/result/VerifyChallengeResultV2.d.ts.map +1 -0
  456. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts +21 -0
  457. package/types/custom_auth/core/auth_flow/v2/state/AuthMethodSelectionRequiredStateV2.d.ts.map +1 -0
  458. package/types/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.d.ts +17 -0
  459. package/types/custom_auth/core/auth_flow/v2/state/AuthenticationMethodSelectionStateBaseV2.d.ts.map +1 -0
  460. package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts +14 -0
  461. package/types/custom_auth/core/auth_flow/v2/state/ChallengeVerificationStateBaseV2.d.ts.map +1 -0
  462. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts +25 -0
  463. package/types/custom_auth/core/auth_flow/v2/state/CodeRequiredStateV2.d.ts.map +1 -0
  464. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts +11 -0
  465. package/types/custom_auth/core/auth_flow/v2/state/CompletedStateV2.d.ts.map +1 -0
  466. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts +28 -0
  467. package/types/custom_auth/core/auth_flow/v2/state/CustomAuthStateParametersV2.d.ts.map +1 -0
  468. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts +10 -0
  469. package/types/custom_auth/core/auth_flow/v2/state/FailedStateV2.d.ts.map +1 -0
  470. package/types/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.d.ts +18 -0
  471. package/types/custom_auth/core/auth_flow/v2/state/MFARequiredStateV2.d.ts.map +1 -0
  472. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts +25 -0
  473. package/types/custom_auth/core/auth_flow/v2/state/MFAVerificationRequiredStateV2.d.ts.map +1 -0
  474. package/types/custom_auth/core/error/CustomAuthApiError.d.ts +3 -1
  475. package/types/custom_auth/core/error/CustomAuthApiError.d.ts.map +1 -1
  476. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts +21 -0
  477. package/types/custom_auth/core/interaction_client/v2/FlowContinuationStateV2.d.ts.map +1 -0
  478. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts +35 -0
  479. package/types/custom_auth/core/interaction_client/v2/FlowInteractionClientV2.d.ts.map +1 -0
  480. package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts +26 -0
  481. package/types/custom_auth/core/interaction_client/v2/InteractionClientBaseV2.d.ts.map +1 -0
  482. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts +43 -0
  483. package/types/custom_auth/core/interaction_client/v2/parameter/FlowParamsV2.d.ts.map +1 -0
  484. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts +80 -0
  485. package/types/custom_auth/core/interaction_client/v2/result/FlowActionResultV2.d.ts.map +1 -0
  486. package/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts +1 -0
  487. package/types/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.d.ts.map +1 -1
  488. package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts +17 -0
  489. package/types/custom_auth/core/network_client/custom_auth_api/v2/ApiClientConstantsV2.d.ts.map +1 -0
  490. package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts +31 -0
  491. package/types/custom_auth/core/network_client/custom_auth_api/v2/BaseApiClientV2.d.ts.map +1 -0
  492. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts +23 -0
  493. package/types/custom_auth/core/network_client/custom_auth_api/v2/CustomAuthApiClientV2.d.ts.map +1 -0
  494. package/types/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.d.ts +19 -0
  495. package/types/custom_auth/core/network_client/custom_auth_api/v2/ErrorCodesV2.d.ts.map +1 -0
  496. package/types/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.d.ts +2 -0
  497. package/types/custom_auth/core/network_client/custom_auth_api/v2/HrefResolverV2.d.ts.map +1 -0
  498. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts +15 -0
  499. package/types/custom_auth/core/network_client/custom_auth_api/v2/ResponseHandlerV2.d.ts.map +1 -0
  500. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts +52 -0
  501. package/types/custom_auth/core/network_client/custom_auth_api/v2/request/RequestsV2.d.ts.map +1 -0
  502. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.d.ts +3 -0
  503. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorNormalizerV2.d.ts.map +1 -0
  504. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts +37 -0
  505. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ErrorResponsesV2.d.ts.map +1 -0
  506. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/HalResource.d.ts +12 -0
  507. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/HalResource.d.ts.map +1 -0
  508. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts +133 -0
  509. package/types/custom_auth/core/network_client/custom_auth_api/v2/response/ResponsesV2.d.ts.map +1 -0
  510. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts +70 -0
  511. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/BaseResultsV2.d.ts.map +1 -0
  512. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts +10 -0
  513. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/ResetPasswordResultsV2.d.ts.map +1 -0
  514. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts +33 -0
  515. package/types/custom_auth/core/network_client/custom_auth_api/v2/result/SignUpResultsV2.d.ts.map +1 -0
  516. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts +4 -0
  517. package/types/custom_auth/core/telemetry/FlowApiIdHelperV2.d.ts.map +1 -0
  518. package/types/custom_auth/core/telemetry/PublicApiId.d.ts +16 -0
  519. package/types/custom_auth/core/telemetry/PublicApiId.d.ts.map +1 -1
  520. package/types/custom_auth/index.d.ts +37 -0
  521. package/types/custom_auth/index.d.ts.map +1 -1
  522. package/types/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.d.ts +18 -0
  523. package/types/custom_auth/reset_password/auth_flow/v2/error_type/SubmitNewPasswordErrorV2.d.ts.map +1 -0
  524. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts +22 -0
  525. package/types/custom_auth/reset_password/auth_flow/v2/result/SubmitNewPasswordResultV2.d.ts.map +1 -0
  526. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts +19 -0
  527. package/types/custom_auth/reset_password/auth_flow/v2/state/NewPasswordRequiredStateV2.d.ts.map +1 -0
  528. package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateParametersV2.d.ts +3 -0
  529. package/types/custom_auth/reset_password/auth_flow/v2/state/ResetPasswordStateParametersV2.d.ts.map +1 -0
  530. package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.d.ts +9 -0
  531. package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInContinuationErrorV2.d.ts.map +1 -0
  532. package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.d.ts +22 -0
  533. package/types/custom_auth/sign_in/auth_flow/v2/error_type/SignInStartErrorV2.d.ts.map +1 -0
  534. package/types/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.d.ts +12 -0
  535. package/types/custom_auth/sign_in/auth_flow/v2/error_type/SubmitPasswordErrorV2.d.ts.map +1 -0
  536. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts +21 -0
  537. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInContinuationResultV2.d.ts.map +1 -0
  538. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts +17 -0
  539. package/types/custom_auth/sign_in/auth_flow/v2/result/SignInStartResultV2.d.ts.map +1 -0
  540. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts +9 -0
  541. package/types/custom_auth/sign_in/auth_flow/v2/result/SubmitPasswordResultV2.d.ts.map +1 -0
  542. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts +17 -0
  543. package/types/custom_auth/sign_in/auth_flow/v2/state/PasswordRequiredStateV2.d.ts.map +1 -0
  544. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts +24 -0
  545. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInContinuationStateV2.d.ts.map +1 -0
  546. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts +4 -0
  547. package/types/custom_auth/sign_in/auth_flow/v2/state/SignInStateParametersV2.d.ts.map +1 -0
  548. package/types/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.d.ts +14 -0
  549. package/types/custom_auth/sign_up/auth_flow/v2/error_type/SignUpStartErrorV2.d.ts.map +1 -0
  550. package/types/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.d.ts +20 -0
  551. package/types/custom_auth/sign_up/auth_flow/v2/error_type/SubmitAttributesErrorV2.d.ts.map +1 -0
  552. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts +15 -0
  553. package/types/custom_auth/sign_up/auth_flow/v2/result/SignUpStartResultV2.d.ts.map +1 -0
  554. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts +8 -0
  555. package/types/custom_auth/sign_up/auth_flow/v2/result/SubmitAttributesResultV2.d.ts.map +1 -0
  556. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts +15 -0
  557. package/types/custom_auth/sign_up/auth_flow/v2/state/AttributesRequiredStateV2.d.ts.map +1 -0
  558. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts +11 -0
  559. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpAttributesRequiredStateBaseV2.d.ts.map +1 -0
  560. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts +19 -0
  561. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpPasswordRequiredStateV2.d.ts.map +1 -0
  562. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts +14 -0
  563. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateParametersV2.d.ts.map +1 -0
  564. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts +10 -0
  565. package/types/custom_auth/sign_up/auth_flow/v2/state/SignUpStateTransitionHandlerV2.d.ts.map +1 -0
  566. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  567. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  568. package/types/packageMetadata.d.ts +1 -1
  569. package/types/telemetry/BrowserPerformanceEvents.d.ts +13 -0
  570. package/types/telemetry/BrowserPerformanceEvents.d.ts.map +1 -1
  571. package/types/webBrokerBridge/PerfEventNames.d.ts +30 -0
  572. package/types/webBrokerBridge/PerfEventNames.d.ts.map +1 -0
  573. package/types/webBrokerBridge/index.d.ts +1 -0
  574. package/types/webBrokerBridge/index.d.ts.map +1 -1
@@ -0,0 +1,423 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import {
7
+ AADServerParamKeys,
8
+ Constants,
9
+ Logger,
10
+ ServerTelemetryManager,
11
+ } from "@azure/msal-common/browser";
12
+ import {
13
+ DefaultPackageInfo,
14
+ HttpHeaderKeys,
15
+ } from "../../../../CustomAuthConstants.js";
16
+ import { IHttpClient, HttpMethod } from "../../http_client/IHttpClient.js";
17
+ import { buildUrl, parseUrl } from "../../../utils/UrlUtils.js";
18
+ import { filterCustomHeaders } from "../../../utils/CustomHeaderUtils.js";
19
+ import { CustomAuthRequestInterceptor } from "../../../../configuration/CustomAuthRequestInterceptor.js";
20
+ import { ResponseHandlerV2 } from "./ResponseHandlerV2.js";
21
+ import { CustomAuthApiError } from "../../../error/CustomAuthApiError.js";
22
+ import { ServerErrorV2 } from "./response/ErrorResponsesV2.js";
23
+ import { resolveHrefV2 } from "./HrefResolverV2.js";
24
+ import {
25
+ AuthorizeChallengeEntryResponseV2,
26
+ AuthorizeChallengeContinueResponseV2,
27
+ ParsedResponseV2,
28
+ TokenResponseV2,
29
+ } from "./response/ResponsesV2.js";
30
+ import { JSON_CONTENT_TYPE } from "./ApiClientConstantsV2.js";
31
+ import { AUTHORIZE_CHALLENGE, SIGNIN_TOKEN } from "../CustomAuthApiEndpoint.js";
32
+ import {
33
+ AUTH_CODE_MISSING,
34
+ CONTINUATION_TOKEN_MISSING,
35
+ HTTP_REQUEST_FAILED,
36
+ INVALID_TOKEN_RESPONSE,
37
+ REDIRECT_TO_WEB,
38
+ } from "./ErrorCodesV2.js";
39
+ import {
40
+ RequestContextV2,
41
+ OAuthFormRequestV2,
42
+ ActionRequestBaseV2,
43
+ AuthorizeChallengeEntryRequestV2,
44
+ AuthorizeChallengeContinueRequestV2,
45
+ TokenRequestV2,
46
+ CompleteWithTokensRequestV2,
47
+ } from "./request/RequestsV2.js";
48
+ import { AuthorizeChallengeEntryResultV2 } from "./result/BaseResultsV2.js";
49
+
50
+ /*
51
+ * Shared Native Auth V2 network client for OAuth and HAL requests.
52
+ * Handles serialization, headers, error normalization, and server-provided links.
53
+ */
54
+ export abstract class BaseApiClientV2 {
55
+ private readonly baseRequestUrl: URL;
56
+
57
+ protected readonly handler: ResponseHandlerV2;
58
+
59
+ constructor(
60
+ baseUrl: string,
61
+ protected readonly clientId: string,
62
+ private readonly httpClient: IHttpClient,
63
+ private readonly customAuthApiQueryParams?: Record<string, string>,
64
+ private readonly requestInterceptor?: CustomAuthRequestInterceptor,
65
+ protected readonly logger?: Logger
66
+ ) {
67
+ this.baseRequestUrl = parseUrl(
68
+ !baseUrl.endsWith("/") ? `${baseUrl}/` : baseUrl
69
+ );
70
+ this.handler = new ResponseHandlerV2(logger);
71
+ }
72
+
73
+ /*
74
+ * Starts authorization and returns the initial continuation token and flow links.
75
+ */
76
+ async authorizeChallengeStart(
77
+ context: RequestContextV2,
78
+ scopes?: string[]
79
+ ): Promise<AuthorizeChallengeEntryResultV2> {
80
+ const request: AuthorizeChallengeEntryRequestV2 = {
81
+ client_id: this.clientId,
82
+ };
83
+
84
+ if (scopes?.length) {
85
+ request.scope = scopes.join(" ");
86
+ }
87
+
88
+ const parsedResponse =
89
+ await this.postOAuthForm<AuthorizeChallengeEntryResponseV2>(
90
+ AUTHORIZE_CHALLENGE,
91
+ request,
92
+ context
93
+ );
94
+
95
+ const { continuationToken, correlationId, error, body } =
96
+ parsedResponse;
97
+
98
+ /*
99
+ * No token means a genuine server error: surface the normalized server error directly. The
100
+ * fallback code/message only applies to a malformed response that carries neither a token
101
+ * nor an error.
102
+ */
103
+ if (!continuationToken) {
104
+ const apiError = error
105
+ ? this.toApiError(error, correlationId)
106
+ : new CustomAuthApiError(
107
+ CONTINUATION_TOKEN_MISSING,
108
+ "Continuation token is missing in the response",
109
+ correlationId
110
+ );
111
+
112
+ this.logger?.error(
113
+ `V2 authorize-challenge entry failed: '${apiError.error}'`,
114
+ correlationId
115
+ );
116
+
117
+ throw apiError;
118
+ }
119
+
120
+ return {
121
+ continuationToken,
122
+ resetPasswordHref: body.reset_password,
123
+ signInHref: body.sign_in,
124
+ signUpHref: body.sign_up,
125
+ };
126
+ }
127
+
128
+ /*
129
+ * Redeems a continuation token for an authorization code and then tokens.
130
+ */
131
+ async completeWithTokens(
132
+ request: CompleteWithTokensRequestV2,
133
+ context: RequestContextV2
134
+ ): Promise<TokenResponseV2> {
135
+ const code = await this.authorizeChallengeContinue(
136
+ request.continuationToken,
137
+ context
138
+ );
139
+
140
+ return this.token(code, request.scopes, context);
141
+ }
142
+
143
+ /*
144
+ * Redeems a continuation token for an authorization code.
145
+ */
146
+ protected async authorizeChallengeContinue(
147
+ continuationToken: string,
148
+ context: RequestContextV2
149
+ ): Promise<string> {
150
+ const request: AuthorizeChallengeContinueRequestV2 = {
151
+ continuation_token: continuationToken,
152
+ };
153
+
154
+ const parsedResponse =
155
+ await this.postOAuthForm<AuthorizeChallengeContinueResponseV2>(
156
+ AUTHORIZE_CHALLENGE,
157
+ request,
158
+ context
159
+ );
160
+
161
+ this.throwOnApiError(parsedResponse);
162
+
163
+ const code = parsedResponse.body.code;
164
+
165
+ if (!code) {
166
+ this.logger?.error(
167
+ "V2 authorize-challenge continue response is missing the authorization code",
168
+ parsedResponse.correlationId
169
+ );
170
+
171
+ throw new CustomAuthApiError(
172
+ AUTH_CODE_MISSING,
173
+ "Authorization code is missing in the response body",
174
+ parsedResponse.correlationId
175
+ );
176
+ }
177
+
178
+ return code;
179
+ }
180
+
181
+ /*
182
+ * Exchanges an authorization code for tokens.
183
+ */
184
+ protected async token(
185
+ code: string,
186
+ scopes: string[],
187
+ context: RequestContextV2
188
+ ): Promise<TokenResponseV2> {
189
+ const request: TokenRequestV2 = {
190
+ client_id: this.clientId,
191
+ grant_type: Constants.GrantType.AUTHORIZATION_CODE_GRANT,
192
+ code,
193
+ // Required so the server returns the client_info blob MSAL uses to build the home account id.
194
+ client_info: "1",
195
+ };
196
+
197
+ if (scopes.length > 0) {
198
+ request.scope = scopes.join(" ");
199
+ }
200
+
201
+ const parsedResponse = await this.postOAuthForm<TokenResponseV2>(
202
+ SIGNIN_TOKEN,
203
+ request,
204
+ context
205
+ );
206
+
207
+ this.throwOnApiError(parsedResponse);
208
+ this.ensureTokenResponseIsValid(
209
+ parsedResponse.body,
210
+ parsedResponse.correlationId
211
+ );
212
+
213
+ return parsedResponse.body;
214
+ }
215
+
216
+ /*
217
+ * Sends a JSON action request to a server-provided link.
218
+ */
219
+ protected async sendActionRequest<T>(
220
+ href: string,
221
+ method: (typeof HttpMethod)[keyof typeof HttpMethod],
222
+ body: ActionRequestBaseV2,
223
+ context: RequestContextV2
224
+ ): Promise<ParsedResponseV2<T>> {
225
+ if (!body.continuationToken) {
226
+ this.logger?.error(
227
+ "V2 HAL request is missing the continuation token that threads the flow forward",
228
+ context.correlationId
229
+ );
230
+
231
+ throw new CustomAuthApiError(
232
+ CONTINUATION_TOKEN_MISSING,
233
+ "The HAL request body did not include a continuation token, so the server-driven reset flow cannot advance",
234
+ context.correlationId
235
+ );
236
+ }
237
+
238
+ const url = resolveHrefV2(this.baseRequestUrl, href);
239
+
240
+ const response = await this.sendRequest(
241
+ url,
242
+ method,
243
+ JSON.stringify(body),
244
+ JSON_CONTENT_TYPE,
245
+ context
246
+ );
247
+
248
+ const parsedResponse = await this.handler.parseResponse<T>(
249
+ response,
250
+ context.correlationId
251
+ );
252
+
253
+ this.throwOnWebFallback(parsedResponse);
254
+ this.throwOnApiError(parsedResponse);
255
+
256
+ return parsedResponse;
257
+ }
258
+
259
+ protected throwOnApiError(parsedResponse: ParsedResponseV2<unknown>): void {
260
+ if (parsedResponse.error) {
261
+ const apiError = this.toApiError(
262
+ parsedResponse.error,
263
+ parsedResponse.correlationId
264
+ );
265
+
266
+ this.logger?.error(
267
+ `V2 API returned an error: '${apiError.error}'`,
268
+ parsedResponse.correlationId
269
+ );
270
+
271
+ throw apiError;
272
+ }
273
+ }
274
+
275
+ private async postOAuthForm<T>(
276
+ endpoint: string,
277
+ data: OAuthFormRequestV2 | AuthorizeChallengeContinueRequestV2,
278
+ context: RequestContextV2
279
+ ): Promise<ParsedResponseV2<T>> {
280
+ const formData = new URLSearchParams(
281
+ Object.entries(data) as [string, string][]
282
+ );
283
+ const url = buildUrl(
284
+ this.baseRequestUrl.href,
285
+ endpoint,
286
+ this.customAuthApiQueryParams
287
+ );
288
+
289
+ const response = await this.sendRequest(
290
+ url,
291
+ HttpMethod.POST,
292
+ formData,
293
+ Constants.URL_FORM_CONTENT_TYPE,
294
+ context
295
+ );
296
+
297
+ const parsedResponse = await this.handler.parseResponse<T>(
298
+ response,
299
+ context.correlationId
300
+ );
301
+
302
+ this.throwOnWebFallback(parsedResponse);
303
+
304
+ return parsedResponse;
305
+ }
306
+
307
+ private async sendRequest(
308
+ url: URL,
309
+ method: (typeof HttpMethod)[keyof typeof HttpMethod],
310
+ body: URLSearchParams | string,
311
+ contentType: string,
312
+ context: RequestContextV2
313
+ ): Promise<Response> {
314
+ const headers = {
315
+ ...this.getCommonHeaders(
316
+ context.correlationId,
317
+ context.telemetryManager,
318
+ contentType
319
+ ),
320
+ ...(await this.getAdditionalHeaders(url, context.correlationId)),
321
+ };
322
+
323
+ try {
324
+ return await this.httpClient.sendAsync(url, {
325
+ method,
326
+ body,
327
+ headers,
328
+ });
329
+ } catch (e) {
330
+ throw new CustomAuthApiError(
331
+ HTTP_REQUEST_FAILED,
332
+ `Failed to send request to '${url}': '${e}'`,
333
+ context.correlationId
334
+ );
335
+ }
336
+ }
337
+
338
+ private toApiError(
339
+ serverError: ServerErrorV2,
340
+ correlationId: string
341
+ ): CustomAuthApiError {
342
+ return new CustomAuthApiError(
343
+ serverError.code,
344
+ serverError.message ?? "",
345
+ serverError.correlationId ?? correlationId,
346
+ serverError.errorCodes,
347
+ serverError.innerErrorCode,
348
+ undefined,
349
+ undefined,
350
+ serverError.traceId,
351
+ serverError.timestamp,
352
+ serverError.attributeValidationDetails
353
+ );
354
+ }
355
+
356
+ private throwOnWebFallback(
357
+ parsedResponse: ParsedResponseV2<unknown>
358
+ ): void {
359
+ if (parsedResponse.isWebFallbackRequired) {
360
+ throw new CustomAuthApiError(
361
+ REDIRECT_TO_WEB,
362
+ "The server requires the flow to continue in a web browser",
363
+ parsedResponse.correlationId
364
+ );
365
+ }
366
+ }
367
+
368
+ private ensureTokenResponseIsValid(
369
+ tokenResponse: TokenResponseV2,
370
+ correlationId: string
371
+ ): void {
372
+ if (!tokenResponse.access_token) {
373
+ throw new CustomAuthApiError(
374
+ INVALID_TOKEN_RESPONSE,
375
+ "Access token is missing in the response body",
376
+ correlationId
377
+ );
378
+ }
379
+ }
380
+
381
+ private getCommonHeaders(
382
+ correlationId: string,
383
+ telemetryManager: ServerTelemetryManager,
384
+ contentType: string
385
+ ): Record<string, string> {
386
+ return {
387
+ [HttpHeaderKeys.CONTENT_TYPE]: contentType,
388
+ [AADServerParamKeys.X_CLIENT_SKU]: DefaultPackageInfo.SKU,
389
+ [AADServerParamKeys.X_CLIENT_VER]: DefaultPackageInfo.VERSION,
390
+ [AADServerParamKeys.X_CLIENT_OS]: DefaultPackageInfo.OS,
391
+ [AADServerParamKeys.X_CLIENT_CPU]: DefaultPackageInfo.CPU,
392
+ [AADServerParamKeys.X_CLIENT_CURR_TELEM]:
393
+ telemetryManager.generateCurrentRequestHeaderValue(),
394
+ [AADServerParamKeys.X_CLIENT_LAST_TELEM]:
395
+ telemetryManager.generateLastRequestHeaderValue(),
396
+ [AADServerParamKeys.CLIENT_REQUEST_ID]: correlationId,
397
+ };
398
+ }
399
+
400
+ private async getAdditionalHeaders(
401
+ url: URL,
402
+ correlationId: string
403
+ ): Promise<Record<string, string>> {
404
+ if (!this.requestInterceptor) {
405
+ return {};
406
+ }
407
+
408
+ try {
409
+ const result = await Promise.resolve(
410
+ this.requestInterceptor.addAdditionalHeaderFields(url)
411
+ );
412
+
413
+ return filterCustomHeaders(result, this.logger, correlationId);
414
+ } catch (e) {
415
+ this.logger?.warningPii(
416
+ `CustomAuthRequestInterceptor.addAdditionalHeaderFields threw an error; continuing without additional headers: '${e}'`,
417
+ correlationId
418
+ );
419
+
420
+ return {};
421
+ }
422
+ }
423
+ }