@azure/msal-browser 4.15.0 → 4.18.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 (415) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/app/PublicClientNext.mjs +1 -1
  4. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  5. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  8. package/dist/cache/AccountManager.mjs +1 -1
  9. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +1 -1
  11. package/dist/cache/CacheHelpers.mjs +1 -1
  12. package/dist/cache/CookieStorage.mjs +1 -1
  13. package/dist/cache/DatabaseStorage.mjs +1 -1
  14. package/dist/cache/LocalStorage.mjs +1 -1
  15. package/dist/cache/MemoryStorage.mjs +1 -1
  16. package/dist/cache/SessionStorage.mjs +1 -1
  17. package/dist/cache/TokenCache.mjs +1 -1
  18. package/dist/config/Configuration.mjs +1 -1
  19. package/dist/controllers/ControllerFactory.mjs +1 -1
  20. package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
  21. package/dist/controllers/NestedAppAuthController.mjs +15 -3
  22. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  23. package/dist/controllers/StandardController.mjs +1 -1
  24. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  25. package/dist/crypto/BrowserCrypto.mjs +1 -1
  26. package/dist/crypto/CryptoOps.mjs +1 -1
  27. package/dist/crypto/PkceGenerator.mjs +1 -1
  28. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  29. package/dist/custom-auth-path/app/PublicClientApplication.mjs +1 -1
  30. package/dist/custom-auth-path/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  31. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  32. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  33. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  34. package/dist/custom-auth-path/cache/AccountManager.mjs +1 -1
  35. package/dist/custom-auth-path/cache/AsyncMemoryStorage.mjs +1 -1
  36. package/dist/custom-auth-path/cache/BrowserCacheManager.mjs +1 -1
  37. package/dist/custom-auth-path/cache/CacheHelpers.mjs +1 -1
  38. package/dist/custom-auth-path/cache/CookieStorage.mjs +1 -1
  39. package/dist/custom-auth-path/cache/DatabaseStorage.mjs +1 -1
  40. package/dist/custom-auth-path/cache/LocalStorage.mjs +1 -1
  41. package/dist/custom-auth-path/cache/MemoryStorage.mjs +1 -1
  42. package/dist/custom-auth-path/cache/SessionStorage.mjs +1 -1
  43. package/dist/custom-auth-path/cache/TokenCache.mjs +1 -1
  44. package/dist/custom-auth-path/config/Configuration.mjs +1 -1
  45. package/dist/custom-auth-path/controllers/ControllerFactory.mjs +1 -1
  46. package/dist/custom-auth-path/controllers/NestedAppAuthController.d.ts.map +1 -1
  47. package/dist/custom-auth-path/controllers/StandardController.mjs +1 -1
  48. package/dist/custom-auth-path/crypto/BrowserCrypto.mjs +1 -1
  49. package/dist/custom-auth-path/crypto/CryptoOps.mjs +1 -1
  50. package/dist/custom-auth-path/crypto/PkceGenerator.mjs +1 -1
  51. package/dist/custom-auth-path/custom_auth/CustomAuthActionInputs.d.ts +3 -0
  52. package/dist/custom-auth-path/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  53. package/dist/custom-auth-path/custom_auth/CustomAuthConstants.d.ts +1 -1
  54. package/dist/custom-auth-path/custom_auth/CustomAuthConstants.mjs +1 -1
  55. package/dist/custom-auth-path/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  56. package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  57. package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.mjs +8 -2
  58. package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  59. package/dist/custom-auth-path/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  60. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +5 -0
  61. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -1
  62. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +10 -1
  63. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs.map +1 -1
  64. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  65. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  66. package/dist/custom-auth-path/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  67. package/dist/custom-auth-path/custom_auth/core/error/CustomAuthError.mjs +1 -1
  68. package/dist/custom-auth-path/custom_auth/core/error/HttpError.mjs +1 -1
  69. package/dist/custom-auth-path/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  70. package/dist/custom-auth-path/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  71. package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  72. package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  73. package/dist/custom-auth-path/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  74. package/dist/custom-auth-path/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  75. package/dist/custom-auth-path/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  76. package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  77. package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  78. package/dist/custom-auth-path/custom_auth/core/error/UnexpectedError.mjs +1 -1
  79. package/dist/custom-auth-path/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  80. package/dist/custom-auth-path/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  81. package/dist/custom-auth-path/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  82. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  83. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  84. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  85. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  86. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  87. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  88. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -1
  89. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +4 -1
  90. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs.map +1 -1
  91. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  92. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  93. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +1 -0
  94. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -1
  95. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  96. package/dist/custom-auth-path/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  97. package/dist/custom-auth-path/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  98. package/dist/custom-auth-path/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  99. package/dist/custom-auth-path/custom_auth/core/utils/ArgumentValidator.d.ts +1 -0
  100. package/dist/custom-auth-path/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
  101. package/dist/custom-auth-path/custom_auth/core/utils/ArgumentValidator.mjs +18 -2
  102. package/dist/custom-auth-path/custom_auth/core/utils/ArgumentValidator.mjs.map +1 -1
  103. package/dist/custom-auth-path/custom_auth/core/utils/UrlUtils.mjs +1 -1
  104. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/CustomAuthAccountData.d.ts.map +1 -1
  105. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +8 -4
  106. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs.map +1 -1
  107. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  108. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  109. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  110. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  111. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  112. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  113. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  114. package/dist/custom-auth-path/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  115. package/dist/custom-auth-path/custom_auth/index.mjs +1 -1
  116. package/dist/custom-auth-path/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  117. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  118. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  119. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  120. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  121. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  122. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  123. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  124. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  125. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  126. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  127. package/dist/custom-auth-path/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  128. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  129. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts +5 -0
  130. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts.map +1 -1
  131. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +8 -1
  132. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs.map +1 -1
  133. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  134. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  135. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  136. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCredentialResult.mjs +1 -1
  137. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  138. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -1
  139. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +2 -1
  140. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs.map +1 -1
  141. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  142. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -1
  143. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +6 -1
  144. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs.map +1 -1
  145. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  146. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -1
  147. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +2 -1
  148. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs.map +1 -1
  149. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  150. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +1 -0
  151. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -1
  152. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
  153. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.mjs +10 -1
  154. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.mjs.map +1 -1
  155. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts +3 -0
  156. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts.map +1 -1
  157. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  158. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  159. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  160. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  161. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  162. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  163. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  164. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  165. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  166. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  167. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  168. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  169. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  170. package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  171. package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  172. package/dist/custom-auth-path/encode/Base64Decode.mjs +1 -1
  173. package/dist/custom-auth-path/encode/Base64Encode.mjs +1 -1
  174. package/dist/custom-auth-path/error/BrowserAuthError.mjs +1 -1
  175. package/dist/custom-auth-path/error/BrowserAuthErrorCodes.mjs +1 -1
  176. package/dist/custom-auth-path/error/BrowserConfigurationAuthError.mjs +1 -1
  177. package/dist/custom-auth-path/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  178. package/dist/custom-auth-path/error/NativeAuthError.mjs +1 -1
  179. package/dist/custom-auth-path/error/NativeAuthErrorCodes.mjs +1 -1
  180. package/dist/custom-auth-path/event/EventHandler.mjs +1 -1
  181. package/dist/custom-auth-path/event/EventType.mjs +1 -1
  182. package/dist/custom-auth-path/interaction_client/BaseInteractionClient.mjs +1 -1
  183. package/dist/custom-auth-path/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  184. package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
  185. package/dist/custom-auth-path/interaction_client/PopupClient.d.ts +2 -1
  186. package/dist/custom-auth-path/interaction_client/PopupClient.d.ts.map +1 -1
  187. package/dist/custom-auth-path/interaction_client/PopupClient.mjs +43 -14
  188. package/dist/custom-auth-path/interaction_client/PopupClient.mjs.map +1 -1
  189. package/dist/custom-auth-path/interaction_client/RedirectClient.d.ts +5 -0
  190. package/dist/custom-auth-path/interaction_client/RedirectClient.d.ts.map +1 -1
  191. package/dist/custom-auth-path/interaction_client/RedirectClient.mjs +42 -15
  192. package/dist/custom-auth-path/interaction_client/RedirectClient.mjs.map +1 -1
  193. package/dist/custom-auth-path/interaction_client/SilentAuthCodeClient.mjs +1 -1
  194. package/dist/custom-auth-path/interaction_client/SilentCacheClient.mjs +1 -1
  195. package/dist/custom-auth-path/interaction_client/SilentIframeClient.d.ts.map +1 -1
  196. package/dist/custom-auth-path/interaction_client/SilentIframeClient.mjs +13 -7
  197. package/dist/custom-auth-path/interaction_client/SilentIframeClient.mjs.map +1 -1
  198. package/dist/custom-auth-path/interaction_client/SilentRefreshClient.mjs +1 -1
  199. package/dist/custom-auth-path/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  200. package/dist/custom-auth-path/interaction_client/StandardInteractionClient.mjs +7 -3
  201. package/dist/custom-auth-path/interaction_client/StandardInteractionClient.mjs.map +1 -1
  202. package/dist/custom-auth-path/interaction_handler/InteractionHandler.mjs +1 -1
  203. package/dist/custom-auth-path/interaction_handler/SilentHandler.d.ts +1 -0
  204. package/dist/custom-auth-path/interaction_handler/SilentHandler.d.ts.map +1 -1
  205. package/dist/custom-auth-path/interaction_handler/SilentHandler.mjs +12 -3
  206. package/dist/custom-auth-path/interaction_handler/SilentHandler.mjs.map +1 -1
  207. package/dist/custom-auth-path/navigation/NavigationClient.mjs +1 -1
  208. package/dist/custom-auth-path/network/FetchClient.mjs +1 -1
  209. package/dist/custom-auth-path/operatingcontext/BaseOperatingContext.mjs +1 -1
  210. package/dist/custom-auth-path/operatingcontext/StandardOperatingContext.mjs +1 -1
  211. package/dist/custom-auth-path/packageMetadata.d.ts +1 -1
  212. package/dist/custom-auth-path/packageMetadata.mjs +2 -2
  213. package/dist/custom-auth-path/protocol/Authorize.d.ts +4 -0
  214. package/dist/custom-auth-path/protocol/Authorize.d.ts.map +1 -1
  215. package/dist/custom-auth-path/protocol/Authorize.mjs +15 -2
  216. package/dist/custom-auth-path/protocol/Authorize.mjs.map +1 -1
  217. package/dist/custom-auth-path/request/RequestHelpers.d.ts +11 -1
  218. package/dist/custom-auth-path/request/RequestHelpers.d.ts.map +1 -1
  219. package/dist/custom-auth-path/request/RequestHelpers.mjs +32 -3
  220. package/dist/custom-auth-path/request/RequestHelpers.mjs.map +1 -1
  221. package/dist/custom-auth-path/response/ResponseHandler.mjs +1 -1
  222. package/dist/custom-auth-path/utils/BrowserConstants.mjs +1 -1
  223. package/dist/custom-auth-path/utils/BrowserProtocolUtils.mjs +1 -1
  224. package/dist/custom-auth-path/utils/BrowserUtils.mjs +1 -1
  225. package/dist/custom-auth-path/utils/MsalFrameStatsUtils.mjs +1 -1
  226. package/dist/custom_auth/CustomAuthActionInputs.d.ts +3 -0
  227. package/dist/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  228. package/dist/custom_auth/CustomAuthConstants.d.ts +1 -1
  229. package/dist/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  230. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +5 -0
  231. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -1
  232. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -1
  233. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +1 -0
  234. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -1
  235. package/dist/custom_auth/core/utils/ArgumentValidator.d.ts +1 -0
  236. package/dist/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
  237. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.d.ts.map +1 -1
  238. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts +5 -0
  239. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts.map +1 -1
  240. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -1
  241. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -1
  242. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -1
  243. package/dist/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +1 -0
  244. package/dist/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -1
  245. package/dist/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
  246. package/dist/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts +3 -0
  247. package/dist/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts.map +1 -1
  248. package/dist/encode/Base64Decode.mjs +1 -1
  249. package/dist/encode/Base64Encode.mjs +1 -1
  250. package/dist/error/BrowserAuthError.mjs +1 -1
  251. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  252. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  253. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  254. package/dist/error/NativeAuthError.mjs +1 -1
  255. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  256. package/dist/error/NestedAppAuthError.mjs +1 -1
  257. package/dist/event/EventHandler.mjs +1 -1
  258. package/dist/event/EventMessage.mjs +1 -1
  259. package/dist/event/EventType.mjs +1 -1
  260. package/dist/index.mjs +1 -1
  261. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  262. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  263. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +1 -1
  264. package/dist/interaction_client/PopupClient.d.ts +2 -1
  265. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  266. package/dist/interaction_client/PopupClient.mjs +43 -14
  267. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  268. package/dist/interaction_client/RedirectClient.d.ts +5 -0
  269. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  270. package/dist/interaction_client/RedirectClient.mjs +42 -15
  271. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  272. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  273. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  274. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  275. package/dist/interaction_client/SilentIframeClient.mjs +13 -7
  276. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  277. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  278. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  279. package/dist/interaction_client/StandardInteractionClient.mjs +7 -3
  280. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  281. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  282. package/dist/interaction_handler/SilentHandler.d.ts +1 -0
  283. package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
  284. package/dist/interaction_handler/SilentHandler.mjs +12 -3
  285. package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
  286. package/dist/naa/BridgeError.mjs +1 -1
  287. package/dist/naa/BridgeProxy.mjs +1 -1
  288. package/dist/naa/BridgeStatusCode.mjs +1 -1
  289. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  290. package/dist/navigation/NavigationClient.mjs +1 -1
  291. package/dist/network/FetchClient.mjs +1 -1
  292. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  293. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  294. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  295. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  296. package/dist/packageMetadata.d.ts +1 -1
  297. package/dist/packageMetadata.mjs +2 -2
  298. package/dist/protocol/Authorize.d.ts +4 -0
  299. package/dist/protocol/Authorize.d.ts.map +1 -1
  300. package/dist/protocol/Authorize.mjs +15 -2
  301. package/dist/protocol/Authorize.mjs.map +1 -1
  302. package/dist/request/RequestHelpers.d.ts +11 -1
  303. package/dist/request/RequestHelpers.d.ts.map +1 -1
  304. package/dist/request/RequestHelpers.mjs +32 -3
  305. package/dist/request/RequestHelpers.mjs.map +1 -1
  306. package/dist/response/ResponseHandler.mjs +1 -1
  307. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  308. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  309. package/dist/utils/BrowserConstants.mjs +1 -1
  310. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  311. package/dist/utils/BrowserUtils.mjs +1 -1
  312. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  313. package/lib/custom-auth-path/msal-custom-auth.cjs +292 -96
  314. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  315. package/lib/custom-auth-path/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  316. package/lib/custom-auth-path/types/custom_auth/CustomAuthActionInputs.d.ts +3 -0
  317. package/lib/custom-auth-path/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  318. package/lib/custom-auth-path/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  319. package/lib/custom-auth-path/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  320. package/lib/custom-auth-path/types/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +5 -0
  321. package/lib/custom-auth-path/types/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -1
  322. package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -1
  323. package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +1 -0
  324. package/lib/custom-auth-path/types/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -1
  325. package/lib/custom-auth-path/types/custom_auth/core/utils/ArgumentValidator.d.ts +1 -0
  326. package/lib/custom-auth-path/types/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
  327. package/lib/custom-auth-path/types/custom_auth/get_account/auth_flow/CustomAuthAccountData.d.ts.map +1 -1
  328. package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts +5 -0
  329. package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts.map +1 -1
  330. package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -1
  331. package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -1
  332. package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -1
  333. package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +1 -0
  334. package/lib/custom-auth-path/types/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -1
  335. package/lib/custom-auth-path/types/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
  336. package/lib/custom-auth-path/types/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts +3 -0
  337. package/lib/custom-auth-path/types/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts.map +1 -1
  338. package/lib/custom-auth-path/types/interaction_client/PopupClient.d.ts +2 -1
  339. package/lib/custom-auth-path/types/interaction_client/PopupClient.d.ts.map +1 -1
  340. package/lib/custom-auth-path/types/interaction_client/RedirectClient.d.ts +5 -0
  341. package/lib/custom-auth-path/types/interaction_client/RedirectClient.d.ts.map +1 -1
  342. package/lib/custom-auth-path/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  343. package/lib/custom-auth-path/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  344. package/lib/custom-auth-path/types/interaction_handler/SilentHandler.d.ts +1 -0
  345. package/lib/custom-auth-path/types/interaction_handler/SilentHandler.d.ts.map +1 -1
  346. package/lib/custom-auth-path/types/packageMetadata.d.ts +1 -1
  347. package/lib/custom-auth-path/types/protocol/Authorize.d.ts +4 -0
  348. package/lib/custom-auth-path/types/protocol/Authorize.d.ts.map +1 -1
  349. package/lib/custom-auth-path/types/request/RequestHelpers.d.ts +11 -1
  350. package/lib/custom-auth-path/types/request/RequestHelpers.d.ts.map +1 -1
  351. package/lib/msal-browser.cjs +256 -98
  352. package/lib/msal-browser.cjs.map +1 -1
  353. package/lib/msal-browser.js +256 -98
  354. package/lib/msal-browser.js.map +1 -1
  355. package/lib/msal-browser.min.js +68 -68
  356. package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  357. package/lib/types/custom_auth/CustomAuthActionInputs.d.ts +3 -0
  358. package/lib/types/custom_auth/CustomAuthActionInputs.d.ts.map +1 -1
  359. package/lib/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  360. package/lib/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  361. package/lib/types/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts +5 -0
  362. package/lib/types/custom_auth/core/auth_flow/AuthFlowErrorBase.d.ts.map +1 -1
  363. package/lib/types/custom_auth/core/network_client/custom_auth_api/SignInApiClient.d.ts.map +1 -1
  364. package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts +1 -0
  365. package/lib/types/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.d.ts.map +1 -1
  366. package/lib/types/custom_auth/core/utils/ArgumentValidator.d.ts +1 -0
  367. package/lib/types/custom_auth/core/utils/ArgumentValidator.d.ts.map +1 -1
  368. package/lib/types/custom_auth/get_account/auth_flow/CustomAuthAccountData.d.ts.map +1 -1
  369. package/lib/types/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts +5 -0
  370. package/lib/types/custom_auth/sign_in/auth_flow/error_type/SignInError.d.ts.map +1 -1
  371. package/lib/types/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.d.ts.map +1 -1
  372. package/lib/types/custom_auth/sign_in/auth_flow/state/SignInContinuationState.d.ts.map +1 -1
  373. package/lib/types/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.d.ts.map +1 -1
  374. package/lib/types/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts +1 -0
  375. package/lib/types/custom_auth/sign_in/auth_flow/state/SignInStateParameters.d.ts.map +1 -1
  376. package/lib/types/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
  377. package/lib/types/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts +3 -0
  378. package/lib/types/custom_auth/sign_in/interaction_client/parameter/SignInParams.d.ts.map +1 -1
  379. package/lib/types/interaction_client/PopupClient.d.ts +2 -1
  380. package/lib/types/interaction_client/PopupClient.d.ts.map +1 -1
  381. package/lib/types/interaction_client/RedirectClient.d.ts +5 -0
  382. package/lib/types/interaction_client/RedirectClient.d.ts.map +1 -1
  383. package/lib/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  384. package/lib/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  385. package/lib/types/interaction_handler/SilentHandler.d.ts +1 -0
  386. package/lib/types/interaction_handler/SilentHandler.d.ts.map +1 -1
  387. package/lib/types/packageMetadata.d.ts +1 -1
  388. package/lib/types/protocol/Authorize.d.ts +4 -0
  389. package/lib/types/protocol/Authorize.d.ts.map +1 -1
  390. package/lib/types/request/RequestHelpers.d.ts +11 -1
  391. package/lib/types/request/RequestHelpers.d.ts.map +1 -1
  392. package/package.json +2 -2
  393. package/src/controllers/NestedAppAuthController.ts +18 -2
  394. package/src/custom_auth/CustomAuthActionInputs.ts +3 -0
  395. package/src/custom_auth/controller/CustomAuthStandardController.ts +18 -10
  396. package/src/custom_auth/core/auth_flow/AuthFlowErrorBase.ts +12 -0
  397. package/src/custom_auth/core/network_client/custom_auth_api/SignInApiClient.ts +3 -0
  398. package/src/custom_auth/core/network_client/custom_auth_api/types/ApiRequestTypes.ts +1 -0
  399. package/src/custom_auth/core/utils/ArgumentValidator.ts +22 -0
  400. package/src/custom_auth/get_account/auth_flow/CustomAuthAccountData.ts +24 -9
  401. package/src/custom_auth/sign_in/auth_flow/error_type/SignInError.ts +8 -0
  402. package/src/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.ts +1 -0
  403. package/src/custom_auth/sign_in/auth_flow/state/SignInContinuationState.ts +10 -0
  404. package/src/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.ts +1 -0
  405. package/src/custom_auth/sign_in/auth_flow/state/SignInStateParameters.ts +1 -0
  406. package/src/custom_auth/sign_in/interaction_client/SignInClient.ts +9 -0
  407. package/src/custom_auth/sign_in/interaction_client/parameter/SignInParams.ts +3 -0
  408. package/src/interaction_client/PopupClient.ts +161 -63
  409. package/src/interaction_client/RedirectClient.ts +86 -35
  410. package/src/interaction_client/SilentIframeClient.ts +49 -28
  411. package/src/interaction_client/StandardInteractionClient.ts +13 -2
  412. package/src/interaction_handler/SilentHandler.ts +24 -1
  413. package/src/packageMetadata.ts +1 -1
  414. package/src/protocol/Authorize.ts +48 -0
  415. package/src/request/RequestHelpers.ts +45 -0
