@azure/msal-browser 5.17.3 → 5.19.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 (329) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  4. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +1 -1
  5. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  7. package/dist/cache/AccountManager.mjs +1 -1
  8. package/dist/cache/AsyncMemoryStorage.mjs +9 -12
  9. package/dist/cache/AsyncMemoryStorage.mjs.map +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +15 -7
  11. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  12. package/dist/cache/CacheHelpers.mjs +1 -1
  13. package/dist/cache/CacheKeys.mjs +1 -1
  14. package/dist/cache/CookieStorage.mjs +1 -1
  15. package/dist/cache/DatabaseStorage.mjs +1 -1
  16. package/dist/cache/EncryptedData.mjs +1 -1
  17. package/dist/cache/LocalStorage.mjs +1 -1
  18. package/dist/cache/MemoryStorage.mjs +1 -1
  19. package/dist/cache/SessionStorage.mjs +1 -1
  20. package/dist/cache/TokenCache.mjs +1 -1
  21. package/dist/config/Configuration.mjs +1 -1
  22. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  23. package/dist/controllers/StandardController.mjs +34 -17
  24. package/dist/controllers/StandardController.mjs.map +1 -1
  25. package/dist/crypto/BrowserCrypto.mjs +19 -19
  26. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  27. package/dist/crypto/CryptoOps.mjs +62 -103
  28. package/dist/crypto/CryptoOps.mjs.map +1 -1
  29. package/dist/crypto/PkceGenerator.mjs +1 -1
  30. package/dist/crypto/SignedHttpRequest.mjs +4 -2
  31. package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
  32. package/dist/crypto/TokenBindingKeyManager.mjs +157 -0
  33. package/dist/crypto/TokenBindingKeyManager.mjs.map +1 -0
  34. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  35. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  36. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +2 -2
  37. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  38. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  54. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  55. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  56. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  57. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  58. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  59. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  60. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  61. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  62. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  63. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  64. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  65. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  66. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  67. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  68. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  69. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  70. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  71. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +4 -4
  72. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs.map +1 -1
  73. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +4 -3
  74. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs.map +1 -1
  75. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  76. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  77. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  78. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  79. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  80. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  81. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  82. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  83. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  84. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  85. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  86. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  87. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  88. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  89. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  90. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  91. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  92. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  93. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  94. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  95. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  96. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  97. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  98. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  99. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  100. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  101. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  102. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +2 -1
  103. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
  104. package/dist/custom_auth/index.mjs +1 -1
  105. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  106. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  107. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  108. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  109. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  110. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  111. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  112. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  113. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  114. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  115. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  116. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  117. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  118. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  119. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  120. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  121. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  122. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  123. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  124. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  125. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  126. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  127. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  128. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  129. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  130. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  131. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  132. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  133. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  134. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  135. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  136. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  137. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  138. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  139. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  140. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  141. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  142. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  143. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  144. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  145. package/dist/encode/Base64Decode.mjs +1 -1
  146. package/dist/encode/Base64Encode.mjs +1 -1
  147. package/dist/error/BrowserAuthError.mjs +1 -1
  148. package/dist/error/BrowserAuthErrorCodes.mjs +5 -2
  149. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
  150. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  151. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  152. package/dist/error/NativeAuthError.mjs +1 -1
  153. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  154. package/dist/error/NestedAppAuthError.mjs +1 -1
  155. package/dist/event/EventHandler.mjs +1 -1
  156. package/dist/event/EventMessage.mjs +1 -1
  157. package/dist/event/EventType.mjs +1 -1
  158. package/dist/index.mjs +1 -1
  159. package/dist/interaction_client/BaseInteractionClient.mjs +6 -2
  160. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  161. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  162. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +30 -9
  163. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  164. package/dist/interaction_client/PopupClient.mjs +3 -3
  165. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  166. package/dist/interaction_client/RedirectClient.mjs +3 -3
  167. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  168. package/dist/interaction_client/SilentAuthCodeClient.mjs +3 -3
  169. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  170. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  171. package/dist/interaction_client/SilentIframeClient.mjs +3 -3
  172. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  173. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  174. package/dist/interaction_client/StandardInteractionClient.mjs +2 -1
  175. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  176. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  177. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  178. package/dist/log-strings-mapping.json +1196 -1200
  179. package/dist/naa/BridgeError.mjs +1 -1
  180. package/dist/naa/BridgeProxy.mjs +27 -32
  181. package/dist/naa/BridgeProxy.mjs.map +1 -1
  182. package/dist/naa/BridgeStatusCode.mjs +1 -1
  183. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +54 -25
  184. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  185. package/dist/navigation/NavigationClient.mjs +1 -1
  186. package/dist/network/FetchClient.mjs +1 -1
  187. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  188. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  189. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  190. package/dist/packageMetadata.mjs +2 -2
  191. package/dist/popup_relay/constants.mjs +1 -1
  192. package/dist/popup_relay/index.mjs +1 -1
  193. package/dist/popup_relay/relayClient.mjs +1 -1
  194. package/dist/protocol/Authorize.mjs +5 -3
  195. package/dist/protocol/Authorize.mjs.map +1 -1
  196. package/dist/redirect_bridge/index.mjs +1 -1
  197. package/dist/request/RequestHelpers.mjs +11 -3
  198. package/dist/request/RequestHelpers.mjs.map +1 -1
  199. package/dist/response/ResponseHandler.mjs +1 -1
  200. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  201. package/dist/telemetry/BrowserPerformanceEvents.mjs +5 -5
  202. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  203. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  204. package/dist/utils/BrowserConstants.mjs +1 -1
  205. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  206. package/dist/utils/BrowserUtils.mjs +1 -1
  207. package/dist/utils/Helpers.mjs +1 -1
  208. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  209. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +64 -0
  210. package/dist/webBrokerBridge/PendingRequestRegistry.mjs.map +1 -0
  211. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +39 -0
  212. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs.map +1 -0
  213. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +58 -0
  214. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs.map +1 -0
  215. package/lib/custom-auth-path/log-strings-mapping.json +39 -43
  216. package/lib/custom-auth-path/msal-custom-auth.cjs +4542 -4060
  217. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  218. package/lib/custom-auth-path/msal-custom-auth.js +4542 -4060
  219. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  220. package/lib/log-strings-mapping.json +11 -15
  221. package/lib/msal-browser.cjs +1030 -432
  222. package/lib/msal-browser.cjs.map +1 -1
  223. package/lib/msal-browser.js +1030 -432
  224. package/lib/msal-browser.js.map +1 -1
  225. package/lib/msal-browser.min.js +2 -2
  226. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  227. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  228. package/lib/popup-relay/msal-popup-relay.js +2 -2
  229. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  230. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  231. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  232. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  233. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  234. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  235. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  236. package/package.json +2 -2
  237. package/src/broker/nativeBroker/PlatformAuthRequest.ts +2 -1
  238. package/src/cache/AsyncMemoryStorage.ts +7 -13
  239. package/src/cache/BrowserCacheManager.ts +24 -6
  240. package/src/controllers/StandardController.ts +58 -15
  241. package/src/crypto/BrowserCrypto.ts +10 -8
  242. package/src/crypto/CryptoOps.ts +138 -178
  243. package/src/crypto/SignedHttpRequest.ts +3 -0
  244. package/src/crypto/TokenBindingKeyManager.ts +299 -0
  245. package/src/custom_auth/controller/CustomAuthStandardController.ts +2 -1
  246. package/src/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.ts +8 -3
  247. package/src/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.ts +7 -3
  248. package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +1 -0
  249. package/src/error/BrowserAuthErrorCodes.ts +6 -0
  250. package/src/interaction_client/BaseInteractionClient.ts +8 -1
  251. package/src/interaction_client/PlatformAuthInteractionClient.ts +44 -6
  252. package/src/interaction_client/PopupClient.ts +5 -2
  253. package/src/interaction_client/RedirectClient.ts +5 -2
  254. package/src/interaction_client/SilentAuthCodeClient.ts +5 -2
  255. package/src/interaction_client/SilentIframeClient.ts +5 -2
  256. package/src/interaction_client/StandardInteractionClient.ts +1 -0
  257. package/src/naa/BridgeProxy.ts +38 -44
  258. package/src/naa/TokenRequest.ts +1 -0
  259. package/src/naa/mapping/NestedAppAuthAdapter.ts +62 -55
  260. package/src/packageMetadata.ts +1 -1
  261. package/src/protocol/Authorize.ts +8 -1
  262. package/src/request/RequestHelpers.ts +19 -2
  263. package/src/telemetry/BrowserPerformanceEvents.ts +4 -4
  264. package/src/webBrokerBridge/IWebBrokerBridgeMessage.ts +42 -0
  265. package/src/webBrokerBridge/PendingRequestRegistry.ts +76 -0
  266. package/src/webBrokerBridge/WebBrokerBridgeError.ts +69 -0
  267. package/src/webBrokerBridge/WebBrokerBridgeErrorMap.ts +108 -0
  268. package/src/webBrokerBridge/index.ts +25 -0
  269. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +1 -0
  270. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
  271. package/types/cache/AsyncMemoryStorage.d.ts +1 -2
  272. package/types/cache/AsyncMemoryStorage.d.ts.map +1 -1
  273. package/types/cache/BrowserCacheManager.d.ts +7 -5
  274. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  275. package/types/controllers/StandardController.d.ts +2 -1
  276. package/types/controllers/StandardController.d.ts.map +1 -1
  277. package/types/crypto/BrowserCrypto.d.ts +2 -2
  278. package/types/crypto/BrowserCrypto.d.ts.map +1 -1
  279. package/types/crypto/CryptoOps.d.ts +7 -21
  280. package/types/crypto/CryptoOps.d.ts.map +1 -1
  281. package/types/crypto/SignedHttpRequest.d.ts.map +1 -1
  282. package/types/crypto/TokenBindingKeyManager.d.ts +83 -0
  283. package/types/crypto/TokenBindingKeyManager.d.ts.map +1 -0
  284. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  285. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  286. package/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts +2 -2
  287. package/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts.map +1 -1
  288. package/types/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.d.ts +4 -3
  289. package/types/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.d.ts.map +1 -1
  290. package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  291. package/types/error/BrowserAuthErrorCodes.d.ts +3 -0
  292. package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
  293. package/types/index.d.ts +1 -0
  294. package/types/index.d.ts.map +1 -1
  295. package/types/interaction_client/BaseInteractionClient.d.ts +3 -2
  296. package/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  297. package/types/interaction_client/PlatformAuthInteractionClient.d.ts +2 -2
  298. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  299. package/types/interaction_client/PopupClient.d.ts +2 -2
  300. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  301. package/types/interaction_client/RedirectClient.d.ts +2 -2
  302. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  303. package/types/interaction_client/SilentAuthCodeClient.d.ts +2 -2
  304. package/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  305. package/types/interaction_client/SilentIframeClient.d.ts +2 -2
  306. package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  307. package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  308. package/types/naa/BridgeProxy.d.ts +14 -2
  309. package/types/naa/BridgeProxy.d.ts.map +1 -1
  310. package/types/naa/TokenRequest.d.ts +1 -0
  311. package/types/naa/TokenRequest.d.ts.map +1 -1
  312. package/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  313. package/types/packageMetadata.d.ts +1 -1
  314. package/types/protocol/Authorize.d.ts.map +1 -1
  315. package/types/request/RequestHelpers.d.ts.map +1 -1
  316. package/types/telemetry/BrowserPerformanceEvents.d.ts +4 -4
  317. package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts +35 -0
  318. package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts.map +1 -0
  319. package/types/webBrokerBridge/PendingRequestRegistry.d.ts +27 -0
  320. package/types/webBrokerBridge/PendingRequestRegistry.d.ts.map +1 -0
  321. package/types/webBrokerBridge/WebBrokerBridgeError.d.ts +50 -0
  322. package/types/webBrokerBridge/WebBrokerBridgeError.d.ts.map +1 -0
  323. package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts +10 -0
  324. package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts.map +1 -0
  325. package/types/webBrokerBridge/index.d.ts +16 -0
  326. package/types/webBrokerBridge/index.d.ts.map +1 -0
  327. package/src/naa/BridgeRequest.ts +0 -16
  328. package/types/naa/BridgeRequest.d.ts +0 -8
  329. package/types/naa/BridgeRequest.d.ts.map +0 -1
