@azure/msal-browser 4.27.0 → 4.28.1

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 (376) 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.d.ts +3 -3
  11. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  12. package/dist/cache/BrowserCacheManager.mjs +12 -8
  13. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  14. package/dist/cache/CacheHelpers.mjs +1 -1
  15. package/dist/cache/CacheKeys.mjs +1 -1
  16. package/dist/cache/CookieStorage.mjs +1 -1
  17. package/dist/cache/DatabaseStorage.mjs +1 -1
  18. package/dist/cache/EncryptedData.mjs +1 -1
  19. package/dist/cache/LocalStorage.mjs +1 -1
  20. package/dist/cache/MemoryStorage.mjs +1 -1
  21. package/dist/cache/SessionStorage.mjs +1 -1
  22. package/dist/cache/TokenCache.d.ts +3 -2
  23. package/dist/cache/TokenCache.d.ts.map +1 -1
  24. package/dist/cache/TokenCache.mjs +50 -35
  25. package/dist/cache/TokenCache.mjs.map +1 -1
  26. package/dist/config/Configuration.mjs +1 -1
  27. package/dist/controllers/ControllerFactory.mjs +1 -1
  28. package/dist/controllers/NestedAppAuthController.d.ts.map +1 -1
  29. package/dist/controllers/NestedAppAuthController.mjs +3 -3
  30. package/dist/controllers/NestedAppAuthController.mjs.map +1 -1
  31. package/dist/controllers/StandardController.d.ts.map +1 -1
  32. package/dist/controllers/StandardController.mjs +3 -3
  33. package/dist/controllers/StandardController.mjs.map +1 -1
  34. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  35. package/dist/crypto/BrowserCrypto.mjs +1 -1
  36. package/dist/crypto/CryptoOps.mjs +1 -1
  37. package/dist/crypto/PkceGenerator.mjs +1 -1
  38. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  39. package/dist/custom-auth-path/app/PublicClientApplication.mjs +1 -1
  40. package/dist/custom-auth-path/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  41. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  42. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  43. package/dist/custom-auth-path/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  44. package/dist/custom-auth-path/cache/AccountManager.mjs +1 -1
  45. package/dist/custom-auth-path/cache/AsyncMemoryStorage.mjs +1 -1
  46. package/dist/custom-auth-path/cache/BrowserCacheManager.d.ts +3 -3
  47. package/dist/custom-auth-path/cache/BrowserCacheManager.d.ts.map +1 -1
  48. package/dist/custom-auth-path/cache/BrowserCacheManager.mjs +12 -8
  49. package/dist/custom-auth-path/cache/BrowserCacheManager.mjs.map +1 -1
  50. package/dist/custom-auth-path/cache/CacheHelpers.mjs +1 -1
  51. package/dist/custom-auth-path/cache/CacheKeys.mjs +1 -1
  52. package/dist/custom-auth-path/cache/CookieStorage.mjs +1 -1
  53. package/dist/custom-auth-path/cache/DatabaseStorage.mjs +1 -1
  54. package/dist/custom-auth-path/cache/EncryptedData.mjs +1 -1
  55. package/dist/custom-auth-path/cache/LocalStorage.mjs +1 -1
  56. package/dist/custom-auth-path/cache/MemoryStorage.mjs +1 -1
  57. package/dist/custom-auth-path/cache/SessionStorage.mjs +1 -1
  58. package/dist/custom-auth-path/cache/TokenCache.d.ts +3 -2
  59. package/dist/custom-auth-path/cache/TokenCache.d.ts.map +1 -1
  60. package/dist/custom-auth-path/cache/TokenCache.mjs +50 -35
  61. package/dist/custom-auth-path/cache/TokenCache.mjs.map +1 -1
  62. package/dist/custom-auth-path/config/Configuration.mjs +1 -1
  63. package/dist/custom-auth-path/controllers/ControllerFactory.mjs +1 -1
  64. package/dist/custom-auth-path/controllers/NestedAppAuthController.d.ts.map +1 -1
  65. package/dist/custom-auth-path/controllers/StandardController.d.ts.map +1 -1
  66. package/dist/custom-auth-path/controllers/StandardController.mjs +3 -3
  67. package/dist/custom-auth-path/controllers/StandardController.mjs.map +1 -1
  68. package/dist/custom-auth-path/crypto/BrowserCrypto.mjs +1 -1
  69. package/dist/custom-auth-path/crypto/CryptoOps.mjs +1 -1
  70. package/dist/custom-auth-path/crypto/PkceGenerator.mjs +1 -1
  71. package/dist/custom-auth-path/custom_auth/CustomAuthConstants.d.ts +1 -1
  72. package/dist/custom-auth-path/custom_auth/CustomAuthConstants.mjs +1 -1
  73. package/dist/custom-auth-path/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  74. package/dist/custom-auth-path/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  75. package/dist/custom-auth-path/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  76. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  77. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  78. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  79. package/dist/custom-auth-path/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  80. package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  81. package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  82. package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  83. package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  84. package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  85. package/dist/custom-auth-path/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  86. package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  87. package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  88. package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  89. package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  90. package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  91. package/dist/custom-auth-path/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  92. package/dist/custom-auth-path/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  93. package/dist/custom-auth-path/custom_auth/core/error/CustomAuthError.mjs +1 -1
  94. package/dist/custom-auth-path/custom_auth/core/error/HttpError.mjs +1 -1
  95. package/dist/custom-auth-path/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  96. package/dist/custom-auth-path/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  97. package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  98. package/dist/custom-auth-path/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  99. package/dist/custom-auth-path/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  100. package/dist/custom-auth-path/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  101. package/dist/custom-auth-path/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  102. package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  103. package/dist/custom-auth-path/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  104. package/dist/custom-auth-path/custom_auth/core/error/UnexpectedError.mjs +1 -1
  105. package/dist/custom-auth-path/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  106. package/dist/custom-auth-path/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  107. package/dist/custom-auth-path/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  108. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts +1 -1
  109. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts.map +1 -1
  110. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +3 -3
  111. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs.map +1 -1
  112. package/dist/custom-auth-path/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  113. package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -1
  114. package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/JitClient.mjs +2 -2
  115. package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/JitClient.mjs.map +1 -1
  116. package/dist/custom-auth-path/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  117. package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -1
  118. package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/MfaClient.mjs +2 -2
  119. package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/MfaClient.mjs.map +1 -1
  120. package/dist/custom-auth-path/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  121. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  122. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  123. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  124. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  125. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  126. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  127. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  128. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  129. package/dist/custom-auth-path/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  130. package/dist/custom-auth-path/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  131. package/dist/custom-auth-path/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  132. package/dist/custom-auth-path/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  133. package/dist/custom-auth-path/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  134. package/dist/custom-auth-path/custom_auth/core/utils/UrlUtils.mjs +1 -1
  135. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  136. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  137. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  138. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  139. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  140. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  141. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  142. package/dist/custom-auth-path/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  143. package/dist/custom-auth-path/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  144. package/dist/custom-auth-path/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +2 -2
  145. package/dist/custom-auth-path/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
  146. package/dist/custom-auth-path/custom_auth/index.mjs +1 -1
  147. package/dist/custom-auth-path/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  148. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  149. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  150. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  151. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  152. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  153. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  154. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  155. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  156. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  157. package/dist/custom-auth-path/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  158. package/dist/custom-auth-path/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  159. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  160. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  161. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  162. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  163. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  164. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  165. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  166. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  167. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  168. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  169. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  170. package/dist/custom-auth-path/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  171. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
  172. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.mjs +6 -6
  173. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/SignInClient.mjs.map +1 -1
  174. package/dist/custom-auth-path/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  175. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  176. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  177. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  178. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  179. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  180. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  181. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  182. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  183. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  184. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  185. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  186. package/dist/custom-auth-path/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  187. package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  188. package/dist/custom-auth-path/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  189. package/dist/custom-auth-path/encode/Base64Decode.mjs +1 -1
  190. package/dist/custom-auth-path/encode/Base64Encode.mjs +1 -1
  191. package/dist/custom-auth-path/error/BrowserAuthError.mjs +1 -1
  192. package/dist/custom-auth-path/error/BrowserAuthErrorCodes.mjs +1 -1
  193. package/dist/custom-auth-path/error/BrowserConfigurationAuthError.mjs +1 -1
  194. package/dist/custom-auth-path/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  195. package/dist/custom-auth-path/error/NativeAuthError.mjs +1 -1
  196. package/dist/custom-auth-path/error/NativeAuthErrorCodes.mjs +1 -1
  197. package/dist/custom-auth-path/event/EventHandler.mjs +1 -1
  198. package/dist/custom-auth-path/event/EventType.mjs +1 -1
  199. package/dist/custom-auth-path/interaction_client/BaseInteractionClient.mjs +1 -1
  200. package/dist/custom-auth-path/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  201. package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  202. package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.mjs +3 -3
  203. package/dist/custom-auth-path/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  204. package/dist/custom-auth-path/interaction_client/PopupClient.mjs +1 -1
  205. package/dist/custom-auth-path/interaction_client/RedirectClient.mjs +1 -1
  206. package/dist/custom-auth-path/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  207. package/dist/custom-auth-path/interaction_client/SilentAuthCodeClient.mjs +2 -2
  208. package/dist/custom-auth-path/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  209. package/dist/custom-auth-path/interaction_client/SilentCacheClient.mjs +1 -1
  210. package/dist/custom-auth-path/interaction_client/SilentIframeClient.mjs +1 -1
  211. package/dist/custom-auth-path/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  212. package/dist/custom-auth-path/interaction_client/SilentRefreshClient.mjs +2 -2
  213. package/dist/custom-auth-path/interaction_client/SilentRefreshClient.mjs.map +1 -1
  214. package/dist/custom-auth-path/interaction_client/StandardInteractionClient.mjs +1 -1
  215. package/dist/custom-auth-path/interaction_handler/InteractionHandler.d.ts +3 -2
  216. package/dist/custom-auth-path/interaction_handler/InteractionHandler.d.ts.map +1 -1
  217. package/dist/custom-auth-path/interaction_handler/InteractionHandler.mjs +5 -5
  218. package/dist/custom-auth-path/interaction_handler/InteractionHandler.mjs.map +1 -1
  219. package/dist/custom-auth-path/interaction_handler/SilentHandler.mjs +1 -1
  220. package/dist/custom-auth-path/navigation/NavigationClient.mjs +1 -1
  221. package/dist/custom-auth-path/network/FetchClient.mjs +1 -1
  222. package/dist/custom-auth-path/operatingcontext/BaseOperatingContext.mjs +1 -1
  223. package/dist/custom-auth-path/operatingcontext/StandardOperatingContext.mjs +1 -1
  224. package/dist/custom-auth-path/packageMetadata.d.ts +1 -1
  225. package/dist/custom-auth-path/packageMetadata.mjs +2 -2
  226. package/dist/custom-auth-path/protocol/Authorize.d.ts.map +1 -1
  227. package/dist/custom-auth-path/protocol/Authorize.mjs +3 -3
  228. package/dist/custom-auth-path/protocol/Authorize.mjs.map +1 -1
  229. package/dist/custom-auth-path/request/RequestHelpers.mjs +1 -1
  230. package/dist/custom-auth-path/response/ResponseHandler.mjs +1 -1
  231. package/dist/custom-auth-path/utils/BrowserConstants.d.ts +20 -1
  232. package/dist/custom-auth-path/utils/BrowserConstants.d.ts.map +1 -1
  233. package/dist/custom-auth-path/utils/BrowserConstants.mjs +27 -3
  234. package/dist/custom-auth-path/utils/BrowserConstants.mjs.map +1 -1
  235. package/dist/custom-auth-path/utils/BrowserProtocolUtils.mjs +1 -1
  236. package/dist/custom-auth-path/utils/BrowserUtils.mjs +1 -1
  237. package/dist/custom-auth-path/utils/Helpers.mjs +1 -1
  238. package/dist/custom-auth-path/utils/MsalFrameStatsUtils.mjs +1 -1
  239. package/dist/custom_auth/CustomAuthConstants.d.ts +1 -1
  240. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts +1 -1
  241. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts.map +1 -1
  242. package/dist/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -1
  243. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -1
  244. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  245. package/dist/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
  246. package/dist/encode/Base64Decode.mjs +1 -1
  247. package/dist/encode/Base64Encode.mjs +1 -1
  248. package/dist/error/BrowserAuthError.mjs +1 -1
  249. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  250. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  251. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  252. package/dist/error/NativeAuthError.mjs +1 -1
  253. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  254. package/dist/error/NestedAppAuthError.mjs +1 -1
  255. package/dist/event/EventHandler.mjs +1 -1
  256. package/dist/event/EventMessage.mjs +1 -1
  257. package/dist/event/EventType.mjs +1 -1
  258. package/dist/index.mjs +1 -1
  259. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  260. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  261. package/dist/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  262. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +3 -3
  263. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  264. package/dist/interaction_client/PopupClient.mjs +1 -1
  265. package/dist/interaction_client/RedirectClient.mjs +1 -1
  266. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  267. package/dist/interaction_client/SilentAuthCodeClient.mjs +2 -2
  268. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  269. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  270. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  271. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  272. package/dist/interaction_client/SilentRefreshClient.mjs +2 -2
  273. package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
  274. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  275. package/dist/interaction_handler/InteractionHandler.d.ts +3 -2
  276. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  277. package/dist/interaction_handler/InteractionHandler.mjs +5 -5
  278. package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
  279. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  280. package/dist/naa/BridgeError.mjs +1 -1
  281. package/dist/naa/BridgeProxy.mjs +1 -1
  282. package/dist/naa/BridgeStatusCode.mjs +1 -1
  283. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  284. package/dist/navigation/NavigationClient.mjs +1 -1
  285. package/dist/network/FetchClient.mjs +1 -1
  286. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  287. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  288. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  289. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  290. package/dist/packageMetadata.d.ts +1 -1
  291. package/dist/packageMetadata.mjs +2 -2
  292. package/dist/protocol/Authorize.d.ts.map +1 -1
  293. package/dist/protocol/Authorize.mjs +3 -3
  294. package/dist/protocol/Authorize.mjs.map +1 -1
  295. package/dist/request/RequestHelpers.mjs +1 -1
  296. package/dist/response/ResponseHandler.mjs +1 -1
  297. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  298. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  299. package/dist/utils/BrowserConstants.d.ts +20 -1
  300. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  301. package/dist/utils/BrowserConstants.mjs +27 -3
  302. package/dist/utils/BrowserConstants.mjs.map +1 -1
  303. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  304. package/dist/utils/BrowserUtils.mjs +1 -1
  305. package/dist/utils/Helpers.mjs +1 -1
  306. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  307. package/lib/custom-auth-path/msal-custom-auth.cjs +227 -153
  308. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  309. package/lib/custom-auth-path/msal-custom-auth.js +22632 -0
  310. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -0
  311. package/lib/custom-auth-path/types/cache/BrowserCacheManager.d.ts +3 -3
  312. package/lib/custom-auth-path/types/cache/BrowserCacheManager.d.ts.map +1 -1
  313. package/lib/custom-auth-path/types/cache/TokenCache.d.ts +3 -2
  314. package/lib/custom-auth-path/types/cache/TokenCache.d.ts.map +1 -1
  315. package/lib/custom-auth-path/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  316. package/lib/custom-auth-path/types/controllers/StandardController.d.ts.map +1 -1
  317. package/lib/custom-auth-path/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  318. package/lib/custom-auth-path/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts +1 -1
  319. package/lib/custom-auth-path/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts.map +1 -1
  320. package/lib/custom-auth-path/types/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -1
  321. package/lib/custom-auth-path/types/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -1
  322. package/lib/custom-auth-path/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  323. package/lib/custom-auth-path/types/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
  324. package/lib/custom-auth-path/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  325. package/lib/custom-auth-path/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  326. package/lib/custom-auth-path/types/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  327. package/lib/custom-auth-path/types/interaction_handler/InteractionHandler.d.ts +3 -2
  328. package/lib/custom-auth-path/types/interaction_handler/InteractionHandler.d.ts.map +1 -1
  329. package/lib/custom-auth-path/types/packageMetadata.d.ts +1 -1
  330. package/lib/custom-auth-path/types/protocol/Authorize.d.ts.map +1 -1
  331. package/lib/custom-auth-path/types/utils/BrowserConstants.d.ts +20 -1
  332. package/lib/custom-auth-path/types/utils/BrowserConstants.d.ts.map +1 -1
  333. package/lib/msal-browser.cjs +220 -146
  334. package/lib/msal-browser.cjs.map +1 -1
  335. package/lib/msal-browser.js +220 -146
  336. package/lib/msal-browser.js.map +1 -1
  337. package/lib/msal-browser.min.js +63 -63
  338. package/lib/types/cache/BrowserCacheManager.d.ts +3 -3
  339. package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
  340. package/lib/types/cache/TokenCache.d.ts +3 -2
  341. package/lib/types/cache/TokenCache.d.ts.map +1 -1
  342. package/lib/types/controllers/NestedAppAuthController.d.ts.map +1 -1
  343. package/lib/types/controllers/StandardController.d.ts.map +1 -1
  344. package/lib/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  345. package/lib/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts +1 -1
  346. package/lib/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts.map +1 -1
  347. package/lib/types/custom_auth/core/interaction_client/jit/JitClient.d.ts.map +1 -1
  348. package/lib/types/custom_auth/core/interaction_client/mfa/MfaClient.d.ts.map +1 -1
  349. package/lib/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  350. package/lib/types/custom_auth/sign_in/interaction_client/SignInClient.d.ts.map +1 -1
  351. package/lib/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  352. package/lib/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  353. package/lib/types/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  354. package/lib/types/interaction_handler/InteractionHandler.d.ts +3 -2
  355. package/lib/types/interaction_handler/InteractionHandler.d.ts.map +1 -1
  356. package/lib/types/packageMetadata.d.ts +1 -1
  357. package/lib/types/protocol/Authorize.d.ts.map +1 -1
  358. package/lib/types/utils/BrowserConstants.d.ts +20 -1
  359. package/lib/types/utils/BrowserConstants.d.ts.map +1 -1
  360. package/package.json +2 -2
  361. package/src/cache/BrowserCacheManager.ts +19 -5
  362. package/src/cache/TokenCache.ts +142 -80
  363. package/src/controllers/NestedAppAuthController.ts +2 -1
  364. package/src/controllers/StandardController.ts +4 -2
  365. package/src/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.ts +4 -2
  366. package/src/custom_auth/core/interaction_client/jit/JitClient.ts +2 -1
  367. package/src/custom_auth/core/interaction_client/mfa/MfaClient.ts +2 -1
  368. package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +2 -1
  369. package/src/custom_auth/sign_in/interaction_client/SignInClient.ts +10 -5
  370. package/src/interaction_client/PlatformAuthInteractionClient.ts +3 -1
  371. package/src/interaction_client/SilentAuthCodeClient.ts +1 -0
  372. package/src/interaction_client/SilentRefreshClient.ts +7 -5
  373. package/src/interaction_handler/InteractionHandler.ts +10 -3
  374. package/src/packageMetadata.ts +1 -1
  375. package/src/protocol/Authorize.ts +2 -1
  376. package/src/utils/BrowserConstants.ts +27 -1