@@ -90,6 +90,7 @@ export class SignInApiClient extends BaseApiClient {
90
90
  grant_type: GrantType.PASSWORD,
91
91
  scope: params.scope,
92
92
  password: params.password,
93
+ ...(params.claims && { claims: params.claims }),
93
94
  },
94
95
  params.telemetryManager,
95
96
  params.correlationId
@@ -105,6 +106,7 @@ export class SignInApiClient extends BaseApiClient {
105
106
  scope: params.scope,
106
107
  oob: params.oob,
107
108
  grant_type: GrantType.OOB,
109
+ ...(params.claims && { claims: params.claims }),
108
110
  },
109
111
  params.telemetryManager,
110
112
  params.correlationId
@@ -121,6 +123,7 @@ export class SignInApiClient extends BaseApiClient {
121
123
  scope: params.scope,
122
124
  grant_type: GrantType.CONTINUATION_TOKEN,
123
125
  client_info: true,
126
+ ...(params.claims && { claims: params.claims }),
124
127
  },
125
128
  params.telemetryManager,
126
129
  params.correlationId
@@ -19,6 +19,7 @@ export interface SignInChallengeRequest extends ApiRequestBase {
19
19
  interface SignInTokenRequestBase extends ApiRequestBase {
20
20
  continuation_token: string;
21
21
  scope: string;
22
+ claims?: string;
22
23
  }
23
24
 
24
25
  export interface SignInPasswordTokenRequest extends SignInTokenRequestBase {
@@ -24,3 +24,25 @@ export function ensureArgumentIsNotEmptyString(
24
24
  throw new InvalidArgumentError(argName, correlationId);
25
25
  }
26
26
  }
27
+
28
+ export function ensureArgumentIsJSONString(
29
+ argName: string,
30
+ argValue: string,
31
+ correlationId?: string
32
+ ): void {
33
+ try {
34
+ const parsed = JSON.parse(argValue);
35
+ if (
36
+ typeof parsed !== "object" ||
37
+ parsed === null ||
38
+ Array.isArray(parsed)
39
+ ) {
40
+ throw new InvalidArgumentError(argName, correlationId);
41
+ }
42
+ } catch (e) {
43
+ if (e instanceof SyntaxError) {
44
+ throw new InvalidArgumentError(argName, correlationId);
45
+ }
46
+ throw e; // Rethrow unexpected errors
47
+ }
48
+ }
@@ -18,10 +18,7 @@ import {
18
18
  TokenClaims,
19
19
  } from "@azure/msal-common/browser";
20
20
  import { SilentRequest } from "../../../request/SilentRequest.js";
21
- import {
22
- ensureArgumentIsNotEmptyString,
23
- ensureArgumentIsNotNullOrUndefined,
24
- } from "../../core/utils/ArgumentValidator.js";
21
+ import * as ArgumentValidator from "../../core/utils/ArgumentValidator.js";
25
22
 
26
23
  /*
27
24
  * Account information.
@@ -34,8 +31,15 @@ export class CustomAuthAccountData {
34
31
  private readonly logger: Logger,
35
32
  private readonly correlationId: string
36
33
  ) {
37
- ensureArgumentIsNotEmptyString("correlationId", correlationId);
38
- ensureArgumentIsNotNullOrUndefined("account", account, correlationId);
34
+ ArgumentValidator.ensureArgumentIsNotEmptyString(
35
+ "correlationId",
36
+ correlationId
37
+ );
38
+ ArgumentValidator.ensureArgumentIsNotNullOrUndefined(
39
+ "account",
40
+ account,
41
+ correlationId
42
+ );
39
43
  }
40
44
 
41
45
  /**
@@ -107,12 +111,20 @@ export class CustomAuthAccountData {
107
111
  accessTokenRetrievalInputs: AccessTokenRetrievalInputs
108
112
  ): Promise<GetAccessTokenResult> {
109
113
  try {
110
- ensureArgumentIsNotNullOrUndefined(
114
+ ArgumentValidator.ensureArgumentIsNotNullOrUndefined(
111
115
  "accessTokenRetrievalInputs",
112
116
  accessTokenRetrievalInputs,
113
117
  this.correlationId
114
118
  );
115
119
 
120
+ if (accessTokenRetrievalInputs.claims) {
121
+ ArgumentValidator.ensureArgumentIsJSONString(
122
+ "accessTokenRetrievalInputs.claims",
123
+ accessTokenRetrievalInputs.claims,
124
+ this.correlationId
125
+ );
126
+ }
127
+
116
128
  this.logger.verbose("Getting current account.", this.correlationId);
117
129
 
118
130
  const currentAccount = this.cacheClient.getCurrentAccount(
@@ -133,7 +145,8 @@ export class CustomAuthAccountData {
133
145
  const commonSilentFlowRequest = this.createCommonSilentFlowRequest(
134
146
  currentAccount,
135
147
  accessTokenRetrievalInputs.forceRefresh,
136
- newScopes
148
+ newScopes,
149
+ accessTokenRetrievalInputs.claims
137
150
  );
138
151
  const result = await this.cacheClient.acquireToken(
139
152
  commonSilentFlowRequest
@@ -158,7 +171,8 @@ export class CustomAuthAccountData {
158
171
  private createCommonSilentFlowRequest(
159
172
  accountInfo: AccountInfo,
160
173
  forceRefresh: boolean = false,
161
- requestScopes: Array<string>
174
+ requestScopes: Array<string>,
175
+ claims?: string
162
176
  ): CommonSilentFlowRequest {
163
177
  const silentRequest: SilentRequest = {
164
178
  authority: this.config.auth.authority,
@@ -171,6 +185,7 @@ export class CustomAuthAccountData {
171
185
  accessToken: true,
172
186
  refreshToken: true,
173
187
  },
188
+ ...(claims && { claims: claims }),
174
189
  };
175
190
 
176
191
  return {
@@ -31,6 +31,14 @@ export class SignInError extends AuthActionErrorBase {
31
31
  return this.isPasswordIncorrectError();
32
32
  }
33
33
 
34
+ /**
35
+ * Checks if the error is due to password reset being required.
36
+ * @returns true if the error is due to password reset being required, false otherwise.
37
+ */
38
+ isPasswordResetRequired(): boolean {
39
+ return this.isPasswordResetRequiredError();
40
+ }
41
+
34
42
  /**
35
43
  * Checks if the error is due to the provided challenge type is not supported.
36
44
  * @returns {boolean} True if the error is due to the provided challenge type is not supported, false otherwise.
@@ -37,6 +37,7 @@ export class SignInCodeRequiredState extends SignInState<SignInCodeRequiredState
37
37
  continuationToken: this.stateParameters.continuationToken ?? "",
38
38
  code: code,
39
39
  username: this.stateParameters.username,
40
+ claims: this.stateParameters.claims,
40
41
  };
41
42
 
42
43
  this.stateParameters.logger.verbose(
@@ -10,6 +10,7 @@ import { SignInWithContinuationTokenInputs } from "../../../CustomAuthActionInpu
10
10
  import { SignInContinuationStateParameters } from "./SignInStateParameters.js";
11
11
  import { SignInState } from "./SignInState.js";
12
12
  import { SignInCompletedState } from "./SignInCompletedState.js";
13
+ import * as ArgumentValidator from "../../../core/utils/ArgumentValidator.js";
13
14
 
14
15
  /*
15
16
  * Sign-in continuation state.
@@ -24,6 +25,14 @@ export class SignInContinuationState extends SignInState<SignInContinuationState
24
25
  signInWithContinuationTokenInputs?: SignInWithContinuationTokenInputs
25
26
  ): Promise<SignInResult> {
26
27
  try {
28
+ if (signInWithContinuationTokenInputs?.claims) {
29
+ ArgumentValidator.ensureArgumentIsJSONString(
30
+ "signInWithContinuationTokenInputs.claims",
31
+ signInWithContinuationTokenInputs.claims,
32
+ this.stateParameters.correlationId
33
+ );
34
+ }
35
+
27
36
  const continuationTokenParams: SignInContinuationTokenParams = {
28
37
  clientId: this.stateParameters.config.auth.clientId,
29
38
  correlationId: this.stateParameters.correlationId,
@@ -33,6 +42,7 @@ export class SignInContinuationState extends SignInState<SignInContinuationState
33
42
  continuationToken: this.stateParameters.continuationToken ?? "",
34
43
  username: this.stateParameters.username,
35
44
  signInScenario: this.stateParameters.signInScenario,
45
+ claims: signInWithContinuationTokenInputs?.claims,
36
46
  };
37
47
 
38
48
  this.stateParameters.logger.verbose(
@@ -34,6 +34,7 @@ export class SignInPasswordRequiredState extends SignInState<SignInPasswordRequi
34
34
  continuationToken: this.stateParameters.continuationToken ?? "",
35
35
  password: password,
36
36
  username: this.stateParameters.username,
37
+ claims: this.stateParameters.claims,
37
38
  };
38
39
 
39
40
  this.stateParameters.logger.verbose(
@@ -13,6 +13,7 @@ export interface SignInStateParameters
13
13
  username: string;
14
14
  signInClient: SignInClient;
15
15
  cacheClient: CustomAuthSilentCacheClient;
16
+ claims?: string;
16
17
  }
17
18
 
18
19
  export interface SignInPasswordRequiredStateParameters
@@ -195,6 +195,9 @@ export class SignInClient extends CustomAuthInteractionClientBase {
195
195
  scope: scopes.join(" "),
196
196
  correlationId: parameters.correlationId,
197
197
  telemetryManager: telemetryManager,
198
+ ...(parameters.claims && {
199
+ claims: parameters.claims,
200
+ }),
198
201
  };
199
202
 
200
203
  return this.performTokenRequest(
@@ -230,6 +233,9 @@ export class SignInClient extends CustomAuthInteractionClientBase {
230
233
  scope: scopes.join(" "),
231
234
  correlationId: parameters.correlationId,
232
235
  telemetryManager: telemetryManager,
236
+ ...(parameters.claims && {
237
+ claims: parameters.claims,
238
+ }),
233
239
  };
234
240
 
235
241
  return this.performTokenRequest(
@@ -263,6 +269,9 @@ export class SignInClient extends CustomAuthInteractionClientBase {
263
269
  correlationId: parameters.correlationId,
264
270
  telemetryManager: telemetryManager,
265
271
  scope: scopes.join(" "),
272
+ ...(parameters.claims && {
273
+ claims: parameters.claims,
274
+ }),
266
275
  };
267
276
 
268
277
  // Call token endpoint.
@@ -24,16 +24,19 @@ export interface SignInSubmitCodeParams extends SignInParamsBase {
24
24
  continuationToken: string;
25
25
  code: string;
26
26
  scopes: Array<string>;
27
+ claims?: string;
27
28
  }
28
29
 
29
30
  export interface SignInSubmitPasswordParams extends SignInParamsBase {
30
31
  continuationToken: string;
31
32
  password: string;
32
33
  scopes: Array<string>;
34
+ claims?: string;
33
35
  }
34
36
 
35
37
  export interface SignInContinuationTokenParams extends SignInParamsBase {
36
38
  continuationToken: string;
37
39
  signInScenario: SignInScenarioType;
38
40
  scopes: Array<string>;
41
+ claims?: string;
39
42
  }
@@ -19,6 +19,7 @@ import {
19
19
  invoke,
20
20
  PkceCodes,
21
21
  CommonAuthorizationUrlRequest,
22
+ HttpMethod,
22
23
  } from "@azure/msal-common/browser";
23
24
  import { StandardInteractionClient } from "./StandardInteractionClient.js";
24
25
  import { EventType } from "../event/EventType.js";
@@ -48,6 +49,7 @@ import { generatePkceCodes } from "../crypto/PkceGenerator.js";
48
49
  import { isPlatformAuthAllowed } from "../broker/nativeBroker/PlatformAuthProvider.js";
49
50
  import { generateEarKey } from "../crypto/BrowserCrypto.js";
50
51
  import { IPlatformAuthHandler } from "../broker/nativeBroker/IPlatformAuthHandler.js";
52
+ import { validateRequestMethod } from "../request/RequestHelpers.js";
51
53
 
52
54
  export type PopupParams = {
53
55
  popup?: Window | null;
@@ -98,12 +100,13 @@ export class PopupClient extends StandardInteractionClient {
98
100
  request: PopupRequest,
99
101
  pkceCodes?: PkceCodes
100
102
  ): Promise<AuthenticationResult> {
103
+ let popupParams: PopupParams | undefined = undefined;
101
104
  try {
102
105
  const popupName = this.generatePopupName(
103
106
  request.scopes || OIDC_DEFAULT_SCOPES,
104
107
  request.authority || this.config.auth.authority
105
108
  );
106
- const popupParams: PopupParams = {
109
+ popupParams = {
107
110
  popupName,
108
111
  popupWindowAttributes: request.popupWindowAttributes || {},
109
112
  popupWindowParent: request.popupWindowParent ?? window,
@@ -124,6 +127,14 @@ export class PopupClient extends StandardInteractionClient {
124
127
  pkceCodes
125
128
  );
126
129
  } else {
130
+ // Pre-validate request method to avoid opening popup if the request is invalid
131
+ const validatedRequest: PopupRequest = {
132
+ ...request,
133
+ httpMethod: validateRequestMethod(
134
+ request,
135
+ this.config.auth.protocolMode
136
+ ),
137
+ };
127
138
  // asyncPopups flag is set to false. Opens popup before acquiring token.
128
139
  this.logger.verbose(
129
140
  "asyncPopup set to false, opening popup before acquiring token"
@@ -133,7 +144,7 @@ export class PopupClient extends StandardInteractionClient {
133
144
  popupParams
134
145
  );
135
146
  return this.acquireTokenPopupAsync(
136
- request,
147
+ validatedRequest,
137
148
  popupParams,
138
149
  pkceCodes
139
150
  );
@@ -286,71 +297,80 @@ export class PopupClient extends StandardInteractionClient {
286
297
  account: popupRequest.account,
287
298
  });
288
299
 
289
- // Create acquire token url.
290
- const navigateUrl = await invokeAsync(
291
- Authorize.getAuthCodeRequestUrl,
292
- PerformanceEvents.GetAuthCodeUrl,
293
- this.logger,
294
- this.performanceClient,
295
- correlationId
296
- )(
297
- this.config,
298
- authClient.authority,
299
- popupRequest,
300
- this.logger,
301
- this.performanceClient
302
- );
300
+ if (popupRequest.httpMethod === HttpMethod.POST) {
301
+ return await this.executeCodeFlowWithPost(
302
+ popupRequest,
303
+ popupParams,
304
+ authClient,
305
+ pkce.verifier
306
+ );
307
+ } else {
308
+ // Create acquire token url.
309
+ const navigateUrl = await invokeAsync(
310
+ Authorize.getAuthCodeRequestUrl,
311
+ PerformanceEvents.GetAuthCodeUrl,
312
+ this.logger,
313
+ this.performanceClient,
314
+ correlationId
315
+ )(
316
+ this.config,
317
+ authClient.authority,
318
+ popupRequest,
319
+ this.logger,
320
+ this.performanceClient
321
+ );
303
322
 
304
- // Show the UI once the url has been created. Get the window handle for the popup.
305
- const popupWindow: Window = this.initiateAuthRequest(
306
- navigateUrl,
307
- popupParams
308
- );
309
- this.eventHandler.emitEvent(
310
- EventType.POPUP_OPENED,
311
- InteractionType.Popup,
312
- { popupWindow },
313
- null
314
- );
323
+ // Show the UI once the url has been created. Get the window handle for the popup.
324
+ const popupWindow: Window = this.initiateAuthRequest(
325
+ navigateUrl,
326
+ popupParams
327
+ );
328
+ this.eventHandler.emitEvent(
329
+ EventType.POPUP_OPENED,
330
+ InteractionType.Popup,
331
+ { popupWindow },
332
+ null
333
+ );
315
334
 
316
- // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
317
- const responseString = await this.monitorPopupForHash(
318
- popupWindow,
319
- popupParams.popupWindowParent
320
- );
335
+ // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
336
+ const responseString = await this.monitorPopupForHash(
337
+ popupWindow,
338
+ popupParams.popupWindowParent
339
+ );
321
340
 
322
- const serverParams = invoke(
323
- ResponseHandler.deserializeResponse,
324
- PerformanceEvents.DeserializeResponse,
325
- this.logger,
326
- this.performanceClient,
327
- this.correlationId
328
- )(
329
- responseString,
330
- this.config.auth.OIDCOptions.serverResponseType,
331
- this.logger
332
- );
341
+ const serverParams = invoke(
342
+ ResponseHandler.deserializeResponse,
343
+ PerformanceEvents.DeserializeResponse,
344
+ this.logger,
345
+ this.performanceClient,
346
+ this.correlationId
347
+ )(
348
+ responseString,
349
+ this.config.auth.OIDCOptions.serverResponseType,
350
+ this.logger
351
+ );
333
352
 
334
- return await invokeAsync(
335
- Authorize.handleResponseCode,
336
- PerformanceEvents.HandleResponseCode,
337
- this.logger,
338
- this.performanceClient,
339
- correlationId
340
- )(
341
- request,
342
- serverParams,
343
- pkce.verifier,
344
- ApiId.acquireTokenPopup,
345
- this.config,
346
- authClient,
347
- this.browserStorage,
348
- this.nativeStorage,
349
- this.eventHandler,
350
- this.logger,
351
- this.performanceClient,
352
- this.platformAuthProvider
353
- );
353
+ return await invokeAsync(
354
+ Authorize.handleResponseCode,
355
+ PerformanceEvents.HandleResponseCode,
356
+ this.logger,
357
+ this.performanceClient,
358
+ correlationId
359
+ )(
360
+ request,
361
+ serverParams,
362
+ pkce.verifier,
363
+ ApiId.acquireTokenPopup,
364
+ this.config,
365
+ authClient,
366
+ this.browserStorage,
367
+ this.nativeStorage,
368
+ this.eventHandler,
369
+ this.logger,
370
+ this.performanceClient,
371
+ this.platformAuthProvider
372
+ );
373
+ }
354
374
  } catch (e) {
355
375
  // Close the synchronous popup if an error is thrown before the window unload event is registered
356
376
  popupParams.popup?.close();
@@ -452,6 +472,84 @@ export class PopupClient extends StandardInteractionClient {
452
472
  );
453
473
  }
454
474
 
475
+ async executeCodeFlowWithPost(
476
+ request: CommonAuthorizationUrlRequest,
477
+ popupParams: PopupParams,
478
+ authClient: AuthorizationCodeClient,
479
+ pkceVerifier: string
480
+ ): Promise<AuthenticationResult> {
481
+ const correlationId = request.correlationId;
482
+ // Get the frame handle for the silent request
483
+ const discoveredAuthority = await invokeAsync(
484
+ this.getDiscoveredAuthority.bind(this),
485
+ PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority,
486
+ this.logger,
487
+ this.performanceClient,
488
+ correlationId
489
+ )({
490
+ requestAuthority: request.authority,
491
+ requestAzureCloudOptions: request.azureCloudOptions,
492
+ requestExtraQueryParameters: request.extraQueryParameters,
493
+ account: request.account,
494
+ });
495
+
496
+ const popupWindow =
497
+ popupParams.popup || this.openPopup("about:blank", popupParams);
498
+
499
+ const form = await Authorize.getCodeForm(
500
+ popupWindow.document,
501
+ this.config,
502
+ discoveredAuthority,
503
+ request,
504
+ this.logger,
505
+ this.performanceClient
506
+ );
507
+
508
+ form.submit();
509
+
510
+ // Monitor the popup for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
511
+ const responseString = await invokeAsync(
512
+ this.monitorPopupForHash.bind(this),
513
+ PerformanceEvents.SilentHandlerMonitorIframeForHash,
514
+ this.logger,
515
+ this.performanceClient,
516
+ correlationId
517
+ )(popupWindow, popupParams.popupWindowParent);
518
+
519
+ const serverParams = invoke(
520
+ ResponseHandler.deserializeResponse,
521
+ PerformanceEvents.DeserializeResponse,
522
+ this.logger,
523
+ this.performanceClient,
524
+ this.correlationId
525
+ )(
526
+ responseString,
527
+ this.config.auth.OIDCOptions.serverResponseType,
528
+ this.logger
529
+ );
530
+
531
+ return invokeAsync(
532
+ Authorize.handleResponseCode,
533
+ PerformanceEvents.HandleResponseCode,
534
+ this.logger,
535
+ this.performanceClient,
536
+ correlationId
537
+ )(
538
+ request,
539
+ serverParams,
540
+ pkceVerifier,
541
+ ApiId.acquireTokenPopup,
542
+ this.config,
543
+ authClient,
544
+ this.browserStorage,
545
+ this.nativeStorage,
546
+ this.eventHandler,
547
+ this.logger,
548
+ this.performanceClient,
549
+ this.platformAuthProvider
550
+ );
551
+ }
552
+
455
553
  /**
456
554
  *
457
555
  * @param validRequest