@@ -0,0 +1,299 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import {
7
+ ClientAuthErrorCodes,
8
+ createClientAuthError,
9
+ IPerformanceClient,
10
+ JsonWebTokenAlgorithms,
11
+ Logger,
12
+ } from "@azure/msal-common/browser";
13
+ import type {
14
+ ITokenBindingKeyManager,
15
+ TokenBindingKeyProvisioningParameters,
16
+ } from "@azure/msal-common/browser";
17
+ import * as BrowserPerformanceEvents from "../telemetry/BrowserPerformanceEvents.js";
18
+ import * as BrowserCrypto from "./BrowserCrypto.js";
19
+ import {
20
+ createBrowserAuthError,
21
+ BrowserAuthErrorCodes,
22
+ } from "../error/BrowserAuthError.js";
23
+ import { AsyncMemoryStorage } from "../cache/AsyncMemoryStorage.js";
24
+
25
+ /**
26
+ * Browser keystore record for asymmetric token-binding keys.
27
+ */
28
+ export type CachedKeyPair = {
29
+ /**
30
+ * Public WebCrypto key.
31
+ */
32
+ publicKey: CryptoKey;
33
+ /**
34
+ * Private WebCrypto key used for signing.
35
+ */
36
+ privateKey: CryptoKey;
37
+ /**
38
+ * Protocol or token-binding family that owns the key.
39
+ */
40
+ tokenBindingKeyType?: string;
41
+ /**
42
+ * JOSE algorithm policy associated with the key.
43
+ */
44
+ tokenBindingKeyAlgorithm?: string;
45
+ /**
46
+ * JWK thumbprint used as the key identifier.
47
+ */
48
+ keyId?: string;
49
+ };
50
+
51
+ type GeneratedKeyPair = CachedKeyPair & { keyId: string };
52
+
53
+ /**
54
+ * Token-binding key metadata emitted in performance measurements.
55
+ */
56
+ export type TokenBindingKeyTelemetry = {
57
+ /**
58
+ * Protocol or token-binding family that owns the key.
59
+ */
60
+ tokenBindingKeyType?: string;
61
+ /**
62
+ * JOSE algorithm policy associated with the key.
63
+ */
64
+ tokenBindingKeyAlgorithm?: string;
65
+ };
66
+
67
+ /**
68
+ * Owns browser token-binding key lifecycle and storage lookup.
69
+ * @internal
70
+ */
71
+ export class TokenBindingKeyManager implements ITokenBindingKeyManager {
72
+ private static TOKEN_BINDING_KEY_USAGES: Array<KeyUsage> = [
73
+ "sign",
74
+ "verify",
75
+ ];
76
+ private static tokenBindingKeyStorage: AsyncMemoryStorage<CachedKeyPair>;
77
+ private cache: AsyncMemoryStorage<CachedKeyPair>;
78
+ private logger: Logger;
79
+ private performanceClient: IPerformanceClient | undefined;
80
+
81
+ constructor(logger: Logger, performanceClient?: IPerformanceClient) {
82
+ this.logger = logger;
83
+ this.cache = TokenBindingKeyManager.getTokenBindingKeyStorage(
84
+ this.logger
85
+ );
86
+ this.performanceClient = performanceClient;
87
+ }
88
+
89
+ private static getTokenBindingKeyStorage(
90
+ logger: Logger
91
+ ): AsyncMemoryStorage<CachedKeyPair> {
92
+ if (!TokenBindingKeyManager.tokenBindingKeyStorage) {
93
+ TokenBindingKeyManager.tokenBindingKeyStorage =
94
+ new AsyncMemoryStorage<CachedKeyPair>(logger);
95
+ }
96
+
97
+ return TokenBindingKeyManager.tokenBindingKeyStorage;
98
+ }
99
+
100
+ /**
101
+ * Provisions a browser token-binding key and returns its key identifier.
102
+ * @param request - Key provisioning policy.
103
+ */
104
+ async provisionTokenBindingKey(
105
+ request: TokenBindingKeyProvisioningParameters
106
+ ): Promise<string> {
107
+ const publicKeyThumbMeasurement =
108
+ this.performanceClient?.startMeasurement(
109
+ BrowserPerformanceEvents.CryptoOptsGetPublicKeyThumbprint,
110
+ request.correlationId
111
+ );
112
+ try {
113
+ const activeKeyPair = await this.createTokenBindingKey(request);
114
+
115
+ publicKeyThumbMeasurement?.end({
116
+ success: true,
117
+ ...this.getTokenBindingKeyTelemetry(activeKeyPair),
118
+ });
119
+
120
+ return activeKeyPair.keyId;
121
+ } catch (e) {
122
+ publicKeyThumbMeasurement?.end({
123
+ success: false,
124
+ tokenBindingKeyType: request.tokenBindingKeyType,
125
+ tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
126
+ });
127
+ throw e;
128
+ }
129
+ }
130
+
131
+ /**
132
+ * Removes a browser token-binding key by identifier.
133
+ * @param kid - Token-binding key identifier.
134
+ * @param correlationId - Request correlation identifier.
135
+ */
136
+ async removeTokenBindingKey(
137
+ kid: string,
138
+ correlationId: string
139
+ ): Promise<void> {
140
+ await this.cache.removeItem(kid, correlationId);
141
+ const keyFound = await this.cache.containsKey(kid, correlationId);
142
+ if (keyFound) {
143
+ throw createClientAuthError(
144
+ ClientAuthErrorCodes.bindingKeyNotRemoved,
145
+ correlationId
146
+ );
147
+ }
148
+ }
149
+
150
+ /**
151
+ * Clears browser token-binding keys from memory and persistent storage.
152
+ * @param correlationId - Request correlation identifier.
153
+ */
154
+ async clearKeystore(correlationId: string): Promise<boolean> {
155
+ this.cache.clearInMemory(correlationId);
156
+
157
+ try {
158
+ await this.cache.clearPersistent(correlationId);
159
+ return true;
160
+ } catch (e) {
161
+ if (e instanceof Error) {
162
+ this.logger.error(
163
+ `Clearing keystore failed with error: '${e.message}'`,
164
+ correlationId
165
+ );
166
+ } else {
167
+ this.logger.error(
168
+ "Clearing keystore failed with unknown error",
169
+ correlationId
170
+ );
171
+ }
172
+
173
+ return false;
174
+ }
175
+ }
176
+
177
+ /**
178
+ * Gets a token-binding public key as a JWK by identifier.
179
+ * @param keyId - Token-binding key identifier.
180
+ * @param correlationId - Request correlation identifier.
181
+ */
182
+ async getTokenBindingPublicKeyJwk(
183
+ keyId: string,
184
+ correlationId: string
185
+ ): Promise<JsonWebKey> {
186
+ const cachedKeyPair = await this.getTokenBindingKeyPair(
187
+ keyId,
188
+ correlationId
189
+ );
190
+
191
+ return BrowserCrypto.exportJwk(cachedKeyPair.publicKey);
192
+ }
193
+
194
+ private async createTokenBindingKey(
195
+ request: TokenBindingKeyProvisioningParameters
196
+ ): Promise<GeneratedKeyPair> {
197
+ const keyGenAlgorithm = this.getTokenBindingKeyGenAlgorithmOptions(
198
+ request.tokenBindingKeyAlgorithm,
199
+ request.correlationId
200
+ );
201
+ const generatedKeyPair = await this.generateKeyPairAndThumbprint(
202
+ TokenBindingKeyManager.TOKEN_BINDING_KEY_USAGES,
203
+ keyGenAlgorithm,
204
+ request.correlationId
205
+ );
206
+ await this.cache.setItem(
207
+ generatedKeyPair.keyId,
208
+ {
209
+ ...generatedKeyPair,
210
+ tokenBindingKeyType: request.tokenBindingKeyType,
211
+ tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
212
+ },
213
+ request.correlationId
214
+ );
215
+
216
+ return {
217
+ ...generatedKeyPair,
218
+ tokenBindingKeyType: request.tokenBindingKeyType,
219
+ tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
220
+ };
221
+ }
222
+
223
+ private async generateKeyPairAndThumbprint(
224
+ usages: Array<KeyUsage>,
225
+ keyGenAlgorithm: AlgorithmIdentifier,
226
+ correlationId: string
227
+ ): Promise<GeneratedKeyPair> {
228
+ const keyPair: CryptoKeyPair = await BrowserCrypto.generateKeyPair(
229
+ false,
230
+ usages,
231
+ keyGenAlgorithm
232
+ );
233
+ const publicJwk: JsonWebKey = await BrowserCrypto.exportJwk(
234
+ keyPair.publicKey
235
+ );
236
+ const keyId = await BrowserCrypto.computeJwkThumbprint(
237
+ publicJwk,
238
+ correlationId
239
+ );
240
+ return {
241
+ publicKey: keyPair.publicKey,
242
+ privateKey: keyPair.privateKey,
243
+ keyId,
244
+ };
245
+ }
246
+
247
+ /** @internal */
248
+ async getTokenBindingKeyPair(
249
+ keyId: string,
250
+ correlationId: string
251
+ ): Promise<CachedKeyPair> {
252
+ const cachedKeyPair = await this.cache.getItem(keyId, correlationId);
253
+ if (!cachedKeyPair) {
254
+ throw createBrowserAuthError(
255
+ BrowserAuthErrorCodes.cryptoKeyNotFound,
256
+ correlationId
257
+ );
258
+ }
259
+
260
+ return cachedKeyPair;
261
+ }
262
+
263
+ /** @internal */
264
+ getTokenBindingKeyTelemetry(
265
+ cachedKeyPair: CachedKeyPair,
266
+ fallbackAlgorithm?: string
267
+ ): TokenBindingKeyTelemetry {
268
+ return {
269
+ ...(cachedKeyPair.tokenBindingKeyType && {
270
+ tokenBindingKeyType: cachedKeyPair.tokenBindingKeyType,
271
+ }),
272
+ ...(cachedKeyPair.tokenBindingKeyAlgorithm || fallbackAlgorithm
273
+ ? {
274
+ tokenBindingKeyAlgorithm:
275
+ cachedKeyPair.tokenBindingKeyAlgorithm ||
276
+ fallbackAlgorithm,
277
+ }
278
+ : {}),
279
+ };
280
+ }
281
+
282
+ private getTokenBindingKeyGenAlgorithmOptions(
283
+ tokenBindingKeyAlgorithm: string,
284
+ correlationId: string
285
+ ): AlgorithmIdentifier {
286
+ if (tokenBindingKeyAlgorithm === JsonWebTokenAlgorithms.RS256) {
287
+ return BrowserCrypto.RSA_KEYGEN_ALGORITHM_OPTIONS;
288
+ }
289
+
290
+ if (tokenBindingKeyAlgorithm === JsonWebTokenAlgorithms.ES256) {
291
+ return BrowserCrypto.ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS;
292
+ }
293
+
294
+ throw createBrowserAuthError(
295
+ BrowserAuthErrorCodes.unsupportedTokenBindingAlgorithm,
296
+ correlationId
297
+ );
298
+ }
299
+ }
@@ -127,7 +127,8 @@ export class CustomAuthStandardController
127
127
  this.customAuthConfig.customAuth?.requestInterceptor,