@@ -10,6 +10,7 @@ import {
10
10
  Logger,
11
11
  ScopeSet,
12
12
  Authority,
13
+ AuthorityFactory,
13
14
  AuthorityOptions,
14
15
  ExternalTokenResponse,
15
16
  AccountEntity,
@@ -20,6 +21,9 @@ import {
20
21
  CacheHelpers,
21
22
  buildAccountToCache,
22
23
  TimeUtils,
24
+ IPerformanceClient,
25
+ PerformanceEvents,
26
+ invokeAsync,
23
27
  } from "@azure/msal-common/browser";
24
28
  import { BrowserConfiguration } from "../config/Configuration.js";
25
29
  import type { SilentRequest } from "../request/SilentRequest.js";
@@ -32,6 +36,7 @@ import {
32
36
  import type { AuthenticationResult } from "../response/AuthenticationResult.js";
33
37
  import { base64Decode } from "../encode/Base64Decode.js";
34
38
  import * as BrowserCrypto from "../crypto/BrowserCrypto.js";
39
+ import { ApiId } from "../utils/BrowserConstants.js";
35
40
 
36
41
  export type LoadTokenOptions = {
37
42
  clientInfo?: string;
@@ -53,18 +58,22 @@ export class TokenCache implements ITokenCache {
53
58
  private logger: Logger;
54
59
  // Crypto class
55
60
  private cryptoObj: ICrypto;
61
+ // Perf client
62
+ private performanceClient: IPerformanceClient;
56
63
 
57
64
  constructor(
58
65
  configuration: BrowserConfiguration,
59
66
  storage: BrowserCacheManager,
60
67
  logger: Logger,
61
- cryptoObj: ICrypto
68
+ cryptoObj: ICrypto,
69
+ performanceClient: IPerformanceClient
62
70
  ) {
63
71
  this.isBrowserEnvironment = typeof window !== "undefined";
64
72
  this.config = configuration;
65
73
  this.storage = storage;
66
74
  this.logger = logger;
67
75
  this.cryptoObj = cryptoObj;
76
+ this.performanceClient = performanceClient;
68
77
  }
69
78
 
70
79
  // Move getAllAccounts here and cache utility APIs
@@ -90,80 +99,121 @@ export class TokenCache implements ITokenCache {
90
99
  const correlationId =
91
100
  request.correlationId || BrowserCrypto.createNewGuid();
92
101
 
93
- const idTokenClaims = response.id_token
94
- ? AuthToken.extractTokenClaims(response.id_token, base64Decode)
95
- : undefined;
96
- const kmsi = AuthToken.isKmsi(idTokenClaims || {});
97
-
98
- const authorityOptions: AuthorityOptions = {
99
- protocolMode: this.config.auth.protocolMode,
100
- knownAuthorities: this.config.auth.knownAuthorities,
101
- cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
102
- authorityMetadata: this.config.auth.authorityMetadata,
103
- skipAuthorityMetadataCache:
104
- this.config.auth.skipAuthorityMetadataCache,
105
- };
106
- const authority = request.authority
107
- ? new Authority(
108
- Authority.generateAuthority(
109
- request.authority,
110
- request.azureCloudOptions
111
- ),
112
- this.config.system.networkClient,
113
- this.storage,
114
- authorityOptions,
115
- this.logger,
116
- request.correlationId || BrowserCrypto.createNewGuid()
117
- )
118
- : undefined;
119
-
120
- const cacheRecordAccount: AccountEntity = await this.loadAccount(
121
- request,
122
- options.clientInfo || response.client_info || "",
123
- correlationId,
124
- idTokenClaims,
125
- authority
102
+ const rootMeasurement = this.performanceClient.startMeasurement(
103
+ PerformanceEvents.LoadExternalTokens,
104
+ correlationId
126
105
  );
127
106
 
128
- const idToken = await this.loadIdToken(
129
- response,
130
- cacheRecordAccount.homeAccountId,
131
- cacheRecordAccount.environment,
132
- cacheRecordAccount.realm,
133
- correlationId,
134
- kmsi
135
- );
107
+ try {
108
+ const idTokenClaims = response.id_token
109
+ ? AuthToken.extractTokenClaims(response.id_token, base64Decode)
110
+ : undefined;
111
+ const kmsi = AuthToken.isKmsi(idTokenClaims || {});
112
+
113
+ const authorityOptions: AuthorityOptions = {
114
+ protocolMode: this.config.auth.protocolMode,
115
+ knownAuthorities: this.config.auth.knownAuthorities,
116
+ cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
117
+ authorityMetadata: this.config.auth.authorityMetadata,
118
+ skipAuthorityMetadataCache:
119
+ this.config.auth.skipAuthorityMetadataCache,
120
+ };
121
+ const authorityString =
122
+ request.authority || this.config.auth.authority;
123
+ const authority = await AuthorityFactory.createDiscoveredInstance(
124
+ Authority.generateAuthority(
125
+ authorityString,
126
+ request.azureCloudOptions
127
+ ),
128
+ this.config.system.networkClient,
129
+ this.storage,
130
+ authorityOptions,
131
+ this.logger,
132
+ correlationId,
133
+ this.performanceClient
134
+ );
136
135
 
137
- const accessToken = await this.loadAccessToken(
138
- request,
139
- response,
140
- cacheRecordAccount.homeAccountId,
141
- cacheRecordAccount.environment,
142
- cacheRecordAccount.realm,
143
- options,
144
- correlationId,
145
- kmsi
146
- );
136
+ const cacheRecordAccount: AccountEntity = await invokeAsync(
137
+ this.loadAccount.bind(this),
138
+ PerformanceEvents.LoadAccount,
139
+ this.logger,
140
+ this.performanceClient,
141
+ correlationId
142
+ )(
143
+ request,
144
+ options.clientInfo || response.client_info || "",
145
+ correlationId,
146
+ authority,
147
+ idTokenClaims
148
+ );
147
149
 
148
- const refreshToken = await this.loadRefreshToken(
149
- response,
150
- cacheRecordAccount.homeAccountId,
151
- cacheRecordAccount.environment,
152
- correlationId,
153
- kmsi
154
- );
150
+ const idToken = await invokeAsync(
151
+ this.loadIdToken.bind(this),
152
+ PerformanceEvents.LoadIdToken,
153
+ this.logger,
154
+ this.performanceClient,
155
+ correlationId
156
+ )(
157
+ response,
158
+ cacheRecordAccount.homeAccountId,
159
+ cacheRecordAccount.environment,
160
+ cacheRecordAccount.realm,
161
+ correlationId,
162
+ kmsi
163
+ );
155
164
 
156
- return this.generateAuthenticationResult(
157
- request,
158
- {
159
- account: cacheRecordAccount,
160
- idToken,
161
- accessToken,
162
- refreshToken,
163
- },
164
- idTokenClaims,
165
- authority
166
- );
165
+ const accessToken = await invokeAsync(
166
+ this.loadAccessToken.bind(this),
167
+ PerformanceEvents.LoadAccessToken,
168
+ this.logger,
169
+ this.performanceClient,
170
+ correlationId
171
+ )(
172
+ request,
173
+ response,
174
+ cacheRecordAccount.homeAccountId,
175
+ cacheRecordAccount.environment,
176
+ cacheRecordAccount.realm,
177
+ options,
178
+ correlationId,
179
+ kmsi
180
+ );
181
+
182
+ const refreshToken = await invokeAsync(
183
+ this.loadRefreshToken.bind(this),
184
+ PerformanceEvents.LoadRefreshToken,
185
+ this.logger,
186
+ this.performanceClient,
187
+ correlationId
188
+ )(
189
+ response,
190
+ cacheRecordAccount.homeAccountId,
191
+ cacheRecordAccount.environment,
192
+ correlationId,
193
+ kmsi
194
+ );
195
+
196
+ rootMeasurement.end(
197
+ { success: true },
198
+ undefined,
199
+ AccountEntity.getAccountInfo(cacheRecordAccount)
200
+ );
201
+
202
+ return this.generateAuthenticationResult(
203
+ request,
204
+ {
205
+ account: cacheRecordAccount,
206
+ idToken,
207
+ accessToken,
208
+ refreshToken,
209
+ },
210
+ authority,
211
+ idTokenClaims
212
+ );
213
+ } catch (error) {
214
+ rootMeasurement.end({ success: false }, error);
215
+ throw error;
216
+ }
167
217
  }
168
218
 
169
219
  /**
@@ -179,8 +229,8 @@ export class TokenCache implements ITokenCache {
179
229
  request: SilentRequest,
180
230
  clientInfo: string,
181
231
  correlationId: string,
182
- idTokenClaims?: TokenClaims,
183
- authority?: Authority
232
+ authority: Authority,
233
+ idTokenClaims?: TokenClaims
184
234
  ): Promise<AccountEntity> {
185
235
  this.logger.verbose("TokenCache - loading account");
186
236
 
@@ -191,12 +241,13 @@ export class TokenCache implements ITokenCache {
191
241
  await this.storage.setAccount(
192
242
  accountEntity,
193
243
  correlationId,
194
- AuthToken.isKmsi(idTokenClaims || {})
244
+ AuthToken.isKmsi(idTokenClaims || {}),
245
+ ApiId.loadExternalTokens
195
246
  );
196
247
  return accountEntity;
197
- } else if (!authority || (!clientInfo && !idTokenClaims)) {
248
+ } else if (!clientInfo && !idTokenClaims) {
198
249
  this.logger.error(
199
- "TokenCache - if an account is not provided on the request, authority and either clientInfo or idToken must be provided instead."
250
+ "TokenCache - if an account is not provided on the request, clientInfo or idToken must be provided instead."
200
251
  );
201
252
  throw createBrowserAuthError(
202
253
  BrowserAuthErrorCodes.unableToLoadToken
@@ -221,7 +272,7 @@ export class TokenCache implements ITokenCache {
221
272
  correlationId,
222
273
  idTokenClaims,
223
274
  clientInfo,
224
- authority.hostnameAndPort,
275
+ authority.getPreferredCache(),
225
276
  claimsTenantId,
226
277
  undefined, // authCodePayload
227
278
  undefined, // nativeAccountId
@@ -231,7 +282,8 @@ export class TokenCache implements ITokenCache {
231
282
  await this.storage.setAccount(
232
283
  cachedAccount,
233
284
  correlationId,
234
- AuthToken.isKmsi(idTokenClaims || {})
285
+ AuthToken.isKmsi(idTokenClaims || {}),
286
+ ApiId.loadExternalTokens
235
287
  );
236
288
  return cachedAccount;
237
289
  }
@@ -368,6 +420,16 @@ export class TokenCache implements ITokenCache {
368
420
  return null;
369
421
  }
370
422
 
423
+ const expiresOn = response.refresh_token_expires_in
424
+ ? response.refresh_token_expires_in + TimeUtils.nowSeconds()
425
+ : undefined;
426
+ this.performanceClient.addFields(
427
+ {
428
+ extRtExpiresOnSeconds: expiresOn,
429
+ },
430
+ correlationId
431
+ );
432
+
371
433
  this.logger.verbose("TokenCache - loading refresh token");
372
434
  const refreshTokenEntity = CacheHelpers.createRefreshTokenEntity(
373
435
  homeAccountId,
@@ -376,7 +438,7 @@ export class TokenCache implements ITokenCache {
376
438
  this.config.auth.clientId,
377
439
  response.foci,
378
440
  undefined, // userAssertionHash
379
- response.refresh_token_expires_in
441
+ expiresOn
380
442
  );
381
443
 
382
444
  await this.storage.setRefreshTokenCredential(
@@ -398,8 +460,8 @@ export class TokenCache implements ITokenCache {
398
460
  private generateAuthenticationResult(
399
461
  request: SilentRequest,
400
462
  cacheRecord: CacheRecord & { account: AccountEntity },
401
- idTokenClaims?: TokenClaims,
402
- authority?: Authority
463
+ authority: Authority,
464
+ idTokenClaims?: TokenClaims
403
465
  ): AuthenticationResult {
404
466
  let accessToken: string = "";
405
467
  let responseScopes: Array<string> = [];
@@ -939,7 +939,8 @@ export class NestedAppAuthController implements IController {
939
939
  await this.browserStorage.setAccount(
940
940
  accountEntity,
941
941
  result.correlationId,
942
- AuthToken.isKmsi(result.idTokenClaims)
942
+ AuthToken.isKmsi(result.idTokenClaims),
943
+ ApiId.hydrateCache
943
944
  );
944
945
  return this.browserStorage.hydrateCache(result, request);
945
946
  }
@@ -269,7 +269,8 @@ export class StandardController implements IController {
269
269
  this.config,
270
270
  this.browserStorage,
271
271
  this.logger,
272
- this.browserCrypto
272
+ this.browserCrypto,
273
+ this.performanceClient
273
274
  );
274
275
 
275
276
  this.activeSilentTokenRequests = new Map();
@@ -1627,7 +1628,8 @@ export class StandardController implements IController {
1627
1628
  await this.browserStorage.setAccount(
1628
1629
  accountEntity,
1629
1630
  result.correlationId,
1630
- AuthToken.isKmsi(result.idTokenClaims)
1631
+ AuthToken.isKmsi(result.idTokenClaims),
1632
+ ApiId.hydrateCache
1631
1633
  );
1632
1634
 
1633
1635
  if (result.fromNativeBroker) {
@@ -97,7 +97,8 @@ export abstract class CustomAuthInteractionClientBase extends StandardInteractio
97
97
  protected async handleTokenResponse(
98
98
  tokenResponse: SignInTokenResponse,
99
99
  requestScopes: string[],
100
- correlationId: string
100
+ correlationId: string,
101
+ apiId: number
101
102
  ): Promise<AuthenticationResult> {
102
103
  this.logger.verbose("Processing token response.", correlationId);
103
104
 
@@ -114,7 +115,8 @@ export abstract class CustomAuthInteractionClientBase extends StandardInteractio
114
115
  correlationId:
115
116
  tokenResponse.correlation_id ?? correlationId,
116
117
  scopes: requestScopes,
117
- }
118
+ },
119
+ apiId
118
120
  );
119
121
 
120
122
  return result as AuthenticationResult;
@@ -154,7 +154,8 @@ export class JitClient extends CustomAuthInteractionClientBase {
154
154
  const authResult = await this.handleTokenResponse(
155
155
  tokenResponse,
156
156
  scopes,
157
- tokenResponse.correlation_id || continueResponse.correlation_id
157
+ tokenResponse.correlation_id || continueResponse.correlation_id,
158
+ apiId
158
159
  );
159
160
 
160
161
  return createJitCompletedResult({
@@ -137,7 +137,8 @@ export class MfaClient extends CustomAuthInteractionClientBase {
137
137
  const result = await this.handleTokenResponse(
138
138
  tokenResponse,
139
139
  scopes,
140
- tokenResponse.correlation_id ?? parameters.correlationId
140
+ tokenResponse.correlation_id ?? parameters.correlationId,
141
+ apiId
141
142
  );
142
143
 
143
144
  return createMfaCompletedResult({
@@ -89,7 +89,8 @@ export class CustomAuthSilentCacheClient extends CustomAuthInteractionClientBase
89
89
 
90
90
  const refreshTokenResult =
91
91
  await refreshTokenClient.acquireTokenByRefreshToken(
92
- silentRequest
92
+ silentRequest,
93
+ PublicApiId.ACCOUNT_GET_ACCESS_TOKEN
93
94
  );
94
95
 
95
96
  this.logger.verbose(
@@ -176,7 +176,8 @@ export class SignInClient extends CustomAuthInteractionClientBase {
176
176
  ),
177
177
  scopes,
178
178
  parameters.correlationId,
179
- telemetryManager
179
+ telemetryManager,
180
+ apiId
180
181
  );
181
182
  }
182
183
 
@@ -220,7 +221,8 @@ export class SignInClient extends CustomAuthInteractionClientBase {
220
221
  ),
221
222
  scopes,
222
223
  parameters.correlationId,
223
- telemetryManager
224
+ telemetryManager,
225
+ apiId
224
226
  );
225
227
  }
226
228
 
@@ -263,7 +265,8 @@ export class SignInClient extends CustomAuthInteractionClientBase {
263
265
  ),
264
266
  scopes,
265
267
  parameters.correlationId,
266
- telemetryManager
268
+ telemetryManager,
269
+ apiId
267
270
  );
268
271
  }
269
272
 
@@ -279,7 +282,8 @@ export class SignInClient extends CustomAuthInteractionClientBase {
279
282
  tokenEndpointCaller: () => Promise<SignInTokenResponse>,
280
283
  scopes: string[],
281
284
  correlationId: string,
282
- telemetryManager: ServerTelemetryManager
285
+ telemetryManager: ServerTelemetryManager,
286
+ apiId: number
283
287
  ): Promise<
284
288
  | SignInCompletedResult
285
289
  | SignInJitRequiredResult
@@ -301,7 +305,8 @@ export class SignInClient extends CustomAuthInteractionClientBase {
301
305
  const authResult = await this.handleTokenResponse(
302
306
  tokenResponse,
303
307
  scopes,
304
- correlationId
308
+ correlationId,
309
+ apiId
305
310
  );
306
311
 
307
312
  return createSignInCompleteResult({
@@ -741,7 +741,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
741
741
  await this.browserStorage.setAccount(
742
742
  accountEntity,
743
743
  this.correlationId,
744
- kmsi
744
+ kmsi,
745
+ this.apiId
745
746
  );
746
747
  // Remove any existing cached tokens for this account in browser storage
747
748
  this.browserStorage.removeAccountContext(
@@ -817,6 +818,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
817
818
  nativeCacheRecord,
818
819
  this.correlationId,
819
820
  AuthToken.isKmsi(idTokenClaims),
821
+ this.apiId,
820
822
  request.storeInCache
821
823
  );
822
824
  }
@@ -136,6 +136,7 @@ export class SilentAuthCodeClient extends StandardInteractionClient {
136
136
  cloud_instance_host_name: request.cloudInstanceHostName,
137
137
  },
138
138
  silentRequest,
139
+ this.apiId,
139
140
  false
140
141
  );
141
142
  } catch (e) {
@@ -74,11 +74,13 @@ export class SilentRefreshClient extends StandardInteractionClient {
74
74
  this.logger,
75
75
  this.performanceClient,
76
76
  request.correlationId
77
- )(silentRequest).catch((e: AuthError) => {
78
- (e as AuthError).setCorrelationId(this.correlationId);
79
- serverTelemetryManager.cacheFailedRequest(e);
80
- throw e;
81
- }) as Promise<AuthenticationResult>;
77
+ )(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(
78
+ (e: AuthError) => {
79
+ (e as AuthError).setCorrelationId(this.correlationId);
80
+ serverTelemetryManager.cacheFailedRequest(e);
81
+ throw e;
82
+ }
83
+ ) as Promise<AuthenticationResult>;
82
84
  }
83
85
 
84
86
  /**
@@ -25,6 +25,7 @@ import {
25
25
  BrowserAuthErrorCodes,
26
26
  } from "../error/BrowserAuthError.js";
27
27
  import { AuthenticationResult } from "../response/AuthenticationResult.js";
28
+ import { ApiId } from "../utils/BrowserConstants.js";
28
29
 
29
30
  /**
30
31
  * Abstract class which defines operations for a browser interaction handling class.
@@ -56,7 +57,8 @@ export class InteractionHandler {
56
57
  */
57
58
  async handleCodeResponse(
58
59
  response: AuthorizeResponse,
59
- request: CommonAuthorizationUrlRequest
60
+ request: CommonAuthorizationUrlRequest,
61
+ apiId: ApiId
60
62
  ): Promise<AuthenticationResult> {
61
63
  this.performanceClient.addQueueMeasurement(
62
64
  PerformanceEvents.HandleCodeResponse,
@@ -89,7 +91,7 @@ export class InteractionHandler {
89
91
  this.logger,
90
92
  this.performanceClient,
91
93
  request.correlationId
92
- )(authCodeResponse, request);
94
+ )(authCodeResponse, request, apiId);
93
95
  }
94
96
 
95
97
  /**
@@ -103,6 +105,7 @@ export class InteractionHandler {
103
105
  async handleCodeResponseFromServer(
104
106
  authCodeResponse: AuthorizationCodePayload,
105
107
  request: CommonAuthorizationUrlRequest,
108
+ apiId: ApiId,
106
109
  validateNonce: boolean = true
107
110
  ): Promise<AuthenticationResult> {
108
111
  this.performanceClient.addQueueMeasurement(
@@ -152,7 +155,11 @@ export class InteractionHandler {
152
155
  this.logger,
153
156
  this.performanceClient,
154
157
  request.correlationId
155
- )(this.authCodeRequest, authCodeResponse)) as AuthenticationResult;
158
+ )(
159
+ this.authCodeRequest,
160
+ apiId,
161
+ authCodeResponse
162
+ )) as AuthenticationResult;
156
163
  return tokenResponse;
157
164
  }
158
165
 
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable header/header */
2
2
  export const name = "@azure/msal-browser";
3
- export const version = "4.27.0";
3
+ export const version = "4.28.1";
@@ -438,7 +438,7 @@ export async function handleResponseCode(
438
438
  logger,
439
439
  performanceClient,
440
440
  request.correlationId
441
- )(response, request);
441
+ )(response, request, apiId);
442
442
 
443
443
  return result;
444
444
  }
@@ -556,6 +556,7 @@ export async function handleResponseEAR(
556
556
  authority,
557
557
  TimeUtils.nowSeconds(),
558
558
  request,
559
+ apiId,
559
560
  additionalData,
560
561
  undefined,
561
562
  undefined,
@@ -112,9 +112,9 @@ export type InMemoryCacheKeys =
112
112
 
113
113
  /**
114
114
  * API Codes for Telemetry purposes.
115
- * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
116
115
  * 0-99 Silent Flow
117
116
  * 800-899 Auth Code Flow
117
+ * 900-999 Miscellaneous
118
118
  */
119
119
  export const ApiId = {
120
120
  acquireTokenRedirect: 861,
@@ -126,9 +126,35 @@ export const ApiId = {
126
126
  acquireTokenSilent_silentFlow: 61,
127
127
  logout: 961,
128
128
  logoutPopup: 962,
129
+ hydrateCache: 963,
130
+ loadExternalTokens: 964,
129
131
  } as const;
130
132
  export type ApiId = (typeof ApiId)[keyof typeof ApiId];
131
133
 
134
+ /**
135
+ * API Names for Telemetry purposes.
136
+ */
137
+ export const ApiName = {
138
+ 861: "acquireTokenRedirect",
139
+ 862: "acquireTokenPopup",
140
+ 863: "ssoSilent",
141
+ 864: "acquireTokenSilent_authCode",
142
+ 865: "handleRedirectPromise",
143
+ 866: "acquireTokenByCode",
144
+ 61: "acquireTokenSilent_silentFlow",
145
+ 961: "logout",
146
+ 962: "logoutPopup",
147
+ 963: "hydrateCache",
148
+ 964: "loadExternalTokens",
149
+ } as const satisfies Record<ApiId, string>;
150
+
151
+ export const apiIdToName = (id: number | undefined): string => {
152
+ if (typeof id === "number" && id in ApiName) {
153
+ return ApiName[id as ApiId];
154
+ }
155
+ return "unknown";
156
+ };
157
+
132
158
  /*
133
159
  * Interaction type of the API - used for state and telemetry
134
160
  */