128
128
  this.logger
129
129
  ),
130
- this.authority
130
+ this.authority,
131
+ this.tokenBindingKeyManager
131
132
  );
132
133
 
133
134
  this.signInClient = interactionClientFactory.create(SignInClient);
@@ -13,6 +13,7 @@ import { BrowserCacheManager } from "../../../cache/BrowserCacheManager.js";
13
13
  import {
14
14
  Constants,
15
15
  ICrypto,
16
+ ITokenBindingKeyManager,
16
17
  IPerformanceClient,
17
18
  Logger,
18
19
  ResponseHandler,
@@ -39,7 +40,8 @@ export abstract class CustomAuthInteractionClientBase extends StandardInteractio
39
40
  navigationClient: INavigationClient,
40
41
  performanceClient: IPerformanceClient,
41
42
  protected customAuthApiClient: ICustomAuthApiClient,
42
- protected customAuthAuthority: CustomAuthAuthority
43
+ protected customAuthAuthority: CustomAuthAuthority,
44
+ tokenBindingKeyManager?: ITokenBindingKeyManager
43
45
  ) {
44
46
  super(
45
47
  config,
@@ -49,7 +51,9 @@ export abstract class CustomAuthInteractionClientBase extends StandardInteractio
49
51
  eventHandler,
50
52
  navigationClient,
51
53
  performanceClient,
52
- ""
54
+ "",
55
+ undefined,
56
+ tokenBindingKeyManager
53
57
  );
54
58
 
55
59
  this.tokenResponseHandler = new ResponseHandler(
@@ -59,7 +63,8 @@ export abstract class CustomAuthInteractionClientBase extends StandardInteractio
59
63
  this.logger,
60
64
  this.performanceClient,
61
65
  null,
62
- null
66
+ null,
67
+ this.tokenBindingKeyManager
63
68
  );
64
69
  }
65
70
 
@@ -10,6 +10,7 @@ import { BrowserConfiguration } from "../../../config/Configuration.js";
10
10
  import { BrowserCacheManager } from "../../../cache/BrowserCacheManager.js";
11
11
  import {
12
12
  ICrypto,
13
+ ITokenBindingKeyManager,
13
14
  IPerformanceClient,
14
15
  Logger,
15
16
  } from "@azure/msal-common/browser";
@@ -26,7 +27,8 @@ export class CustomAuthInterationClientFactory {
26
27
  private navigationClient: INavigationClient,
27
28
  private performanceClient: IPerformanceClient,
28
29
  private customAuthApiClient: ICustomAuthApiClient,
29
- private customAuthAuthority: CustomAuthAuthority
30
+ private customAuthAuthority: CustomAuthAuthority,
31
+ private tokenBindingKeyManager: ITokenBindingKeyManager
30
32
  ) {}
31
33
 
32
34
  create<TClient extends CustomAuthInteractionClientBase>(
@@ -39,7 +41,8 @@ export class CustomAuthInterationClientFactory {
39
41
  navigationClient: INavigationClient,
40
42
  performanceClient: IPerformanceClient,
41
43
  customAuthApiClient: ICustomAuthApiClient,
42
- customAuthAuthority: CustomAuthAuthority
44
+ customAuthAuthority: CustomAuthAuthority,
45
+ tokenBindingKeyManager?: ITokenBindingKeyManager
43
46
  ) => TClient
44
47
  ): TClient {
45
48
  return new clientConstructor(
@@ -51,7 +54,8 @@ export class CustomAuthInterationClientFactory {
51
54
  this.navigationClient,
52
55
  this.performanceClient,
53
56
  this.customAuthApiClient,
54
- this.customAuthAuthority
57
+ this.customAuthAuthority,
58
+ this.tokenBindingKeyManager
55
59
  );
56
60
  }
57
61
  }
@@ -212,6 +212,7 @@ export class CustomAuthSilentCacheClient extends CustomAuthInteractionClientBase
212
212
  correlationId: correlationId,
213
213
  },
214
214
  cryptoInterface: this.browserCrypto,
215
+ tokenBindingKeyManager: this.tokenBindingKeyManager,
215
216
  networkInterface: this.networkClient,
216
217
  storageInterface: this.browserStorage,
217
218
  serverTelemetryManager: serverTelemetryManager,
@@ -60,6 +60,12 @@ export const uninitializedPublicClientApplication =
60
60
  export const nativePromptNotSupported = "native_prompt_not_supported";
61
61
  export const invalidBase64String = "invalid_base64_string";
62
62
  export const invalidPopTokenRequest = "invalid_pop_token_request";
63
+ export const unsupportedTokenBindingAlgorithm =
64
+ "unsupported_token_binding_algorithm";
65
+ export const tokenBindingKeyAlgorithmMismatch =
66
+ "token_binding_key_algorithm_mismatch";
67
+ export const tokenBindingKeyJwkThumbprintMismatch =
68
+ "token_binding_key_jwk_thumbprint_mismatch";
63
69
  export const failedToBuildHeaders = "failed_to_build_headers";
64
70
  export const failedToParseHeaders = "failed_to_parse_headers";
65
71
  export const failedToDecryptEarResponse = "failed_to_decrypt_ear_response";
@@ -21,6 +21,7 @@ import {
21
21
  AzureCloudOptions,
22
22
  invokeAsync,
23
23
  StringDict,
24
+ ITokenBindingKeyManager,
24
25
  } from "@azure/msal-common/browser";
25
26
  import * as BrowserPerformanceEvents from "../telemetry/BrowserPerformanceEvents.js";
26
27
  import { BrowserConfiguration } from "../config/Configuration.js";
@@ -36,6 +37,7 @@ import { INavigationClient } from "../navigation/INavigationClient.js";
36
37
  import { AuthenticationResult } from "../response/AuthenticationResult.js";
37
38
  import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
38
39
  import { IPlatformAuthHandler } from "../broker/nativeBroker/IPlatformAuthHandler.js";
40
+ import { TokenBindingKeyManager } from "../crypto/TokenBindingKeyManager.js";
39
41
 
40
42
  export abstract class BaseInteractionClient {
41
43
  protected config: BrowserConfiguration;
@@ -48,6 +50,7 @@ export abstract class BaseInteractionClient {
48
50
  protected platformAuthProvider: IPlatformAuthHandler | undefined;
49
51
  protected correlationId: string;
50
52
  protected performanceClient: IPerformanceClient;
53
+ protected tokenBindingKeyManager: ITokenBindingKeyManager;
51
54
 
52
55
  constructor(
53
56
  config: BrowserConfiguration,
@@ -58,7 +61,8 @@ export abstract class BaseInteractionClient {
58
61
  navigationClient: INavigationClient,
59
62
  performanceClient: IPerformanceClient,
60
63
  correlationId: string,
61
- platformAuthProvider?: IPlatformAuthHandler
64
+ platformAuthProvider?: IPlatformAuthHandler,
65
+ tokenBindingKeyManager?: ITokenBindingKeyManager
62
66
  ) {
63
67
  this.config = config;
64
68
  this.browserStorage = storageImpl;
@@ -70,6 +74,9 @@ export abstract class BaseInteractionClient {
70
74
  this.correlationId = correlationId;
71
75
  this.logger = logger.clone(name, version);
72
76
  this.performanceClient = performanceClient;
77
+ this.tokenBindingKeyManager =
78
+ tokenBindingKeyManager ||
79
+ new TokenBindingKeyManager(this.logger, this.performanceClient);
73
80
  }
74
81
 
75
82
  abstract acquireToken(
@@ -30,6 +30,7 @@ import {
30
30
  StoreInCache,
31
31
  TimeUtils,
32
32
  TokenClaims,
33
+ ITokenBindingKeyManager,
33
34
  UrlString,
34
35
  buildAccountToCache,
35
36
  createClientAuthError,
@@ -102,7 +103,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
102
103
  provider: IPlatformAuthHandler,
103
104
  accountId: string,
104
105
  nativeStorageImpl: BrowserCacheManager,
105
- correlationId: string
106
+ correlationId: string,
107
+ tokenBindingKeyManager?: ITokenBindingKeyManager
106
108
  ) {
107
109
  super(
108
110
  config,
@@ -113,7 +115,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
113
115
  navigationClient,
114
116
  performanceClient,
115
117
  correlationId,
116
- provider
118
+ provider,
119
+ tokenBindingKeyManager
117
120
  );
118
121
  this.apiId = apiId;
119
122
  this.accountId = accountId;
@@ -128,7 +131,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
128
131
  navigationClient,
129
132
  performanceClient,
130
133
  correlationId,
131
- provider
134
+ provider,
135
+ this.tokenBindingKeyManager
132
136
  );
133
137
 
134
138
  const extensionName = this.platformAuthProvider.getExtensionName();
@@ -306,7 +310,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
306
310
  request: PlatformAuthRequest,
307
311
  cachedAccount: AccountInfo
308
312
  ): CommonSilentFlowRequest {
309
- return {
313
+ const silentRequest: CommonSilentFlowRequest = {
310
314
  authority: request.authority,
311
315
  correlationId: this.correlationId,
312
316
  scopes: ScopeSet.fromString(
@@ -316,6 +320,13 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
316
320
  account: cachedAccount,
317
321
  forceRefresh: false,
318
322
  };
323
+
324
+ // Preserve FMI partition semantics for silent cache filtering.
325
+ if (request.attributeTokens) {
326
+ silentRequest.attributeTokens = request.attributeTokens.split(" ");
327
+ }
328
+
329
+ return silentRequest;
319
330
  }
320
331
 
321
332
  /**
@@ -749,6 +760,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
749
760
  // Generate SHR in msal js if WAM does not compute it when POP is enabled
750
761
  const popTokenGenerator: PopTokenGenerator = new PopTokenGenerator(
751
762
  this.browserCrypto,
763
+ this.tokenBindingKeyManager,
752
764
  this.performanceClient
753
765
  );
754
766
  const shrParameters: SignedHttpRequestParameters = {
@@ -938,6 +950,12 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
938
950
  request.scope
939
951
  );
940
952
 
953
+ const additionalCacheKeyComponents = request.attributeTokens
954
+ ? {
955
+ attribute_tokens: request.attributeTokens,
956
+ }
957
+ : undefined;
958
+
941
959
  const cachedAccessToken: AccessTokenEntity | null =
942
960
  CacheHelpers.createAccessTokenEntity(
943
961
  homeAccountIdentifier,
@@ -953,7 +971,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
953
971
  undefined,
954
972
  request.tokenType as Constants.AuthenticationScheme,
955
973
  undefined,
956
- request.keyId
974
+ request.keyId,
975
+ additionalCacheKeyComponents
957
976
  );
958
977
 
959
978
  // save idtoken credential in configured browser storage
@@ -1081,7 +1100,10 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1081
1100
  ? undefined
1082
1101
  : this.config.auth.clientCapabilities;
1083
1102
 
1084
- // scopes are expected to be received by the native broker as "scope" and will be added to the request below. 'resource' is added in extraParameters for MCP scenarios.
1103
+ /*
1104
+ * scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
1105
+ * attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
1106
+ */
1085
1107
  const { scopes, claims } = request;
1086
1108
  const scopeSet = new ScopeSet(scopes || [], this.correlationId);
1087
1109
  scopeSet.appendScopes(Constants.OIDC_DEFAULT_SCOPES);
@@ -1091,6 +1113,14 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1091
1113
  configClaims?.length ? configClaims : undefined
1092
1114
  );
1093
1115
 
1116
+ const hasAttributeTokens = !!request.attributeTokens?.length;
1117
+ this.performanceClient?.addFields(
1118
+ {
1119
+ hasAttributeTokens,
1120
+ },
1121
+ this.correlationId
1122
+ );
1123
+
1094
1124
  const validatedRequest: PlatformAuthRequest = {
1095
1125
  claims: mergedClaims,
1096
1126
  accountId: this.accountId,
@@ -1123,6 +1153,13 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1123
1153
  shrNonce: request.shrNonce,
1124
1154
  };
1125
1155
 
1156
+ if (hasAttributeTokens) {
1157
+ validatedRequest.attributeTokens =
1158
+ CacheHelpers.serializeAttributeTokens(
1159
+ request.attributeTokens as Array<string>
1160
+ );
1161
+ }
1162
+
1126
1163
  // Check for PoP token requests: signPopToken should only be set to true if popKid is not set
1127
1164
  if (validatedRequest.signPopToken && !!request.popKid) {
1128
1165
  throw createBrowserAuthError(
@@ -1154,6 +1191,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1154
1191
 
1155
1192
  const popTokenGenerator = new PopTokenGenerator(
1156
1193
  this.browserCrypto,
1194
+ this.tokenBindingKeyManager,
1157
1195
  this.performanceClient
1158
1196
  );
1159
1197
 
@@ -20,6 +20,7 @@ import {
20
20
  CommonAuthorizationUrlRequest,
21
21
  ProtocolUtils,
22
22
  Authority,
23
+ ITokenBindingKeyManager,
23
24
  } from "@azure/msal-common/browser";
24
25
  import {
25
26
  initializeAuthorizationRequest,
@@ -100,7 +101,8 @@ export class PopupClient extends StandardInteractionClient {
100
101
  nativeStorageImpl: BrowserCacheManager,
101
102
  correlationId: string,
102
103
  platformAuthHandler?: IPlatformAuthHandler,
103
- waitForPopupResponseHook?: WaitForPopupResponseFn
104
+ waitForPopupResponseHook?: WaitForPopupResponseFn,
105
+ tokenBindingKeyManager?: ITokenBindingKeyManager
104
106
  ) {
105
107
  super(
106
108
  config,
@@ -111,7 +113,8 @@ export class PopupClient extends StandardInteractionClient {
111
113
  navigationClient,
112
114
  performanceClient,
113
115
  correlationId,
114
- platformAuthHandler
116
+ platformAuthHandler,
117
+ tokenBindingKeyManager
115
118
  );
116
119
  this.nativeStorage = nativeStorageImpl;
117
120
  this.eventHandler = eventHandler;
@@ -20,6 +20,7 @@ import {
20
20
  InProgressPerformanceEvent,
21
21
  CommonAuthorizationUrlRequest,
22
22
  ProtocolUtils,
23
+ ITokenBindingKeyManager,
23
24
  } from "@azure/msal-common/browser";
24
25
  import {
25
26
  initializeAuthorizationRequest,
@@ -89,7 +90,8 @@ export class RedirectClient extends StandardInteractionClient {
89
90
  performanceClient: IPerformanceClient,
90
91
  nativeStorageImpl: BrowserCacheManager,
91
92
  correlationId: string,
92
- platformAuthHandler?: IPlatformAuthHandler
93
+ platformAuthHandler?: IPlatformAuthHandler,
94
+ tokenBindingKeyManager?: ITokenBindingKeyManager
93
95
  ) {
94
96
  super(
95
97
  config,
@@ -100,7 +102,8 @@ export class RedirectClient extends StandardInteractionClient {
100
102
  navigationClient,
101
103
  performanceClient,
102
104
  correlationId,
103
- platformAuthHandler
105
+ platformAuthHandler,
106
+ tokenBindingKeyManager
104
107
  );
105
108
  this.nativeStorage = nativeStorageImpl;
106
109
  }
@@ -10,6 +10,7 @@ import {
10
10
  AuthError,
11
11
  IPerformanceClient,
12
12
  PerformanceEvents,
13
+ ITokenBindingKeyManager,
13
14
  invokeAsync,
14
15
  CommonAuthorizationUrlRequest,
15
16
  } from "@azure/msal-common/browser";
@@ -47,7 +48,8 @@ export class SilentAuthCodeClient extends StandardInteractionClient {
47
48
  apiId: ApiId,
48
49
  performanceClient: IPerformanceClient,
49
50
  correlationId: string,
50
- platformAuthProvider?: IPlatformAuthHandler
51
+ platformAuthProvider?: IPlatformAuthHandler,
52
+ tokenBindingKeyManager?: ITokenBindingKeyManager
51
53
  ) {
52
54
  super(
53
55
  config,
@@ -58,7 +60,8 @@ export class SilentAuthCodeClient extends StandardInteractionClient {
58
60
  navigationClient,
59
61
  performanceClient,
60
62
  correlationId,
61
- platformAuthProvider
63
+ platformAuthProvider,
64
+ tokenBindingKeyManager
62
65
  );
63
66
  this.apiId = apiId;
64
67
  }