@azure/msal-browser 5.18.0 → 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 (307) 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 +1 -1
  11. package/dist/cache/CacheHelpers.mjs +1 -1
  12. package/dist/cache/CacheKeys.mjs +1 -1
  13. package/dist/cache/CookieStorage.mjs +1 -1
  14. package/dist/cache/DatabaseStorage.mjs +1 -1
  15. package/dist/cache/EncryptedData.mjs +1 -1
  16. package/dist/cache/LocalStorage.mjs +1 -1
  17. package/dist/cache/MemoryStorage.mjs +1 -1
  18. package/dist/cache/SessionStorage.mjs +1 -1
  19. package/dist/cache/TokenCache.mjs +1 -1
  20. package/dist/config/Configuration.mjs +1 -1
  21. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  22. package/dist/controllers/StandardController.mjs +21 -15
  23. package/dist/controllers/StandardController.mjs.map +1 -1
  24. package/dist/crypto/BrowserCrypto.mjs +19 -19
  25. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  26. package/dist/crypto/CryptoOps.mjs +62 -103
  27. package/dist/crypto/CryptoOps.mjs.map +1 -1
  28. package/dist/crypto/PkceGenerator.mjs +1 -1
  29. package/dist/crypto/SignedHttpRequest.mjs +4 -2
  30. package/dist/crypto/SignedHttpRequest.mjs.map +1 -1
  31. package/dist/crypto/TokenBindingKeyManager.mjs +157 -0
  32. package/dist/crypto/TokenBindingKeyManager.mjs.map +1 -0
  33. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  34. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  35. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +2 -2
  36. package/dist/custom_auth/controller/CustomAuthStandardController.mjs.map +1 -1
  37. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  38. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  49. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  50. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  51. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  52. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  53. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  54. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  55. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  56. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  57. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  58. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  59. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  60. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  61. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  62. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  63. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  64. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  65. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  66. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  67. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  68. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  69. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  70. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +4 -4
  71. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs.map +1 -1
  72. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +4 -3
  73. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs.map +1 -1
  74. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  75. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  76. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  77. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  78. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  79. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  80. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  81. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  82. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  83. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  84. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  85. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  86. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  87. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  88. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  89. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  90. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  91. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  92. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  93. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  94. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  95. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  96. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  97. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  98. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  99. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  100. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  101. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +2 -1
  102. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs.map +1 -1
  103. package/dist/custom_auth/index.mjs +1 -1
  104. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  105. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  106. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  107. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  108. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  109. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  110. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  111. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  112. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  113. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  114. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  115. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  116. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  117. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  118. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  119. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  120. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  121. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  122. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  123. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  124. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  125. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  126. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  127. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  128. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  129. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  130. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  131. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  132. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  133. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  134. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  135. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  136. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  137. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  138. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  139. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  140. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  141. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  142. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  143. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  144. package/dist/encode/Base64Decode.mjs +1 -1
  145. package/dist/encode/Base64Encode.mjs +1 -1
  146. package/dist/error/BrowserAuthError.mjs +1 -1
  147. package/dist/error/BrowserAuthErrorCodes.mjs +5 -2
  148. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
  149. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  150. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  151. package/dist/error/NativeAuthError.mjs +1 -1
  152. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  153. package/dist/error/NestedAppAuthError.mjs +1 -1
  154. package/dist/event/EventHandler.mjs +1 -1
  155. package/dist/event/EventMessage.mjs +1 -1
  156. package/dist/event/EventType.mjs +1 -1
  157. package/dist/index.mjs +1 -1
  158. package/dist/interaction_client/BaseInteractionClient.mjs +6 -2
  159. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  160. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  161. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +6 -6
  162. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  163. package/dist/interaction_client/PopupClient.mjs +3 -3
  164. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  165. package/dist/interaction_client/RedirectClient.mjs +3 -3
  166. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  167. package/dist/interaction_client/SilentAuthCodeClient.mjs +3 -3
  168. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  169. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  170. package/dist/interaction_client/SilentIframeClient.mjs +3 -3
  171. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  172. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  173. package/dist/interaction_client/StandardInteractionClient.mjs +2 -1
  174. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  175. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  176. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  177. package/dist/log-strings-mapping.json +243 -247
  178. package/dist/naa/BridgeError.mjs +1 -1
  179. package/dist/naa/BridgeProxy.mjs +27 -32
  180. package/dist/naa/BridgeProxy.mjs.map +1 -1
  181. package/dist/naa/BridgeStatusCode.mjs +1 -1
  182. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +52 -25
  183. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  184. package/dist/navigation/NavigationClient.mjs +1 -1
  185. package/dist/network/FetchClient.mjs +1 -1
  186. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  187. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  188. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  189. package/dist/packageMetadata.mjs +2 -2
  190. package/dist/popup_relay/constants.mjs +1 -1
  191. package/dist/popup_relay/index.mjs +1 -1
  192. package/dist/popup_relay/relayClient.mjs +1 -1
  193. package/dist/protocol/Authorize.mjs +5 -3
  194. package/dist/protocol/Authorize.mjs.map +1 -1
  195. package/dist/redirect_bridge/index.mjs +1 -1
  196. package/dist/request/RequestHelpers.mjs +11 -3
  197. package/dist/request/RequestHelpers.mjs.map +1 -1
  198. package/dist/response/ResponseHandler.mjs +1 -1
  199. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  200. package/dist/telemetry/BrowserPerformanceEvents.mjs +5 -5
  201. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  202. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  203. package/dist/utils/BrowserConstants.mjs +1 -1
  204. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  205. package/dist/utils/BrowserUtils.mjs +1 -1
  206. package/dist/utils/Helpers.mjs +1 -1
  207. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  208. package/dist/webBrokerBridge/PendingRequestRegistry.mjs +64 -0
  209. package/dist/webBrokerBridge/PendingRequestRegistry.mjs.map +1 -0
  210. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs +39 -0
  211. package/dist/webBrokerBridge/WebBrokerBridgeError.mjs.map +1 -0
  212. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs +58 -0
  213. package/dist/webBrokerBridge/WebBrokerBridgeErrorMap.mjs.map +1 -0
  214. package/lib/custom-auth-path/log-strings-mapping.json +39 -43
  215. package/lib/custom-auth-path/msal-custom-auth.cjs +4390 -4069
  216. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  217. package/lib/custom-auth-path/msal-custom-auth.js +4390 -4069
  218. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  219. package/lib/log-strings-mapping.json +11 -15
  220. package/lib/msal-browser.cjs +827 -392
  221. package/lib/msal-browser.cjs.map +1 -1
  222. package/lib/msal-browser.js +827 -392
  223. package/lib/msal-browser.js.map +1 -1
  224. package/lib/msal-browser.min.js +2 -2
  225. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  226. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  227. package/lib/popup-relay/msal-popup-relay.js +2 -2
  228. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  229. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  230. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  231. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  232. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  233. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  234. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  235. package/package.json +2 -2
  236. package/src/cache/AsyncMemoryStorage.ts +7 -13
  237. package/src/controllers/StandardController.ts +38 -13
  238. package/src/crypto/BrowserCrypto.ts +10 -8
  239. package/src/crypto/CryptoOps.ts +138 -178
  240. package/src/crypto/SignedHttpRequest.ts +3 -0
  241. package/src/crypto/TokenBindingKeyManager.ts +299 -0
  242. package/src/custom_auth/controller/CustomAuthStandardController.ts +2 -1
  243. package/src/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.ts +8 -3
  244. package/src/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.ts +7 -3
  245. package/src/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.ts +1 -0
  246. package/src/error/BrowserAuthErrorCodes.ts +6 -0
  247. package/src/interaction_client/BaseInteractionClient.ts +8 -1
  248. package/src/interaction_client/PlatformAuthInteractionClient.ts +9 -3
  249. package/src/interaction_client/PopupClient.ts +5 -2
  250. package/src/interaction_client/RedirectClient.ts +5 -2
  251. package/src/interaction_client/SilentAuthCodeClient.ts +5 -2
  252. package/src/interaction_client/SilentIframeClient.ts +5 -2
  253. package/src/interaction_client/StandardInteractionClient.ts +1 -0
  254. package/src/naa/BridgeProxy.ts +38 -44
  255. package/src/naa/mapping/NestedAppAuthAdapter.ts +57 -55
  256. package/src/packageMetadata.ts +1 -1
  257. package/src/protocol/Authorize.ts +8 -1
  258. package/src/request/RequestHelpers.ts +19 -2
  259. package/src/telemetry/BrowserPerformanceEvents.ts +4 -4
  260. package/src/webBrokerBridge/PendingRequestRegistry.ts +2 -5
  261. package/types/cache/AsyncMemoryStorage.d.ts +1 -2
  262. package/types/cache/AsyncMemoryStorage.d.ts.map +1 -1
  263. package/types/controllers/StandardController.d.ts +2 -1
  264. package/types/controllers/StandardController.d.ts.map +1 -1
  265. package/types/crypto/BrowserCrypto.d.ts +2 -2
  266. package/types/crypto/BrowserCrypto.d.ts.map +1 -1
  267. package/types/crypto/CryptoOps.d.ts +7 -21
  268. package/types/crypto/CryptoOps.d.ts.map +1 -1
  269. package/types/crypto/SignedHttpRequest.d.ts.map +1 -1
  270. package/types/crypto/TokenBindingKeyManager.d.ts +83 -0
  271. package/types/crypto/TokenBindingKeyManager.d.ts.map +1 -0
  272. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  273. package/types/custom_auth/controller/CustomAuthStandardController.d.ts.map +1 -1
  274. package/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts +2 -2
  275. package/types/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.d.ts.map +1 -1
  276. package/types/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.d.ts +4 -3
  277. package/types/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.d.ts.map +1 -1
  278. package/types/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.d.ts.map +1 -1
  279. package/types/error/BrowserAuthErrorCodes.d.ts +3 -0
  280. package/types/error/BrowserAuthErrorCodes.d.ts.map +1 -1
  281. package/types/index.d.ts +1 -0
  282. package/types/index.d.ts.map +1 -1
  283. package/types/interaction_client/BaseInteractionClient.d.ts +3 -2
  284. package/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  285. package/types/interaction_client/PlatformAuthInteractionClient.d.ts +2 -2
  286. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  287. package/types/interaction_client/PopupClient.d.ts +2 -2
  288. package/types/interaction_client/PopupClient.d.ts.map +1 -1
  289. package/types/interaction_client/RedirectClient.d.ts +2 -2
  290. package/types/interaction_client/RedirectClient.d.ts.map +1 -1
  291. package/types/interaction_client/SilentAuthCodeClient.d.ts +2 -2
  292. package/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  293. package/types/interaction_client/SilentIframeClient.d.ts +2 -2
  294. package/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  295. package/types/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  296. package/types/naa/BridgeProxy.d.ts +14 -2
  297. package/types/naa/BridgeProxy.d.ts.map +1 -1
  298. package/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  299. package/types/packageMetadata.d.ts +1 -1
  300. package/types/protocol/Authorize.d.ts.map +1 -1
  301. package/types/request/RequestHelpers.d.ts.map +1 -1
  302. package/types/telemetry/BrowserPerformanceEvents.d.ts +4 -4
  303. package/types/webBrokerBridge/PendingRequestRegistry.d.ts +2 -2
  304. package/types/webBrokerBridge/PendingRequestRegistry.d.ts.map +1 -1
  305. package/src/naa/BridgeRequest.ts +0 -16
  306. package/types/naa/BridgeRequest.d.ts +0 -8
  307. package/types/naa/BridgeRequest.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v5.18.0 2026-08-04 */
1
+ /*! @azure/msal-browser v5.19.0 2026-08-18 */
2
2
  'use strict';
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
@@ -6,7 +6,7 @@
6
6
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.msal = {}));
7
7
  })(this, (function (exports) { 'use strict';
8
8
 
9
- /*! @azure/msal-common v16.12.0 2026-08-04 */
9
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
10
10
  /*
11
11
  * Copyright (c) Microsoft Corporation. All rights reserved.
12
12
  * Licensed under the MIT License.
@@ -59,7 +59,7 @@
59
59
  const CLI_DATA = "clidata";
60
60
  const ATTRIBUTE_TOKENS = "attribute_tokens";
61
61
 
62
- /*! @azure/msal-common v16.12.0 2026-08-04 */
62
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
63
63
  /*
64
64
  * Copyright (c) Microsoft Corporation. All rights reserved.
65
65
  * Licensed under the MIT License.
@@ -291,11 +291,12 @@
291
291
  Jwt: "JWT",
292
292
  Jwk: "JWK",
293
293
  Pop: "pop",
294
+ Dpop: "dpop+jwt",
294
295
  };
295
296
  // Token renewal offset default in seconds
296
297
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
297
298
 
298
- /*! @azure/msal-common v16.12.0 2026-08-04 */
299
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
299
300
  /*
300
301
  * Copyright (c) Microsoft Corporation. All rights reserved.
301
302
  * Licensed under the MIT License.
@@ -324,7 +325,7 @@
324
325
  return new AuthError(code, correlationId, additionalMessage || getDefaultErrorMessage$1(code));
325
326
  }
326
327
 
327
- /*! @azure/msal-common v16.12.0 2026-08-04 */
328
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
328
329
 
329
330
  /*
330
331
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -347,7 +348,7 @@
347
348
  return new ClientAuthError(errorCode, correlationId, additionalMessage);
348
349
  }
349
350
 
350
- /*! @azure/msal-common v16.12.0 2026-08-04 */
351
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
351
352
  /*
352
353
  * Copyright (c) Microsoft Corporation. All rights reserved.
353
354
  * Licensed under the MIT License.
@@ -431,7 +432,7 @@
431
432
  userCanceled: userCanceled
432
433
  });
433
434
 
434
- /*! @azure/msal-common v16.12.0 2026-08-04 */
435
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
435
436
 
436
437
  /*
437
438
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -469,7 +470,7 @@
469
470
  };
470
471
  }
471
472
 
472
- /*! @azure/msal-common v16.12.0 2026-08-04 */
473
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
473
474
 
474
475
  /*
475
476
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -535,7 +536,7 @@
535
536
  return matches[2];
536
537
  }
537
538
 
538
- /*! @azure/msal-common v16.12.0 2026-08-04 */
539
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
539
540
 
540
541
  /*
541
542
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -623,7 +624,7 @@
623
624
  return updatedAccountInfo;
624
625
  }
625
626
 
626
- /*! @azure/msal-common v16.12.0 2026-08-04 */
627
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
627
628
  /*
628
629
  * Copyright (c) Microsoft Corporation. All rights reserved.
629
630
  * Licensed under the MIT License.
@@ -638,7 +639,7 @@
638
639
  Ciam: 3,
639
640
  };
640
641
 
641
- /*! @azure/msal-common v16.12.0 2026-08-04 */
642
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
642
643
  /*
643
644
  * Copyright (c) Microsoft Corporation. All rights reserved.
644
645
  * Licensed under the MIT License.
@@ -660,7 +661,7 @@
660
661
  return null;
661
662
  }
662
663
 
663
- /*! @azure/msal-common v16.12.0 2026-08-04 */
664
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
664
665
  /*
665
666
  * Copyright (c) Microsoft Corporation. All rights reserved.
666
667
  * Licensed under the MIT License.
@@ -684,7 +685,7 @@
684
685
  EAR: "EAR",
685
686
  };
686
687
 
687
- /*! @azure/msal-common v16.12.0 2026-08-04 */
688
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
688
689
  /**
689
690
  * Returns the AccountInfo interface for this account.
690
691
  * @internal
@@ -873,7 +874,7 @@
873
874
  entity.hasOwnProperty("authorityType"));
874
875
  }
875
876
 
876
- /*! @azure/msal-common v16.12.0 2026-08-04 */
877
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
877
878
  /*
878
879
  * Copyright (c) Microsoft Corporation. All rights reserved.
879
880
  * Licensed under the MIT License.
@@ -890,7 +891,7 @@
890
891
  unexpectedError: unexpectedError
891
892
  });
892
893
 
893
- /*! @azure/msal-common v16.12.0 2026-08-04 */
894
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
894
895
 
895
896
  /*
896
897
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -910,7 +911,7 @@
910
911
  return new ClientConfigurationError(errorCode, correlationId);
911
912
  }
912
913
 
913
- /*! @azure/msal-common v16.12.0 2026-08-04 */
914
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
914
915
  /*
915
916
  * Copyright (c) Microsoft Corporation. All rights reserved.
916
917
  * Licensed under the MIT License.
@@ -931,6 +932,7 @@
931
932
  const untrustedAuthority = "untrusted_authority";
932
933
  const missingSshJwk = "missing_ssh_jwk";
933
934
  const missingSshKid = "missing_ssh_kid";
935
+ const unsupportedAuthenticationScheme = "unsupported_authentication_scheme";
934
936
  const missingNonceAuthenticationHeader = "missing_nonce_authentication_header";
935
937
  const invalidAuthenticationHeader = "invalid_authentication_header";
936
938
  const cannotSetOIDCOptions = "cannot_set_OIDCOptions";
@@ -969,12 +971,13 @@
969
971
  pkceParamsMissing: pkceParamsMissing,
970
972
  redirectUriEmpty: redirectUriEmpty,
971
973
  tokenRequestEmpty: tokenRequestEmpty,
974
+ unsupportedAuthenticationScheme: unsupportedAuthenticationScheme,
972
975
  untrustedAuthority: untrustedAuthority,
973
976
  urlEmptyError: urlEmptyError,
974
977
  urlParseError: urlParseError
975
978
  });
976
979
 
977
- /*! @azure/msal-common v16.12.0 2026-08-04 */
980
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
978
981
 
979
982
  /*
980
983
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1032,7 +1035,7 @@
1032
1035
  }
1033
1036
  }
1034
1037
 
1035
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1038
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1036
1039
  /*
1037
1040
  * Copyright (c) Microsoft Corporation. All rights reserved.
1038
1041
  * Licensed under the MIT License.
@@ -1044,7 +1047,7 @@
1044
1047
  response.hasOwnProperty("jwks_uri"));
1045
1048
  }
1046
1049
 
1047
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1050
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1048
1051
  /*
1049
1052
  * Copyright (c) Microsoft Corporation. All rights reserved.
1050
1053
  * Licensed under the MIT License.
@@ -1124,7 +1127,7 @@
1124
1127
  }
1125
1128
  }
1126
1129
 
1127
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1130
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1128
1131
 
1129
1132
  /*
1130
1133
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1282,7 +1285,7 @@
1282
1285
  }
1283
1286
  }
1284
1287
 
1285
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1288
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1286
1289
 
1287
1290
  /*
1288
1291
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1291,10 +1294,7 @@
1291
1294
  // Build endpoint metadata dynamically to avoid string duplication
1292
1295
  const endpointHosts = [
1293
1296
  { host: "login.microsoftonline.com" },
1294
- {
1295
- host: "login.chinacloudapi.cn",
1296
- issuerHost: "login.partner.microsoftonline.cn", // Issuer differs
1297
- },
1297
+ { host: "login.partner.microsoftonline.cn" },
1298
1298
  { host: "login.microsoftonline.us" },
1299
1299
  { host: "login.sovcloud-identity.fr" },
1300
1300
  { host: "login.sovcloud-identity.de" },
@@ -1448,7 +1448,7 @@
1448
1448
  return null;
1449
1449
  }
1450
1450
 
1451
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1451
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1452
1452
  /*
1453
1453
  * Copyright (c) Microsoft Corporation. All rights reserved.
1454
1454
  * Licensed under the MIT License.
@@ -1468,7 +1468,7 @@
1468
1468
  AzureUsGovernment: "https://login.microsoftonline.us",
1469
1469
  };
1470
1470
 
1471
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1471
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1472
1472
  /*
1473
1473
  * Copyright (c) Microsoft Corporation. All rights reserved.
1474
1474
  * Licensed under the MIT License.
@@ -1478,7 +1478,7 @@
1478
1478
  response.hasOwnProperty("metadata"));
1479
1479
  }
1480
1480
 
1481
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1481
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1482
1482
  /*
1483
1483
  * Copyright (c) Microsoft Corporation. All rights reserved.
1484
1484
  * Licensed under the MIT License.
@@ -1488,7 +1488,7 @@
1488
1488
  response.hasOwnProperty("error_description"));
1489
1489
  }
1490
1490
 
1491
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1491
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1492
1492
  /*
1493
1493
  * Copyright (c) Microsoft Corporation. All rights reserved.
1494
1494
  * Licensed under the MIT License.
@@ -1559,7 +1559,7 @@
1559
1559
  const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
1560
1560
  const SetUserData = "setUserData";
1561
1561
 
1562
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1562
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1563
1563
  /*
1564
1564
  * Copyright (c) Microsoft Corporation. All rights reserved.
1565
1565
  * Licensed under the MIT License.
@@ -1652,7 +1652,7 @@
1652
1652
  };
1653
1653
  };
1654
1654
 
1655
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1655
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1656
1656
 
1657
1657
  /*
1658
1658
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1763,7 +1763,7 @@
1763
1763
  },
1764
1764
  };
1765
1765
 
1766
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1766
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1767
1767
  /*
1768
1768
  * Copyright (c) Microsoft Corporation. All rights reserved.
1769
1769
  * Licensed under the MIT License.
@@ -1828,7 +1828,7 @@
1828
1828
  return cachedAtSec > nowSeconds();
1829
1829
  }
1830
1830
 
1831
- /*! @azure/msal-common v16.12.0 2026-08-04 */
1831
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
1832
1832
 
1833
1833
  /*
1834
1834
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1885,6 +1885,7 @@
1885
1885
  if (refreshOn) {
1886
1886
  atEntity.refreshOn = refreshOn.toString();
1887
1887
  }
1888
+ const normalizedTokenType = atEntity.tokenType?.toLowerCase();
1888
1889
  /*
1889
1890
  * Create Access Token With Auth Scheme instead of regular access token
1890
1891
  * Cast to lower to handle "bearer" from ADFS
@@ -1893,7 +1894,7 @@
1893
1894
  AuthenticationScheme$1.BEARER.toLowerCase()) {
1894
1895
  atEntity.credentialType =
1895
1896
  CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
1896
- switch (atEntity.tokenType) {
1897
+ switch (normalizedTokenType) {
1897
1898
  case AuthenticationScheme$1.POP:
1898
1899
  // Make sure keyId is present and add it to credential
1899
1900
  const tokenClaims = extractTokenClaims(accessToken, base64Decode, correlationId);
@@ -1902,6 +1903,12 @@
1902
1903
  }
1903
1904
  atEntity.keyId = tokenClaims.cnf.kid;
1904
1905
  break;
1906
+ case "dpop":
1907
+ if (!keyId) {
1908
+ throw createClientAuthError(keyIdMissing, correlationId);
1909
+ }
1910
+ atEntity.keyId = keyId;
1911
+ break;
1905
1912
  case AuthenticationScheme$1.SSH:
1906
1913
  atEntity.keyId = keyId;
1907
1914
  }
@@ -2108,7 +2115,7 @@
2108
2115
  return [...attributeTokens].sort().join(" ");
2109
2116
  }
2110
2117
 
2111
- /*! @azure/msal-common v16.12.0 2026-08-04 */
2118
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
2112
2119
 
2113
2120
  /*
2114
2121
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3078,7 +3085,7 @@
3078
3085
  };
3079
3086
  }
3080
3087
 
3081
- /*! @azure/msal-common v16.12.0 2026-08-04 */
3088
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
3082
3089
 
3083
3090
  /*
3084
3091
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3112,7 +3119,7 @@
3112
3119
  }
3113
3120
  }
3114
3121
 
3115
- /*! @azure/msal-common v16.12.0 2026-08-04 */
3122
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
3116
3123
 
3117
3124
  /*
3118
3125
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3308,7 +3315,7 @@
3308
3315
  }
3309
3316
  }
3310
3317
 
3311
- /*! @azure/msal-common v16.12.0 2026-08-04 */
3318
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
3312
3319
 
3313
3320
  /*
3314
3321
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3625,7 +3632,7 @@
3625
3632
  // Malformed JSON
3626
3633
  throw createClientConfigurationError(invalidClaims, correlationId);
3627
3634
  }
3628
- if (!isPlainObject(parsed)) {
3635
+ if (!isPlainObject$1(parsed)) {
3629
3636
  // Valid JSON, but not an object (e.g. an array, a scalar, or the literal `null`).
3630
3637
  throw createClientConfigurationError(invalidClaims, correlationId);
3631
3638
  }
@@ -3636,7 +3643,7 @@
3636
3643
  * @param value - The value to test
3637
3644
  * @returns True when value is a plain object that can be deep-merged
3638
3645
  */
3639
- function isPlainObject(value) {
3646
+ function isPlainObject$1(value) {
3640
3647
  return typeof value === "object" && value !== null && !Array.isArray(value);
3641
3648
  }
3642
3649
  /**
@@ -3653,7 +3660,7 @@
3653
3660
  const merged = { ...baseClaims };
3654
3661
  for (const [key, mergeInValue] of Object.entries(claimsToMerge)) {
3655
3662
  const baseValue = merged[key];
3656
- if (isPlainObject(baseValue) && isPlainObject(mergeInValue)) {
3663
+ if (isPlainObject$1(baseValue) && isPlainObject$1(mergeInValue)) {
3657
3664
  merged[key] = deepMergeClaims(baseValue, mergeInValue);
3658
3665
  }
3659
3666
  else {
@@ -3790,7 +3797,7 @@
3790
3797
  }
3791
3798
  }
3792
3799
 
3793
- /*! @azure/msal-common v16.12.0 2026-08-04 */
3800
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
3794
3801
 
3795
3802
  /*
3796
3803
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3912,12 +3919,20 @@
3912
3919
  }
3913
3920
  }
3914
3921
 
3915
- /*! @azure/msal-common v16.12.0 2026-08-04 */
3922
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
3916
3923
 
3917
3924
  /*
3918
3925
  * Copyright (c) Microsoft Corporation. All rights reserved.
3919
3926
  * Licensed under the MIT License.
3920
3927
  */
3928
+ /**
3929
+ * Shared JOSE algorithm literals used by MSAL package internals.
3930
+ * @internal
3931
+ */
3932
+ const JsonWebTokenAlgorithms = {
3933
+ ES256: "ES256",
3934
+ RS256: "RS256",
3935
+ };
3921
3936
  /**
3922
3937
  * Default crypto implementation used when a platform-specific implementation has
3923
3938
  * not been provided.
@@ -3938,24 +3953,44 @@
3938
3953
  encodeKid: () => {
3939
3954
  throw createClientAuthError(methodNotImplemented, "");
3940
3955
  },
3941
- async getPublicKeyThumbprint() {
3942
- throw createClientAuthError(methodNotImplemented, "");
3943
- },
3944
- async removeTokenBindingKey() {
3945
- throw createClientAuthError(methodNotImplemented, "");
3956
+ async removeTokenBindingKey(kid, correlationId) {
3957
+ throw createClientAuthError(methodNotImplemented, correlationId);
3946
3958
  },
3947
- async clearKeystore() {
3948
- throw createClientAuthError(methodNotImplemented, "");
3959
+ async clearKeystore(correlationId) {
3960
+ throw createClientAuthError(methodNotImplemented, correlationId);
3949
3961
  },
3950
- async signJwt() {
3951
- throw createClientAuthError(methodNotImplemented, "");
3962
+ async signTokenBindingJwt(header, payload, kid, correlationId) {
3963
+ throw createClientAuthError(methodNotImplemented, correlationId);
3952
3964
  },
3953
3965
  async hashString() {
3954
3966
  throw createClientAuthError(methodNotImplemented, "");
3955
3967
  },
3956
3968
  };
3957
3969
 
3958
- /*! @azure/msal-common v16.12.0 2026-08-04 */
3970
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
3971
+
3972
+ /*
3973
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3974
+ * Licensed under the MIT License.
3975
+ */
3976
+ /**
3977
+ * Default token-binding key manager used when a platform-specific implementation
3978
+ * has not been provided.
3979
+ * @internal
3980
+ */
3981
+ const DEFAULT_TOKEN_BINDING_KEY_MANAGER = {
3982
+ async provisionTokenBindingKey(request) {
3983
+ throw createClientAuthError(methodNotImplemented, request.correlationId);
3984
+ },
3985
+ async removeTokenBindingKey(_kid, correlationId) {
3986
+ throw createClientAuthError(methodNotImplemented, correlationId);
3987
+ },
3988
+ async getTokenBindingPublicKeyJwk(_kid, correlationId) {
3989
+ throw createClientAuthError(methodNotImplemented, correlationId);
3990
+ },
3991
+ };
3992
+
3993
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
3959
3994
  /*
3960
3995
  * Copyright (c) Microsoft Corporation. All rights reserved.
3961
3996
  * Licensed under the MIT License.
@@ -4244,12 +4279,12 @@
4244
4279
  }
4245
4280
  }
4246
4281
 
4247
- /*! @azure/msal-common v16.12.0 2026-08-04 */
4282
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
4248
4283
  /* eslint-disable header/header */
4249
4284
  const name$1 = "@azure/msal-common";
4250
- const version$1 = "16.12.0";
4285
+ const version$1 = "16.13.0";
4251
4286
 
4252
- /*! @azure/msal-common v16.12.0 2026-08-04 */
4287
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
4253
4288
  /*
4254
4289
  * Copyright (c) Microsoft Corporation. All rights reserved.
4255
4290
  * Licensed under the MIT License.
@@ -4257,7 +4292,7 @@
4257
4292
  const cacheQuotaExceeded = "cache_quota_exceeded";
4258
4293
  const cacheErrorUnknown = "cache_error_unknown";
4259
4294
 
4260
- /*! @azure/msal-common v16.12.0 2026-08-04 */
4295
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
4261
4296
 
4262
4297
  /*
4263
4298
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4295,7 +4330,7 @@
4295
4330
  }
4296
4331
  }
4297
4332
 
4298
- /*! @azure/msal-common v16.12.0 2026-08-04 */
4333
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
4299
4334
 
4300
4335
  /*
4301
4336
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4656,16 +4691,9 @@
4656
4691
  // Access Token with Auth Scheme specific matching
4657
4692
  if (entity.credentialType ===
4658
4693
  CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME) {
4659
- if (!!filter.tokenType &&
4660
- !this.matchTokenType(entity, filter.tokenType)) {
4694
+ if (!this.matchAccessTokenWithAuthScheme(entity, filter)) {
4661
4695
  return false;
4662
4696
  }
4663
- // KeyId (sshKid) in request must match cached SSH certificate keyId because SSH cert is bound to a specific key
4664
- if (filter.tokenType === AuthenticationScheme$1.SSH) {
4665
- if (filter.keyId && !this.matchKeyId(entity, filter.keyId)) {
4666
- return false;
4667
- }
4668
- }
4669
4697
  }
4670
4698
  // Additional cache key components matching (bidirectional isolation)
4671
4699
  const entityComponents = entity.additionalCacheKeyComponents;
@@ -4982,7 +5010,9 @@
4982
5010
  realm: targetRealm || account.tenantId,
4983
5011
  target: scopes,
4984
5012
  tokenType: authScheme,
4985
- keyId: request.sshKid,
5013
+ keyId: authScheme === AuthenticationScheme$1.SSH
5014
+ ? request.sshKid
5015
+ : undefined,
4986
5016
  additionalCacheKeyComponents: additionalCacheKeyComponents,
4987
5017
  };
4988
5018
  const accessTokenKeys = (tokenKeys && tokenKeys.accessToken) ||
@@ -5344,7 +5374,29 @@
5344
5374
  * @param tokenType
5345
5375
  */
5346
5376
  matchTokenType(entity, tokenType) {
5347
- return !!(entity.tokenType && entity.tokenType === tokenType);
5377
+ return !!(entity.tokenType &&
5378
+ entity.tokenType.toLowerCase() === tokenType.toLowerCase());
5379
+ }
5380
+ matchAccessTokenWithAuthScheme(entity, filter) {
5381
+ const normalizedFilterTokenType = filter.tokenType?.toLowerCase();
5382
+ if (!!filter.tokenType &&
5383
+ !this.matchTokenType(entity, filter.tokenType)) {
5384
+ return false;
5385
+ }
5386
+ switch (normalizedFilterTokenType) {
5387
+ case "dpop":
5388
+ return this.matchKeyBoundAccessToken(entity, filter, true);
5389
+ case AuthenticationScheme$1.SSH:
5390
+ return this.matchKeyBoundAccessToken(entity, filter, false);
5391
+ default:
5392
+ return true;
5393
+ }
5394
+ }
5395
+ matchKeyBoundAccessToken(entity, filter, requireKeyId) {
5396
+ if (!filter.keyId) {
5397
+ return !requireKeyId;
5398
+ }
5399
+ return this.matchKeyId(entity, filter.keyId);
5348
5400
  }
5349
5401
  /**
5350
5402
  * Returns true if the credential's keyId matches the one in the request, false otherwise
@@ -5461,7 +5513,7 @@
5461
5513
  }
5462
5514
  }
5463
5515
 
5464
- /*! @azure/msal-common v16.12.0 2026-08-04 */
5516
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5465
5517
  /*
5466
5518
  * Copyright (c) Microsoft Corporation. All rights reserved.
5467
5519
  * Licensed under the MIT License.
@@ -5526,7 +5578,7 @@
5526
5578
  "fetchRetryCount",
5527
5579
  ]);
5528
5580
 
5529
- /*! @azure/msal-common v16.12.0 2026-08-04 */
5581
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5530
5582
 
5531
5583
  /*
5532
5584
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5584,7 +5636,7 @@
5584
5636
  }
5585
5637
  }
5586
5638
 
5587
- /*! @azure/msal-common v16.12.0 2026-08-04 */
5639
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5588
5640
 
5589
5641
  /*
5590
5642
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5638,7 +5690,7 @@
5638
5690
  * @returns Configuration
5639
5691
  * @internal
5640
5692
  */
5641
- function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
5693
+ function buildClientConfiguration({ authOptions: userAuthOptions, systemOptions: userSystemOptions, loggerOptions: userLoggerOption, storageInterface: storageImplementation, networkInterface: networkImplementation, cryptoInterface: cryptoImplementation, tokenBindingKeyManager: tokenBindingKeyManager, clientCredentials: clientCredentials, libraryInfo: libraryInfo, telemetry: telemetry, serverTelemetryManager: serverTelemetryManager, persistencePlugin: persistencePlugin, serializableCache: serializableCache, }) {
5642
5694
  const loggerOptions = {
5643
5695
  ...DEFAULT_LOGGER_IMPLEMENTATION,
5644
5696
  ...userLoggerOption,
@@ -5651,6 +5703,7 @@
5651
5703
  new DefaultStorageClass(userAuthOptions.clientId, DEFAULT_CRYPTO_IMPLEMENTATION, new Logger(loggerOptions, name$1, version$1), new StubPerformanceClient()),
5652
5704
  networkInterface: networkImplementation || DEFAULT_NETWORK_IMPLEMENTATION,
5653
5705
  cryptoInterface: cryptoImplementation || DEFAULT_CRYPTO_IMPLEMENTATION,
5706
+ tokenBindingKeyManager: tokenBindingKeyManager || DEFAULT_TOKEN_BINDING_KEY_MANAGER,
5654
5707
  clientCredentials: clientCredentials || DEFAULT_CLIENT_CREDENTIALS,
5655
5708
  libraryInfo: { ...DEFAULT_LIBRARY_INFO, ...libraryInfo },
5656
5709
  telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...telemetry },
@@ -5680,7 +5733,7 @@
5680
5733
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5681
5734
  }
5682
5735
 
5683
- /*! @azure/msal-common v16.12.0 2026-08-04 */
5736
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5684
5737
  /*
5685
5738
  * Copyright (c) Microsoft Corporation. All rights reserved.
5686
5739
  * Licensed under the MIT License.
@@ -5707,7 +5760,129 @@
5707
5760
  }
5708
5761
  }
5709
5762
 
5710
- /*! @azure/msal-common v16.12.0 2026-08-04 */
5763
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5764
+
5765
+ /*
5766
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5767
+ * Licensed under the MIT License.
5768
+ */
5769
+ /**
5770
+ * Error thrown when there is an error in the client code running on the browser.
5771
+ */
5772
+ class JoseHeaderError extends AuthError {
5773
+ constructor(errorCode, correlationId, errorMessage) {
5774
+ super(errorCode, correlationId, errorMessage);
5775
+ this.name = "JoseHeaderError";
5776
+ Object.setPrototypeOf(this, JoseHeaderError.prototype);
5777
+ }
5778
+ }
5779
+ /** Returns JoseHeaderError object */
5780
+ function createJoseHeaderError(code, correlationId) {
5781
+ return new JoseHeaderError(code, correlationId);
5782
+ }
5783
+
5784
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5785
+ /*
5786
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5787
+ * Licensed under the MIT License.
5788
+ */
5789
+ /**
5790
+ * Checks whether a value is a plain JSON-like object.
5791
+ * Allows objects with null prototypes, but rejects arrays and object subclasses.
5792
+ */
5793
+ function isPlainObject(value) {
5794
+ if (typeof value !== "object" ||
5795
+ value === null ||
5796
+ Object.prototype.toString.call(value) !== "[object Object]") {
5797
+ return false;
5798
+ }
5799
+ if (Object.getPrototypeOf(value) === null) {
5800
+ return true;
5801
+ }
5802
+ let proto = value;
5803
+ while (Object.getPrototypeOf(proto) !== null) {
5804
+ proto = Object.getPrototypeOf(proto);
5805
+ }
5806
+ return Object.getPrototypeOf(value) === proto;
5807
+ }
5808
+
5809
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5810
+ /*
5811
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5812
+ * Licensed under the MIT License.
5813
+ */
5814
+ const missingKidError = "missing_kid_error";
5815
+ const missingAlgError = "missing_alg_error";
5816
+ const missingJwkError = "missing_jwk_error";
5817
+ const invalidJwkError = "invalid_jwk_error";
5818
+
5819
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5820
+
5821
+ /*
5822
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5823
+ * Licensed under the MIT License.
5824
+ */
5825
+ /** @internal */
5826
+ class JoseHeader {
5827
+ constructor(options, correlationId) {
5828
+ if (typeof options.alg !== "string" || !options.alg) {
5829
+ throw createJoseHeaderError(missingAlgError, correlationId);
5830
+ }
5831
+ this.typ = options.typ;
5832
+ this.alg = options.alg;
5833
+ this.kid = options.kid;
5834
+ this.jwk = options.jwk;
5835
+ }
5836
+ /**
5837
+ * Builds SignedHttpRequest formatted JOSE Header from the
5838
+ * JOSE Header options provided or previously set on the object.
5839
+ * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
5840
+ * @param shrHeaderOptions
5841
+ * @param correlationId
5842
+ * @returns
5843
+ */
5844
+ static getShrHeader(shrHeaderOptions, correlationId) {
5845
+ // KeyID is required on the SHR header
5846
+ if (!shrHeaderOptions.kid) {
5847
+ throw createJoseHeaderError(missingKidError, correlationId);
5848
+ }
5849
+ // Alg is required on the SHR header
5850
+ if (!shrHeaderOptions.alg) {
5851
+ throw createJoseHeaderError(missingAlgError, correlationId);
5852
+ }
5853
+ return new JoseHeader({
5854
+ // Access Token PoP headers must have type pop, but the type header can be overriden for special cases
5855
+ typ: shrHeaderOptions.typ || JsonWebTokenTypes$1.Pop,
5856
+ kid: shrHeaderOptions.kid,
5857
+ alg: shrHeaderOptions.alg,
5858
+ }, correlationId);
5859
+ }
5860
+ /**
5861
+ * Builds a DPoP formatted JOSE Header from the JOSE Header options provided.
5862
+ * Throws if public JWK or algorithm aren't provided since they are required for DPoP.
5863
+ * @param dpopHeaderOptions
5864
+ * @param correlationId
5865
+ * @returns
5866
+ */
5867
+ static getDpopHeader(dpopHeaderOptions, correlationId) {
5868
+ if (!isPlainObject(dpopHeaderOptions.jwk)) {
5869
+ throw createJoseHeaderError(missingJwkError, correlationId);
5870
+ }
5871
+ if (!dpopHeaderOptions.alg) {
5872
+ throw createJoseHeaderError(missingAlgError, correlationId);
5873
+ }
5874
+ if (Object.keys(dpopHeaderOptions.jwk).length === 0) {
5875
+ throw createJoseHeaderError(invalidJwkError, correlationId);
5876
+ }
5877
+ return new JoseHeader({
5878
+ typ: JsonWebTokenTypes$1.Dpop,
5879
+ alg: dpopHeaderOptions.alg,
5880
+ jwk: dpopHeaderOptions.jwk,
5881
+ }, correlationId);
5882
+ }
5883
+ }
5884
+
5885
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5711
5886
 
5712
5887
  /*
5713
5888
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5715,10 +5890,13 @@
5715
5890
  */
5716
5891
  const KeyLocation = {
5717
5892
  SW: "sw"};
5893
+ const SHR_TOKEN_BINDING_KEY_TYPE = "shr";
5894
+ const SHR_TOKEN_BINDING_KEY_ALGORITHM = JsonWebTokenAlgorithms.RS256;
5718
5895
  /** @internal */
5719
5896
  class PopTokenGenerator {
5720
- constructor(cryptoUtils, performanceClient) {
5897
+ constructor(cryptoUtils, tokenBindingKeyManager, performanceClient) {
5721
5898
  this.cryptoUtils = cryptoUtils;
5899
+ this.tokenBindingKeyManager = tokenBindingKeyManager;
5722
5900
  this.performanceClient = performanceClient;
5723
5901
  }
5724
5902
  /**
@@ -5741,7 +5919,11 @@
5741
5919
  * @returns
5742
5920
  */
5743
5921
  async generateKid(request) {
5744
- const kidThumbprint = await this.cryptoUtils.getPublicKeyThumbprint(request);
5922
+ const kidThumbprint = await this.tokenBindingKeyManager.provisionTokenBindingKey({
5923
+ correlationId: request.correlationId,
5924
+ tokenBindingKeyType: SHR_TOKEN_BINDING_KEY_TYPE,
5925
+ tokenBindingKeyAlgorithm: SHR_TOKEN_BINDING_KEY_ALGORITHM,
5926
+ });
5745
5927
  return {
5746
5928
  kid: kidThumbprint,
5747
5929
  xms_ksl: KeyLocation.SW,
@@ -5771,7 +5953,17 @@
5771
5953
  ? new UrlString(resourceRequestUri, request.correlationId)
5772
5954
  : undefined;
5773
5955
  const resourceUrlComponents = resourceUrlString?.getUrlComponents();
5774
- return this.cryptoUtils.signJwt({
5956
+ const publicKeyJwk = await this.tokenBindingKeyManager.getTokenBindingPublicKeyJwk(keyId, request.correlationId);
5957
+ const encodedKeyIdThumbprint = this.cryptoUtils.base64UrlEncode(JSON.stringify({ kid: keyId }));
5958
+ const shrAlgorithm = shrOptions?.header?.alg ||
5959
+ publicKeyJwk.alg ||
5960
+ SHR_TOKEN_BINDING_KEY_ALGORITHM;
5961
+ const shrHeader = JoseHeader.getShrHeader({
5962
+ ...shrOptions?.header,
5963
+ alg: shrAlgorithm,
5964
+ kid: encodedKeyIdThumbprint,
5965
+ }, request.correlationId);
5966
+ const shrPayload = {
5775
5967
  at: payload,
5776
5968
  ts: nowSeconds(),
5777
5969
  m: resourceRequestMethod?.toUpperCase(),
@@ -5783,11 +5975,15 @@
5783
5975
  : undefined,
5784
5976
  client_claims: shrClaims || undefined,
5785
5977
  ...claims,
5786
- }, keyId, shrOptions, request.correlationId);
5978
+ cnf: {
5979
+ jwk: publicKeyJwk,
5980
+ },
5981
+ };
5982
+ return this.cryptoUtils.signTokenBindingJwt(shrHeader, shrPayload, keyId, request.correlationId);
5787
5983
  }
5788
5984
  }
5789
5985
 
5790
- /*! @azure/msal-common v16.12.0 2026-08-04 */
5986
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5791
5987
  /*
5792
5988
  * Copyright (c) Microsoft Corporation. All rights reserved.
5793
5989
  * Licensed under the MIT License.
@@ -5851,7 +6047,7 @@
5851
6047
  uiNotAllowed: uiNotAllowed
5852
6048
  });
5853
6049
 
5854
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6050
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5855
6051
 
5856
6052
  /*
5857
6053
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5918,7 +6114,7 @@
5918
6114
  return new InteractionRequiredAuthError(errorCode, correlationId, errorMessage);
5919
6115
  }
5920
6116
 
5921
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6117
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5922
6118
 
5923
6119
  /*
5924
6120
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5937,7 +6133,7 @@
5937
6133
  }
5938
6134
  }
5939
6135
 
5940
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6136
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
5941
6137
 
5942
6138
  /*
5943
6139
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6008,7 +6204,7 @@
6008
6204
  }
6009
6205
  }
6010
6206
 
6011
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6207
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6012
6208
 
6013
6209
  /*
6014
6210
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6019,10 +6215,11 @@
6019
6215
  * @internal
6020
6216
  */
6021
6217
  class ResponseHandler {
6022
- constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin) {
6218
+ constructor(clientId, cacheStorage, cryptoObj, logger, performanceClient, serializableCache, persistencePlugin, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER) {
6023
6219
  this.clientId = clientId;
6024
6220
  this.cacheStorage = cacheStorage;
6025
6221
  this.cryptoObj = cryptoObj;
6222
+ this.tokenBindingKeyManager = tokenBindingKeyManager;
6026
6223
  this.logger = logger;
6027
6224
  this.performanceClient = performanceClient;
6028
6225
  this.serializableCache = serializableCache;
@@ -6131,7 +6328,12 @@
6131
6328
  this.performanceClient?.addFields({
6132
6329
  acntLoggedOut: true,
6133
6330
  }, request.correlationId);
6134
- return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient, idTokenClaims, requestStateObj, undefined, serverRequestId);
6331
+ return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient, {
6332
+ idTokenClaims,
6333
+ requestState: requestStateObj,
6334
+ requestId: serverRequestId,
6335
+ tokenBindingKeyManager: this.tokenBindingKeyManager,
6336
+ });
6135
6337
  }
6136
6338
  }
6137
6339
  await this.cacheStorage.saveCacheRecord(cacheRecord, request.correlationId, isKmsi(idTokenClaims || {}), apiId, request.storeInCache);
@@ -6144,7 +6346,13 @@
6144
6346
  await this.persistencePlugin.afterCacheAccess(cacheContext);
6145
6347
  }
6146
6348
  }
6147
- return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient, idTokenClaims, requestStateObj, serverTokenResponse, serverRequestId);
6349
+ return ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, this.performanceClient, {
6350
+ idTokenClaims,
6351
+ requestState: requestStateObj,
6352
+ serverTokenResponse,
6353
+ requestId: serverRequestId,
6354
+ tokenBindingKeyManager: this.tokenBindingKeyManager,
6355
+ });
6148
6356
  }
6149
6357
  /**
6150
6358
  * Generates CacheRecord
@@ -6240,7 +6448,8 @@
6240
6448
  * @param fromTokenCache
6241
6449
  * @param stateString
6242
6450
  */
6243
- static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, performanceClient, idTokenClaims, requestState, serverTokenResponse, requestId) {
6451
+ static async generateAuthenticationResult(cryptoObj, authority, cacheRecord, fromTokenCache, request, performanceClient, options = {}) {
6452
+ const { idTokenClaims, requestState, serverTokenResponse, requestId, tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER, } = options;
6244
6453
  let accessToken = "";
6245
6454
  let responseScopes = [];
6246
6455
  let expiresOn = null;
@@ -6255,7 +6464,7 @@
6255
6464
  if (cacheRecord.accessToken.tokenType ===
6256
6465
  AuthenticationScheme$1.POP &&
6257
6466
  !request.popKid) {
6258
- const popTokenGenerator = new PopTokenGenerator(cryptoObj, performanceClient);
6467
+ const popTokenGenerator = new PopTokenGenerator(cryptoObj, tokenBindingKeyManager, performanceClient);
6259
6468
  const { secret, keyId } = cacheRecord.accessToken;
6260
6469
  if (!keyId) {
6261
6470
  throw createClientAuthError(keyIdMissing, request.correlationId);
@@ -6367,7 +6576,7 @@
6367
6576
  return baseAccount;
6368
6577
  }
6369
6578
 
6370
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6579
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6371
6580
  /*
6372
6581
  * Copyright (c) Microsoft Corporation. All rights reserved.
6373
6582
  * Licensed under the MIT License.
@@ -6377,7 +6586,7 @@
6377
6586
  UPN: "UPN",
6378
6587
  };
6379
6588
 
6380
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6589
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6381
6590
  /*
6382
6591
  * Copyright (c) Microsoft Corporation. All rights reserved.
6383
6592
  * Licensed under the MIT License.
@@ -6396,7 +6605,7 @@
6396
6605
  }
6397
6606
  }
6398
6607
 
6399
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6608
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6400
6609
 
6401
6610
  /*
6402
6611
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6420,7 +6629,7 @@
6420
6629
  };
6421
6630
  }
6422
6631
 
6423
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6632
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6424
6633
 
6425
6634
  /*
6426
6635
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6506,7 +6715,7 @@
6506
6715
  }
6507
6716
  }
6508
6717
 
6509
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6718
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6510
6719
 
6511
6720
  /*
6512
6721
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6537,7 +6746,7 @@
6537
6746
  return new NetworkError(error, httpStatus, responseHeaders);
6538
6747
  }
6539
6748
 
6540
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6749
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6541
6750
 
6542
6751
  /*
6543
6752
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6653,7 +6862,7 @@
6653
6862
  return response;
6654
6863
  }
6655
6864
 
6656
- /*! @azure/msal-common v16.12.0 2026-08-04 */
6865
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6657
6866
 
6658
6867
  /*
6659
6868
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6703,7 +6912,7 @@
6703
6912
  const response = await invokeAsync(this.executeTokenRequest.bind(this), AuthClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(this.authority, request, this.serverTelemetryManager);
6704
6913
  // Retrieve requestId from response headers
6705
6914
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
6706
- const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin);
6915
+ const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager);
6707
6916
  // Validate response. This function throws a server error if an error is returned by the server.
6708
6917
  responseHandler.validateTokenResponse(response.body, request.correlationId);
6709
6918
  return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, authCodePayload, undefined, undefined, undefined, requestId);
@@ -6804,7 +7013,7 @@
6804
7013
  addGrantType(parameters, GrantType.AUTHORIZATION_CODE_GRANT);
6805
7014
  addClientInfo(parameters);
6806
7015
  if (request.authenticationScheme === AuthenticationScheme$1.POP) {
6807
- const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
7016
+ const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.config.tokenBindingKeyManager, this.performanceClient);
6808
7017
  let reqCnfData;
6809
7018
  if (!request.popKid) {
6810
7019
  const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
@@ -6916,7 +7125,7 @@
6916
7125
  }
6917
7126
  }
6918
7127
 
6919
- /*! @azure/msal-common v16.12.0 2026-08-04 */
7128
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
6920
7129
 
6921
7130
  /*
6922
7131
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7143,76 +7352,7 @@
7143
7352
  return account.loginHint || account.idTokenClaims?.login_hint || null;
7144
7353
  }
7145
7354
 
7146
- /*! @azure/msal-common v16.12.0 2026-08-04 */
7147
-
7148
- /*
7149
- * Copyright (c) Microsoft Corporation. All rights reserved.
7150
- * Licensed under the MIT License.
7151
- */
7152
- /**
7153
- * Error thrown when there is an error in the client code running on the browser.
7154
- */
7155
- class JoseHeaderError extends AuthError {
7156
- constructor(errorCode, correlationId, errorMessage) {
7157
- super(errorCode, correlationId, errorMessage);
7158
- this.name = "JoseHeaderError";
7159
- Object.setPrototypeOf(this, JoseHeaderError.prototype);
7160
- }
7161
- }
7162
- /** Returns JoseHeaderError object */
7163
- function createJoseHeaderError(code, correlationId) {
7164
- return new JoseHeaderError(code, correlationId);
7165
- }
7166
-
7167
- /*! @azure/msal-common v16.12.0 2026-08-04 */
7168
- /*
7169
- * Copyright (c) Microsoft Corporation. All rights reserved.
7170
- * Licensed under the MIT License.
7171
- */
7172
- const missingKidError = "missing_kid_error";
7173
- const missingAlgError = "missing_alg_error";
7174
-
7175
- /*! @azure/msal-common v16.12.0 2026-08-04 */
7176
-
7177
- /*
7178
- * Copyright (c) Microsoft Corporation. All rights reserved.
7179
- * Licensed under the MIT License.
7180
- */
7181
- /** @internal */
7182
- class JoseHeader {
7183
- constructor(options) {
7184
- this.typ = options.typ;
7185
- this.alg = options.alg;
7186
- this.kid = options.kid;
7187
- }
7188
- /**
7189
- * Builds SignedHttpRequest formatted JOSE Header from the
7190
- * JOSE Header options provided or previously set on the object and returns
7191
- * the stringified header object.
7192
- * Throws if keyId or algorithm aren't provided since they are required for Access Token Binding.
7193
- * @param shrHeaderOptions
7194
- * @returns
7195
- */
7196
- static getShrHeaderString(shrHeaderOptions) {
7197
- // KeyID is required on the SHR header
7198
- if (!shrHeaderOptions.kid) {
7199
- throw createJoseHeaderError(missingKidError, "");
7200
- }
7201
- // Alg is required on the SHR header
7202
- if (!shrHeaderOptions.alg) {
7203
- throw createJoseHeaderError(missingAlgError, "");
7204
- }
7205
- const shrHeader = new JoseHeader({
7206
- // Access Token PoP headers must have type pop, but the type header can be overriden for special cases
7207
- typ: shrHeaderOptions.typ || JsonWebTokenTypes$1.Pop,
7208
- kid: shrHeaderOptions.kid,
7209
- alg: shrHeaderOptions.alg,
7210
- });
7211
- return JSON.stringify(shrHeader);
7212
- }
7213
- }
7214
-
7215
- /*! @azure/msal-common v16.12.0 2026-08-04 */
7355
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
7216
7356
 
7217
7357
  /*
7218
7358
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7761,7 +7901,7 @@
7761
7901
  }
7762
7902
  }
7763
7903
 
7764
- /*! @azure/msal-common v16.12.0 2026-08-04 */
7904
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
7765
7905
 
7766
7906
  /*
7767
7907
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7796,7 +7936,7 @@
7796
7936
  const response = await invokeAsync(this.executeTokenRequest.bind(this), RefreshTokenClientExecuteTokenRequest, this.logger, this.performanceClient, request.correlationId)(request, this.authority);
7797
7937
  // Retrieve requestId from response headers
7798
7938
  const requestId = response.headers?.[HeaderNames.X_MS_REQUEST_ID];
7799
- const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin);
7939
+ const responseHandler = new ResponseHandler(this.config.authOptions.clientId, this.cacheManager, this.cryptoUtils, this.logger, this.performanceClient, this.config.serializableCache, this.config.persistencePlugin, this.config.tokenBindingKeyManager);
7800
7940
  responseHandler.validateTokenResponse(response.body, request.correlationId);
7801
7941
  return invokeAsync(responseHandler.handleServerTokenResponse.bind(responseHandler), HandleServerTokenResponse, this.logger, this.performanceClient, request.correlationId)(response.body, this.authority, reqTimestamp, request, apiId, undefined, undefined, true, request.forceCache, requestId);
7802
7942
  }
@@ -7937,7 +8077,7 @@
7937
8077
  addClientAssertionType(parameters, clientAssertion.assertionType);
7938
8078
  }
7939
8079
  if (request.authenticationScheme === AuthenticationScheme$1.POP) {
7940
- const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.performanceClient);
8080
+ const popTokenGenerator = new PopTokenGenerator(this.cryptoUtils, this.config.tokenBindingKeyManager, this.performanceClient);
7941
8081
  let reqCnfData;
7942
8082
  if (!request.popKid) {
7943
8083
  const generatedReqCnfData = await invokeAsync(popTokenGenerator.generateCnf.bind(popTokenGenerator), PopTokenGenerateCnf, this.logger, this.performanceClient, request.correlationId)(request, this.logger);
@@ -7988,7 +8128,7 @@
7988
8128
  }
7989
8129
  }
7990
8130
 
7991
- /*! @azure/msal-common v16.12.0 2026-08-04 */
8131
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
7992
8132
 
7993
8133
  /*
7994
8134
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8281,7 +8421,7 @@
8281
8421
  clearNativeBrokerErrorCode() { }
8282
8422
  }
8283
8423
 
8284
- /*! @azure/msal-common v16.12.0 2026-08-04 */
8424
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
8285
8425
 
8286
8426
  /*
8287
8427
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8385,11 +8525,14 @@
8385
8525
  if (cacheRecord.idToken) {
8386
8526
  idTokenClaims = extractTokenClaims(cacheRecord.idToken.secret, this.config.cryptoInterface.base64Decode, request.correlationId);
8387
8527
  }
8388
- return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, this.performanceClient, idTokenClaims);
8528
+ return ResponseHandler.generateAuthenticationResult(this.cryptoUtils, this.authority, cacheRecord, true, request, this.performanceClient, {
8529
+ idTokenClaims,
8530
+ tokenBindingKeyManager: this.config.tokenBindingKeyManager,
8531
+ });
8389
8532
  }
8390
8533
  }
8391
8534
 
8392
- /*! @azure/msal-common v16.12.0 2026-08-04 */
8535
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
8393
8536
 
8394
8537
  /*
8395
8538
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8405,7 +8548,7 @@
8405
8548
  },
8406
8549
  };
8407
8550
 
8408
- /*! @azure/msal-common v16.12.0 2026-08-04 */
8551
+ /*! @azure/msal-common v16.13.0 2026-08-18 */
8409
8552
 
8410
8553
  /*
8411
8554
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8458,13 +8601,13 @@
8458
8601
  */
8459
8602
  const AcquireTokenSilentAsync = "acquireTokenSilentAsync";
8460
8603
  /**
8461
- * getPublicKeyThumbprint API in CryptoOpts class (msal-browser).
8462
- * Used to generate a public/private keypair and generate a public key thumbprint for pop requests.
8604
+ * provisionTokenBindingKey API in TokenBindingKeyManager class (msal-browser).
8605
+ * Used to provision token-binding key material and return a key identifier.
8463
8606
  */
8464
8607
  const CryptoOptsGetPublicKeyThumbprint = "cryptoOptsGetPublicKeyThumbprint";
8465
8608
  /**
8466
- * signJwt API in CryptoOpts class (msal-browser).
8467
- * Used to signed a pop token.
8609
+ * signTokenBindingJwt API in CryptoOpts class (msal-browser).
8610
+ * Used to sign token-binding JWTs.
8468
8611
  */
8469
8612
  const CryptoOptsSignJwt = "cryptoOptsSignJwt";
8470
8613
  /**
@@ -8621,6 +8764,9 @@
8621
8764
  const nativePromptNotSupported = "native_prompt_not_supported";
8622
8765
  const invalidBase64String = "invalid_base64_string";
8623
8766
  const invalidPopTokenRequest = "invalid_pop_token_request";
8767
+ const unsupportedTokenBindingAlgorithm = "unsupported_token_binding_algorithm";
8768
+ const tokenBindingKeyAlgorithmMismatch = "token_binding_key_algorithm_mismatch";
8769
+ const tokenBindingKeyJwkThumbprintMismatch = "token_binding_key_jwk_thumbprint_mismatch";
8624
8770
  const failedToBuildHeaders = "failed_to_build_headers";
8625
8771
  const failedToParseHeaders = "failed_to_parse_headers";
8626
8772
  const failedToDecryptEarResponse = "failed_to_decrypt_ear_response";
@@ -8677,11 +8823,14 @@
8677
8823
  spaCodeAndNativeAccountIdPresent: spaCodeAndNativeAccountIdPresent,
8678
8824
  stateInteractionTypeMismatch: stateInteractionTypeMismatch,
8679
8825
  timedOut: timedOut,
8826
+ tokenBindingKeyAlgorithmMismatch: tokenBindingKeyAlgorithmMismatch,
8827
+ tokenBindingKeyJwkThumbprintMismatch: tokenBindingKeyJwkThumbprintMismatch,
8680
8828
  unableToAcquireTokenFromNativePlatform: unableToAcquireTokenFromNativePlatform,
8681
8829
  unableToLoadToken: unableToLoadToken,
8682
8830
  unableToParseState: unableToParseState,
8683
8831
  unableToParseTokenRequestCacheError: unableToParseTokenRequestCacheError,
8684
8832
  uninitializedPublicClientApplication: uninitializedPublicClientApplication,
8833
+ unsupportedTokenBindingAlgorithm: unsupportedTokenBindingAlgorithm,
8685
8834
  userCancelled: userCancelled
8686
8835
  });
8687
8836
 
@@ -9019,6 +9168,8 @@
9019
9168
  const HKDF = "HKDF";
9020
9169
  // SHA-256 hashing algorithm
9021
9170
  const S256_HASH_ALG = "SHA-256";
9171
+ // JWK values used by browser-internal WebCrypto helpers.
9172
+ const JSON_WEB_KEY_CURVE_P256 = "P-256";
9022
9173
  const JSON_WEB_KEY_TYPE_EC = "EC";
9023
9174
  const JSON_WEB_KEY_TYPE_RSA = "RSA";
9024
9175
  const MISSING_JWK_KTY_SUBERROR = "missing_jwk_kty";
@@ -9050,6 +9201,14 @@
9050
9201
  const RSA_SIGN_ALGORITHM_OPTIONS = {
9051
9202
  name: PKCS1_V15_KEYGEN_ALG,
9052
9203
  };
9204
+ const ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS = {
9205
+ name: "ECDSA",
9206
+ namedCurve: JSON_WEB_KEY_CURVE_P256,
9207
+ };
9208
+ const ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS = {
9209
+ name: "ECDSA",
9210
+ hash: { name: S256_HASH_ALG },
9211
+ };
9053
9212
  /**
9054
9213
  * Check whether browser crypto is available.
9055
9214
  */
@@ -9148,16 +9307,6 @@
9148
9307
  async function exportJwk(key) {
9149
9308
  return window.crypto.subtle.exportKey(KEY_FORMAT_JWK, key);
9150
9309
  }
9151
- /**
9152
- * Imports key as Json Web Key (JWK), can set extractable and usages.
9153
- * @param key
9154
- * @param extractable
9155
- * @param usages
9156
- * @param algorithm
9157
- */
9158
- async function importJwk(key, extractable, usages, algorithm) {
9159
- return window.crypto.subtle.importKey(KEY_FORMAT_JWK, key, algorithm, extractable, usages);
9160
- }
9161
9310
  /**
9162
9311
  * Signs given data with given key.
9163
9312
  * @param key
@@ -9313,22 +9462,22 @@
9313
9462
  [JSON_WEB_KEY_TYPE_EC]: ["crv", "kty", "x", "y"],
9314
9463
  [JSON_WEB_KEY_TYPE_RSA]: ["e", "kty", "n"],
9315
9464
  };
9316
- function getJwkThumbprintMembers(publicJwk) {
9465
+ function getJwkThumbprintMembers(publicJwk, correlationId) {
9317
9466
  const kty = publicJwk.kty;
9318
9467
  if (typeof kty !== "string" || kty.length === 0) {
9319
- throw createBrowserAuthError(invalidPublicJwk, "", MISSING_JWK_KTY_SUBERROR);
9468
+ throw createBrowserAuthError(invalidPublicJwk, correlationId, MISSING_JWK_KTY_SUBERROR);
9320
9469
  }
9321
9470
  const requiredMembers = JWK_THUMBPRINT_REQUIRED_MEMBERS[kty];
9322
9471
  if (!requiredMembers) {
9323
- throw createBrowserAuthError(invalidPublicJwk, "", UNSUPPORTED_JWK_KTY_SUBERROR);
9472
+ throw createBrowserAuthError(invalidPublicJwk, correlationId, UNSUPPORTED_JWK_KTY_SUBERROR);
9324
9473
  }
9325
9474
  return requiredMembers.reduce((thumbprintMembers, memberName) => {
9326
9475
  const memberValue = publicJwk[memberName];
9327
9476
  if (typeof memberValue !== "string") {
9328
- throw createBrowserAuthError(invalidPublicJwk, "", MISSING_JWK_MEMBER_SUBERROR);
9477
+ throw createBrowserAuthError(invalidPublicJwk, correlationId, MISSING_JWK_MEMBER_SUBERROR);
9329
9478
  }
9330
9479
  if (memberValue.length === 0) {
9331
- throw createBrowserAuthError(invalidPublicJwk, "", EMPTY_JWK_MEMBER_SUBERROR);
9480
+ throw createBrowserAuthError(invalidPublicJwk, correlationId, EMPTY_JWK_MEMBER_SUBERROR);
9332
9481
  }
9333
9482
  thumbprintMembers[memberName] = memberValue;
9334
9483
  return thumbprintMembers;
@@ -9340,8 +9489,8 @@
9340
9489
  * and the SHA-256 digest is returned as a base64url string.
9341
9490
  * @internal
9342
9491
  */
9343
- async function computeJwkThumbprint(publicJwk) {
9344
- const thumbprintMembers = getJwkThumbprintMembers(publicJwk);
9492
+ async function computeJwkThumbprint(publicJwk, correlationId) {
9493
+ const thumbprintMembers = getJwkThumbprintMembers(publicJwk, correlationId);
9345
9494
  // RFC 7638 §3.3: use only required members, sorted lexicographically
9346
9495
  const thumbprintJson = JSON.stringify(thumbprintMembers, Object.keys(thumbprintMembers).sort());
9347
9496
  return hashString(thumbprintJson);
@@ -10075,22 +10224,19 @@
10075
10224
  }
10076
10225
  }
10077
10226
  /**
10078
- * Get all the keys from the in-memory cache as an iterable array of strings. If no keys are found, query the keys in the
10079
- * asynchronous storage object.
10227
+ * Get all keys from both in-memory and persistent storage.
10080
10228
  * @param correlationId
10081
10229
  */
10082
10230
  async getKeys(correlationId) {
10083
10231
  const cacheKeys = this.inMemoryCache.getKeys();
10084
- if (cacheKeys.length === 0) {
10085
- try {
10086
- this.logger.verbose("1iqrbq", correlationId);
10087
- return await this.indexedDBCache.getKeys();
10088
- }
10089
- catch (e) {
10090
- this.handleDatabaseAccessError(e, correlationId);
10091
- }
10232
+ try {
10233
+ const persistentCacheKeys = await this.indexedDBCache.getKeys();
10234
+ return Array.from(new Set([...cacheKeys, ...persistentCacheKeys]));
10235
+ }
10236
+ catch (e) {
10237
+ this.handleDatabaseAccessError(e, correlationId);
10238
+ return cacheKeys;
10092
10239
  }
10093
- return cacheKeys;
10094
10240
  }
10095
10241
  /**
10096
10242
  * Returns true or false if the given key is present in the cache.
@@ -10141,6 +10287,152 @@
10141
10287
  }
10142
10288
  }
10143
10289
 
10290
+ /*
10291
+ * Copyright (c) Microsoft Corporation. All rights reserved.
10292
+ * Licensed under the MIT License.
10293
+ */
10294
+ /**
10295
+ * Owns browser token-binding key lifecycle and storage lookup.
10296
+ * @internal
10297
+ */
10298
+ class TokenBindingKeyManager {
10299
+ constructor(logger, performanceClient) {
10300
+ this.logger = logger;
10301
+ this.cache = TokenBindingKeyManager.getTokenBindingKeyStorage(this.logger);
10302
+ this.performanceClient = performanceClient;
10303
+ }
10304
+ static getTokenBindingKeyStorage(logger) {
10305
+ if (!TokenBindingKeyManager.tokenBindingKeyStorage) {
10306
+ TokenBindingKeyManager.tokenBindingKeyStorage =
10307
+ new AsyncMemoryStorage(logger);
10308
+ }
10309
+ return TokenBindingKeyManager.tokenBindingKeyStorage;
10310
+ }
10311
+ /**
10312
+ * Provisions a browser token-binding key and returns its key identifier.
10313
+ * @param request - Key provisioning policy.
10314
+ */
10315
+ async provisionTokenBindingKey(request) {
10316
+ const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(CryptoOptsGetPublicKeyThumbprint, request.correlationId);
10317
+ try {
10318
+ const activeKeyPair = await this.createTokenBindingKey(request);
10319
+ publicKeyThumbMeasurement?.end({
10320
+ success: true,
10321
+ ...this.getTokenBindingKeyTelemetry(activeKeyPair),
10322
+ });
10323
+ return activeKeyPair.keyId;
10324
+ }
10325
+ catch (e) {
10326
+ publicKeyThumbMeasurement?.end({
10327
+ success: false,
10328
+ tokenBindingKeyType: request.tokenBindingKeyType,
10329
+ tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
10330
+ });
10331
+ throw e;
10332
+ }
10333
+ }
10334
+ /**
10335
+ * Removes a browser token-binding key by identifier.
10336
+ * @param kid - Token-binding key identifier.
10337
+ * @param correlationId - Request correlation identifier.
10338
+ */
10339
+ async removeTokenBindingKey(kid, correlationId) {
10340
+ await this.cache.removeItem(kid, correlationId);
10341
+ const keyFound = await this.cache.containsKey(kid, correlationId);
10342
+ if (keyFound) {
10343
+ throw createClientAuthError(bindingKeyNotRemoved, correlationId);
10344
+ }
10345
+ }
10346
+ /**
10347
+ * Clears browser token-binding keys from memory and persistent storage.
10348
+ * @param correlationId - Request correlation identifier.
10349
+ */
10350
+ async clearKeystore(correlationId) {
10351
+ this.cache.clearInMemory(correlationId);
10352
+ try {
10353
+ await this.cache.clearPersistent(correlationId);
10354
+ return true;
10355
+ }
10356
+ catch (e) {
10357
+ if (e instanceof Error) {
10358
+ this.logger.error(`1owpn8 ${e.message}`, correlationId);
10359
+ }
10360
+ else {
10361
+ this.logger.error("0yrmwo", correlationId);
10362
+ }
10363
+ return false;
10364
+ }
10365
+ }
10366
+ /**
10367
+ * Gets a token-binding public key as a JWK by identifier.
10368
+ * @param keyId - Token-binding key identifier.
10369
+ * @param correlationId - Request correlation identifier.
10370
+ */
10371
+ async getTokenBindingPublicKeyJwk(keyId, correlationId) {
10372
+ const cachedKeyPair = await this.getTokenBindingKeyPair(keyId, correlationId);
10373
+ return exportJwk(cachedKeyPair.publicKey);
10374
+ }
10375
+ async createTokenBindingKey(request) {
10376
+ const keyGenAlgorithm = this.getTokenBindingKeyGenAlgorithmOptions(request.tokenBindingKeyAlgorithm, request.correlationId);
10377
+ const generatedKeyPair = await this.generateKeyPairAndThumbprint(TokenBindingKeyManager.TOKEN_BINDING_KEY_USAGES, keyGenAlgorithm, request.correlationId);
10378
+ await this.cache.setItem(generatedKeyPair.keyId, {
10379
+ ...generatedKeyPair,
10380
+ tokenBindingKeyType: request.tokenBindingKeyType,
10381
+ tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
10382
+ }, request.correlationId);
10383
+ return {
10384
+ ...generatedKeyPair,
10385
+ tokenBindingKeyType: request.tokenBindingKeyType,
10386
+ tokenBindingKeyAlgorithm: request.tokenBindingKeyAlgorithm,
10387
+ };
10388
+ }
10389
+ async generateKeyPairAndThumbprint(usages, keyGenAlgorithm, correlationId) {
10390
+ const keyPair = await generateKeyPair(false, usages, keyGenAlgorithm);
10391
+ const publicJwk = await exportJwk(keyPair.publicKey);
10392
+ const keyId = await computeJwkThumbprint(publicJwk, correlationId);
10393
+ return {
10394
+ publicKey: keyPair.publicKey,
10395
+ privateKey: keyPair.privateKey,
10396
+ keyId,
10397
+ };
10398
+ }
10399
+ /** @internal */
10400
+ async getTokenBindingKeyPair(keyId, correlationId) {
10401
+ const cachedKeyPair = await this.cache.getItem(keyId, correlationId);
10402
+ if (!cachedKeyPair) {
10403
+ throw createBrowserAuthError(cryptoKeyNotFound, correlationId);
10404
+ }
10405
+ return cachedKeyPair;
10406
+ }
10407
+ /** @internal */
10408
+ getTokenBindingKeyTelemetry(cachedKeyPair, fallbackAlgorithm) {
10409
+ return {
10410
+ ...(cachedKeyPair.tokenBindingKeyType && {
10411
+ tokenBindingKeyType: cachedKeyPair.tokenBindingKeyType,
10412
+ }),
10413
+ ...(cachedKeyPair.tokenBindingKeyAlgorithm || fallbackAlgorithm
10414
+ ? {
10415
+ tokenBindingKeyAlgorithm: cachedKeyPair.tokenBindingKeyAlgorithm ||
10416
+ fallbackAlgorithm,
10417
+ }
10418
+ : {}),
10419
+ };
10420
+ }
10421
+ getTokenBindingKeyGenAlgorithmOptions(tokenBindingKeyAlgorithm, correlationId) {
10422
+ if (tokenBindingKeyAlgorithm === JsonWebTokenAlgorithms.RS256) {
10423
+ return RSA_KEYGEN_ALGORITHM_OPTIONS;
10424
+ }
10425
+ if (tokenBindingKeyAlgorithm === JsonWebTokenAlgorithms.ES256) {
10426
+ return ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS;
10427
+ }
10428
+ throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId);
10429
+ }
10430
+ }
10431
+ TokenBindingKeyManager.TOKEN_BINDING_KEY_USAGES = [
10432
+ "sign",
10433
+ "verify",
10434
+ ];
10435
+
10144
10436
  /*
10145
10437
  * Copyright (c) Microsoft Corporation. All rights reserved.
10146
10438
  * Licensed under the MIT License.
@@ -10154,8 +10446,8 @@
10154
10446
  this.logger = logger;
10155
10447
  // Browser crypto needs to be validated first before any other classes can be set.
10156
10448
  validateCryptoAvailable(skipValidateSubtleCrypto ?? false);
10157
- this.cache = new AsyncMemoryStorage(this.logger);
10158
10449
  this.performanceClient = performanceClient;
10450
+ this.tokenBindingKeyManager = new TokenBindingKeyManager(this.logger, this.performanceClient);
10159
10451
  }
10160
10452
  /**
10161
10453
  * Creates a new random GUID - used to populate state and nonce.
@@ -10193,114 +10485,45 @@
10193
10485
  encodeKid(inputKid) {
10194
10486
  return this.base64UrlEncode(JSON.stringify({ kid: inputKid }));
10195
10487
  }
10196
- /**
10197
- * Generates a keypair, stores it and returns a thumbprint
10198
- * @param request
10199
- */
10200
- async getPublicKeyThumbprint(request) {
10201
- const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(CryptoOptsGetPublicKeyThumbprint, request.correlationId);
10202
- // Generate Keypair
10203
- const keyPair = await generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES, RSA_KEYGEN_ALGORITHM_OPTIONS);
10204
- // Generate Thumbprint for Public Key
10205
- const publicKeyJwk = await exportJwk(keyPair.publicKey);
10206
- const publicJwkHash = await computeJwkThumbprint(publicKeyJwk);
10207
- // Generate Thumbprint for Private Key
10208
- const privateKeyJwk = await exportJwk(keyPair.privateKey);
10209
- // Re-import private key to make it unextractable
10210
- const unextractablePrivateKey = await importJwk(privateKeyJwk, false, ["sign"], RSA_KEYGEN_ALGORITHM_OPTIONS);
10211
- // Store Keypair data in keystore
10212
- await this.cache.setItem(publicJwkHash, {
10213
- privateKey: unextractablePrivateKey,
10214
- publicKey: keyPair.publicKey,
10215
- requestMethod: request.resourceRequestMethod,
10216
- requestUri: request.resourceRequestUri,
10217
- }, request.correlationId);
10218
- if (publicKeyThumbMeasurement) {
10219
- publicKeyThumbMeasurement.end({
10220
- success: true,
10221
- });
10222
- }
10223
- return publicJwkHash;
10224
- }
10225
10488
  /**
10226
10489
  * Removes cryptographic keypair from key store matching the keyId passed in
10227
10490
  * @param kid
10228
10491
  * @param correlationId
10229
10492
  */
10230
10493
  async removeTokenBindingKey(kid, correlationId) {
10231
- await this.cache.removeItem(kid, correlationId);
10232
- const keyFound = await this.cache.containsKey(kid, correlationId);
10233
- if (keyFound) {
10234
- throw createClientAuthError(bindingKeyNotRemoved, correlationId);
10235
- }
10494
+ await this.tokenBindingKeyManager.removeTokenBindingKey(kid, correlationId);
10236
10495
  }
10237
10496
  /**
10238
10497
  * Removes all cryptographic keys from IndexedDB storage
10239
10498
  * @param correlationId
10240
10499
  */
10241
10500
  async clearKeystore(correlationId) {
10242
- // Delete in-memory keystores
10243
- this.cache.clearInMemory(correlationId);
10244
- /**
10245
- * There is only one database, so calling clearPersistent on asymmetric keystore takes care of
10246
- * every persistent keystore
10247
- */
10501
+ return this.tokenBindingKeyManager.clearKeystore(correlationId);
10502
+ }
10503
+ /** @internal */
10504
+ async signTokenBindingJwt(header, payload, kid, correlationId) {
10505
+ let telemetry = {};
10506
+ const signTokenBindingJwtMeasurement = this.performanceClient?.startMeasurement(CryptoOptsSignJwt, correlationId);
10248
10507
  try {
10249
- await this.cache.clearPersistent(correlationId);
10250
- return true;
10508
+ const cachedKeyPair = await this.tokenBindingKeyManager.getTokenBindingKeyPair(kid, correlationId);
10509
+ await this.validateTokenBindingJwtHeaderKey(header, kid, correlationId);
10510
+ telemetry = this.tokenBindingKeyManager.getTokenBindingKeyTelemetry(cachedKeyPair, header.alg);
10511
+ const signingAlgorithm = this.getTokenBindingKeySigningAlgorithm(cachedKeyPair, header.alg, correlationId);
10512
+ const tokenString = `${urlEncode(JSON.stringify(header))}.${urlEncode(JSON.stringify(payload))}`;
10513
+ const encodedSignature = await this.signInput(cachedKeyPair, tokenString, signingAlgorithm);
10514
+ signTokenBindingJwtMeasurement?.end({
10515
+ success: true,
10516
+ ...telemetry,
10517
+ });
10518
+ return `${tokenString}.${encodedSignature}`;
10251
10519
  }
10252
10520
  catch (e) {
10253
- if (e instanceof Error) {
10254
- this.logger.error(`1owpn8 ${e.message}`, correlationId);
10255
- }
10256
- else {
10257
- this.logger.error("0yrmwo", correlationId);
10258
- }
10259
- return false;
10260
- }
10261
- }
10262
- /**
10263
- * Signs the given object as a jwt payload with private key retrieved by given kid.
10264
- * @param payload
10265
- * @param kid
10266
- */
10267
- async signJwt(payload, kid, shrOptions, correlationId) {
10268
- const signJwtMeasurement = this.performanceClient?.startMeasurement(CryptoOptsSignJwt, correlationId);
10269
- const cachedKeyPair = await this.cache.getItem(kid, correlationId || "");
10270
- if (!cachedKeyPair) {
10271
- throw createBrowserAuthError(cryptoKeyNotFound, correlationId || "");
10272
- }
10273
- // Get public key as JWK
10274
- const publicKeyJwk = await exportJwk(cachedKeyPair.publicKey);
10275
- const publicKeyJwkString = getSortedObjectString(publicKeyJwk);
10276
- // Base64URL encode public key thumbprint with keyId only: BASE64URL({ kid: "FULL_PUBLIC_KEY_HASH" })
10277
- const encodedKeyIdThumbprint = urlEncode(JSON.stringify({ kid: kid }));
10278
- // Generate header
10279
- const shrHeader = JoseHeader.getShrHeaderString({
10280
- ...shrOptions?.header,
10281
- alg: publicKeyJwk.alg,
10282
- kid: encodedKeyIdThumbprint,
10283
- });
10284
- const encodedShrHeader = urlEncode(shrHeader);
10285
- // Generate payload
10286
- payload.cnf = {
10287
- jwk: JSON.parse(publicKeyJwkString),
10288
- };
10289
- const encodedPayload = urlEncode(JSON.stringify(payload));
10290
- // Form token string
10291
- const tokenString = `${encodedShrHeader}.${encodedPayload}`;
10292
- // Sign token
10293
- const encoder = new TextEncoder();
10294
- const tokenBuffer = encoder.encode(tokenString);
10295
- const signatureBuffer = await sign(cachedKeyPair.privateKey, tokenBuffer, RSA_SIGN_ALGORITHM_OPTIONS);
10296
- const encodedSignature = urlEncodeArr(new Uint8Array(signatureBuffer));
10297
- const signedJwt = `${tokenString}.${encodedSignature}`;
10298
- if (signJwtMeasurement) {
10299
- signJwtMeasurement.end({
10300
- success: true,
10521
+ signTokenBindingJwtMeasurement?.end({
10522
+ success: false,
10523
+ ...telemetry,
10301
10524
  });
10525
+ throw e;
10302
10526
  }
10303
- return signedJwt;
10304
10527
  }
10305
10528
  /**
10306
10529
  * Returns the SHA-256 hash of an input string
@@ -10309,11 +10532,39 @@
10309
10532
  async hashString(plainText) {
10310
10533
  return hashString(plainText);
10311
10534
  }
10312
- }
10313
- CryptoOps.POP_KEY_USAGES = ["sign", "verify"];
10314
- CryptoOps.EXTRACTABLE = true;
10315
- function getSortedObjectString(obj) {
10316
- return JSON.stringify(obj, Object.keys(obj).sort());
10535
+ async signInput(cachedKeyPair, signingInput, algorithm) {
10536
+ const encoder = new TextEncoder();
10537
+ const signatureBuffer = await sign(cachedKeyPair.privateKey, encoder.encode(signingInput), algorithm);
10538
+ return urlEncodeArr(new Uint8Array(signatureBuffer));
10539
+ }
10540
+ getTokenBindingKeySigningAlgorithm(cachedKeyPair, requestedAlgorithm, correlationId) {
10541
+ const keyAlgorithm = cachedKeyPair.privateKey.algorithm;
10542
+ if (requestedAlgorithm === JsonWebTokenAlgorithms.RS256 &&
10543
+ keyAlgorithm.name === RSA_SIGN_ALGORITHM_OPTIONS.name) {
10544
+ return RSA_SIGN_ALGORITHM_OPTIONS;
10545
+ }
10546
+ if (requestedAlgorithm === JsonWebTokenAlgorithms.ES256 &&
10547
+ keyAlgorithm.name ===
10548
+ ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS.name &&
10549
+ keyAlgorithm.namedCurve ===
10550
+ ECDSA_P256_KEYGEN_ALGORITHM_OPTIONS.namedCurve) {
10551
+ return ECDSA_SHA256_SIGN_ALGORITHM_OPTIONS;
10552
+ }
10553
+ if (requestedAlgorithm === JsonWebTokenAlgorithms.RS256 ||
10554
+ requestedAlgorithm === JsonWebTokenAlgorithms.ES256) {
10555
+ throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId, tokenBindingKeyAlgorithmMismatch);
10556
+ }
10557
+ throw createBrowserAuthError(unsupportedTokenBindingAlgorithm, correlationId);
10558
+ }
10559
+ async validateTokenBindingJwtHeaderKey(header, kid, correlationId) {
10560
+ if (!header.jwk) {
10561
+ return;
10562
+ }
10563
+ const headerKeyId = await computeJwkThumbprint(header.jwk, correlationId);
10564
+ if (headerKeyId !== kid) {
10565
+ throw createBrowserAuthError(invalidPublicJwk, correlationId, tokenBindingKeyJwkThumbprintMismatch);
10566
+ }
10567
+ }
10317
10568
  }
10318
10569
 
10319
10570
  /*
@@ -10908,7 +11159,7 @@
10908
11159
 
10909
11160
  /* eslint-disable header/header */
10910
11161
  const name = "@azure/msal-browser";
10911
- const version = "5.18.0";
11162
+ const version = "5.19.0";
10912
11163
 
10913
11164
  /*
10914
11165
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -12523,7 +12774,7 @@
12523
12774
  * Licensed under the MIT License.
12524
12775
  */
12525
12776
  class BaseInteractionClient {
12526
- constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider) {
12777
+ constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager) {
12527
12778
  this.config = config;
12528
12779
  this.browserStorage = storageImpl;
12529
12780
  this.browserCrypto = browserCrypto;
@@ -12534,6 +12785,9 @@
12534
12785
  this.correlationId = correlationId;
12535
12786
  this.logger = logger.clone(name, version);
12536
12787
  this.performanceClient = performanceClient;
12788
+ this.tokenBindingKeyManager =
12789
+ tokenBindingKeyManager ||
12790
+ new TokenBindingKeyManager(this.logger, this.performanceClient);
12537
12791
  }
12538
12792
  }
12539
12793
  /**
@@ -12660,6 +12914,11 @@
12660
12914
  * Copyright (c) Microsoft Corporation. All rights reserved.
12661
12915
  * Licensed under the MIT License.
12662
12916
  */
12917
+ const SUPPORTED_AUTHENTICATION_SCHEMES = new Set([
12918
+ AuthenticationScheme$1.BEARER,
12919
+ AuthenticationScheme$1.POP,
12920
+ AuthenticationScheme$1.SSH,
12921
+ ]);
12663
12922
  /**
12664
12923
  * Initializer function for all request APIs
12665
12924
  * @param request
@@ -12684,13 +12943,16 @@
12684
12943
  logger.verbose("1l4fwv", correlationId);
12685
12944
  }
12686
12945
  else {
12946
+ if (!SUPPORTED_AUTHENTICATION_SCHEMES.has(validatedRequest.authenticationScheme)) {
12947
+ throw createClientConfigurationError(unsupportedAuthenticationScheme, correlationId);
12948
+ }
12687
12949
  if (validatedRequest.authenticationScheme ===
12688
12950
  AuthenticationScheme$1.SSH) {
12689
12951
  if (!request.sshJwk) {
12690
- throw createClientConfigurationError(missingSshJwk, "");
12952
+ throw createClientConfigurationError(missingSshJwk, correlationId);
12691
12953
  }
12692
12954
  if (!request.sshKid) {
12693
- throw createClientConfigurationError(missingSshKid, "");
12955
+ throw createClientConfigurationError(missingSshKid, correlationId);
12694
12956
  }
12695
12957
  }
12696
12958
  logger.verbose(`1ecmns ${validatedRequest.authenticationScheme}`, correlationId);
@@ -12875,6 +13137,7 @@
12875
13137
  correlationId: this.correlationId,
12876
13138
  },
12877
13139
  cryptoInterface: this.browserCrypto,
13140
+ tokenBindingKeyManager: this.tokenBindingKeyManager,
12878
13141
  networkInterface: this.networkClient,
12879
13142
  storageInterface: this.browserStorage,
12880
13143
  serverTelemetryManager: serverTelemetryManager,
@@ -13346,13 +13609,13 @@
13346
13609
  * Licensed under the MIT License.
13347
13610
  */
13348
13611
  class PlatformAuthInteractionClient extends BaseInteractionClient {
13349
- constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {
13350
- super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider);
13612
+ constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId, tokenBindingKeyManager) {
13613
+ super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, tokenBindingKeyManager);
13351
13614
  this.apiId = apiId;
13352
13615
  this.accountId = accountId;
13353
13616
  this.platformAuthProvider = provider;
13354
13617
  this.nativeStorageManager = nativeStorageImpl;
13355
- this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider);
13618
+ this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, provider, this.tokenBindingKeyManager);
13356
13619
  const extensionName = this.platformAuthProvider.getExtensionName();
13357
13620
  this.skus = ServerTelemetryManager.makeExtraSkuString({
13358
13621
  libraryName: BrowserConstants.MSAL_SKU,
@@ -13699,7 +13962,7 @@
13699
13962
  return response.shr;
13700
13963
  }
13701
13964
  // Generate SHR in msal js if WAM does not compute it when POP is enabled
13702
- const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.performanceClient);
13965
+ const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.tokenBindingKeyManager, this.performanceClient);
13703
13966
  const shrParameters = {
13704
13967
  resourceRequestMethod: request.resourceRequestMethod,
13705
13968
  resourceRequestUri: request.resourceRequestUri,
@@ -13959,7 +14222,7 @@
13959
14222
  shrNonce: request.shrNonce,
13960
14223
  correlationId: this.correlationId,
13961
14224
  };
13962
- const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.performanceClient);
14225
+ const popTokenGenerator = new PopTokenGenerator(this.browserCrypto, this.tokenBindingKeyManager, this.performanceClient);
13963
14226
  // generate reqCnf if not provided in the request
13964
14227
  let reqCnfData;
13965
14228
  if (!validatedRequest.keyId) {
@@ -14149,7 +14412,8 @@
14149
14412
  // pass the req_cnf for POP
14150
14413
  if (request.authenticationScheme === AuthenticationScheme$1.POP) {
14151
14414
  const cryptoOps = new CryptoOps(logger, performanceClient);
14152
- const popTokenGenerator = new PopTokenGenerator(cryptoOps, performanceClient);
14415
+ const tokenBindingKeyManager = new TokenBindingKeyManager(logger, performanceClient);
14416
+ const popTokenGenerator = new PopTokenGenerator(cryptoOps, tokenBindingKeyManager, performanceClient);
14153
14417
  // req_cnf is always sent as a string for SPAs
14154
14418
  let reqCnfData;
14155
14419
  if (!request.popKid) {
@@ -14358,7 +14622,7 @@
14358
14622
  if (decryptedData.accountId) {
14359
14623
  return invokeAsync(handleResponsePlatformBroker, HandleResponsePlatformBroker, logger, performanceClient, request.correlationId)(request, decryptedData.accountId, apiId, config, browserStorage, nativeStorage, eventHandler, logger, performanceClient, platformAuthProvider);
14360
14624
  }
14361
- const responseHandler = new ResponseHandler(config.auth.clientId, browserStorage, new CryptoOps(logger, performanceClient), logger, performanceClient, null, null);
14625
+ const responseHandler = new ResponseHandler(config.auth.clientId, browserStorage, new CryptoOps(logger, performanceClient), logger, performanceClient, null, null, new TokenBindingKeyManager(logger, performanceClient));
14362
14626
  // Validate response. This function throws a server error if an error is returned by the server.
14363
14627
  responseHandler.validateTokenResponse(decryptedData, request.correlationId);
14364
14628
  // Temporary until response handler is refactored to be more flow agnostic.
@@ -15238,8 +15502,8 @@
15238
15502
  * Licensed under the MIT License.
15239
15503
  */
15240
15504
  class PopupClient extends StandardInteractionClient {
15241
- constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, correlationId, platformAuthHandler, waitForPopupResponseHook) {
15242
- super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthHandler);
15505
+ constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, correlationId, platformAuthHandler, waitForPopupResponseHook, tokenBindingKeyManager) {
15506
+ super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthHandler, tokenBindingKeyManager);
15243
15507
  this.nativeStorage = nativeStorageImpl;
15244
15508
  this.eventHandler = eventHandler;
15245
15509
  this.waitForPopupResponseHook = waitForPopupResponseHook;
@@ -15753,8 +16017,8 @@
15753
16017
  return navigation?.type;
15754
16018
  }
15755
16019
  class RedirectClient extends StandardInteractionClient {
15756
- constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, correlationId, platformAuthHandler) {
15757
- super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthHandler);
16020
+ constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeStorageImpl, correlationId, platformAuthHandler, tokenBindingKeyManager) {
16021
+ super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthHandler, tokenBindingKeyManager);
15758
16022
  this.nativeStorage = nativeStorageImpl;
15759
16023
  }
15760
16024
  /**
@@ -16246,8 +16510,8 @@
16246
16510
  * Licensed under the MIT License.
16247
16511
  */
16248
16512
  class SilentIframeClient extends StandardInteractionClient {
16249
- constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeStorageImpl, correlationId, platformAuthProvider, waitForIframeResponseHook) {
16250
- super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider);
16513
+ constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, nativeStorageImpl, correlationId, platformAuthProvider, waitForIframeResponseHook, tokenBindingKeyManager) {
16514
+ super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager);
16251
16515
  this.apiId = apiId;
16252
16516
  this.nativeStorage = nativeStorageImpl;
16253
16517
  this.waitForIframeResponseHook = waitForIframeResponseHook;
@@ -16554,8 +16818,8 @@
16554
16818
  * Licensed under the MIT License.
16555
16819
  */
16556
16820
  class SilentAuthCodeClient extends StandardInteractionClient {
16557
- constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, correlationId, platformAuthProvider) {
16558
- super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider);
16821
+ constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager) {
16822
+ super(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, correlationId, platformAuthProvider, tokenBindingKeyManager);
16559
16823
  this.apiId = apiId;
16560
16824
  }
16561
16825
  /**
@@ -16708,10 +16972,15 @@
16708
16972
  this.hybridAuthCodeResponses = new Map();
16709
16973
  // Initialize performance client
16710
16974
  this.performanceClient = this.config.telemetry.client;
16711
- // Initialize the crypto class.
16712
- this.browserCrypto = this.isBrowserEnvironment
16713
- ? new CryptoOps(this.logger, this.performanceClient)
16714
- : DEFAULT_CRYPTO_IMPLEMENTATION;
16975
+ // Initialize environment-specific crypto and token-binding services.
16976
+ if (this.isBrowserEnvironment) {
16977
+ this.browserCrypto = new CryptoOps(this.logger, this.performanceClient);
16978
+ this.tokenBindingKeyManager = new TokenBindingKeyManager(this.logger, this.performanceClient);
16979
+ }
16980
+ else {
16981
+ this.browserCrypto = DEFAULT_CRYPTO_IMPLEMENTATION;
16982
+ this.tokenBindingKeyManager = DEFAULT_TOKEN_BINDING_KEY_MANAGER;
16983
+ }
16715
16984
  this.eventHandler = new EventHandler(this.logger);
16716
16985
  // Initialize the browser storage class.
16717
16986
  this.browserStorage = this.isBrowserEnvironment
@@ -16864,7 +17133,7 @@
16864
17133
  rootMeasurement.add({
16865
17134
  isPlatformBrokerRequest: true,
16866
17135
  });
16867
- const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.platformAuthProvider, platformBrokerRequest.accountId, this.nativeInternalStorage, platformBrokerRequest.correlationId);
17136
+ const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.platformAuthProvider, platformBrokerRequest.accountId, this.nativeInternalStorage, platformBrokerRequest.correlationId, this.tokenBindingKeyManager);
16868
17137
  redirectResponse = invokeAsync(nativeClient.handleRedirectPromise.bind(nativeClient), HandleNativeRedirectPromiseMeasurement, this.logger, this.performanceClient, rootMeasurement.event.correlationId)();
16869
17138
  }
16870
17139
  else {
@@ -16965,7 +17234,7 @@
16965
17234
  let result;
16966
17235
  if (this.platformAuthProvider &&
16967
17236
  this.canUsePlatformBroker(request)) {
16968
- const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);
17237
+ const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.platformAuthProvider, this.getNativeAccountId(request), this.nativeInternalStorage, correlationId, this.tokenBindingKeyManager);
16969
17238
  result = invokeAsync(nativeClient.acquireTokenRedirect.bind(nativeClient), NativeInteractionClientAcquireTokenRedirect, this.logger, this.performanceClient, correlationId)(request, atrMeasurement).catch((e) => {
16970
17239
  if (e instanceof NativeAuthError &&
16971
17240
  isFatalNativeAuthError(e)) {
@@ -17640,7 +17909,7 @@
17640
17909
  if (!this.platformAuthProvider) {
17641
17910
  throw createBrowserAuthError(nativeConnectionNotEstablished, correlationId);
17642
17911
  }
17643
- const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.platformAuthProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, correlationId);
17912
+ const nativeClient = new PlatformAuthInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.platformAuthProvider, accountId || this.getNativeAccountId(request), this.nativeInternalStorage, correlationId, this.tokenBindingKeyManager);
17644
17913
  return invokeAsync(nativeClient.acquireToken.bind(nativeClient), NativeInteractionClientAcquireToken, this.logger, this.performanceClient, correlationId)(request, cacheLookupPolicy);
17645
17914
  }
17646
17915
  /**
@@ -17697,39 +17966,39 @@
17697
17966
  * @param correlationId
17698
17967
  */
17699
17968
  createPopupClient(correlationId) {
17700
- return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.operatingContext.getResponseHandlers()?.waitForPopupResponse);
17969
+ return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.operatingContext.getResponseHandlers()?.waitForPopupResponse, this.tokenBindingKeyManager);
17701
17970
  }
17702
17971
  /**
17703
17972
  * Returns new instance of the Redirect Interaction Client
17704
17973
  * @param correlationId
17705
17974
  */
17706
17975
  createRedirectClient(correlationId) {
17707
- return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider);
17976
+ return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.tokenBindingKeyManager);
17708
17977
  }
17709
17978
  /**
17710
17979
  * Returns new instance of the Silent Iframe Interaction Client
17711
17980
  * @param correlationId
17712
17981
  */
17713
17982
  createSilentIframeClient(correlationId) {
17714
- return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.operatingContext.getResponseHandlers()?.waitForIframeResponse);
17983
+ return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeInternalStorage, correlationId, this.platformAuthProvider, this.operatingContext.getResponseHandlers()?.waitForIframeResponse, this.tokenBindingKeyManager);
17715
17984
  }
17716
17985
  /**
17717
17986
  * Returns new instance of the Silent Cache Interaction Client
17718
17987
  */
17719
17988
  createSilentCacheClient(correlationId) {
17720
- return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, correlationId, this.platformAuthProvider);
17989
+ return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, correlationId, this.platformAuthProvider, this.tokenBindingKeyManager);
17721
17990
  }
17722
17991
  /**
17723
17992
  * Returns new instance of the Silent Refresh Interaction Client
17724
17993
  */
17725
17994
  createSilentRefreshClient(correlationId) {
17726
- return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, correlationId, this.platformAuthProvider);
17995
+ return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, correlationId, this.platformAuthProvider, this.tokenBindingKeyManager);
17727
17996
  }
17728
17997
  /**
17729
17998
  * Returns new instance of the Silent AuthCode Interaction Client
17730
17999
  */
17731
18000
  createSilentAuthCodeClient(correlationId) {
17732
- return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, correlationId, this.platformAuthProvider);
18001
+ return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, correlationId, this.platformAuthProvider, this.tokenBindingKeyManager);
17733
18002
  }
17734
18003
  /**
17735
18004
  * Adds event callbacks to array
@@ -18317,6 +18586,92 @@
18317
18586
  NestedAppAuthUnavailable: "NESTED_APP_AUTH_UNAVAILABLE", // NAA is unavailable in the current context, can retry with standard browser based auth
18318
18587
  };
18319
18588
 
18589
+ /*
18590
+ * Copyright (c) Microsoft Corporation. All rights reserved.
18591
+ * Licensed under the MIT License.
18592
+ */
18593
+ /**
18594
+ * Unified error taxonomy shared by NAA and PWB.
18595
+ *
18596
+ * Each code maps to exactly one of the four base MSAL error classes
18597
+ * (`AuthError`, `ClientAuthError`, `ServerError`,
18598
+ * `InteractionRequiredAuthError`) via `toAuthError` in
18599
+ * `./WebBrokerBridgeErrorMap`.
18600
+ */
18601
+ const WebBrokerBridgeErrorCode = {
18602
+ /* Interaction / auth outcomes */
18603
+ UserInteractionRequired: "user_interaction_required",
18604
+ UserCanceled: "user_canceled",
18605
+ /* Environment / connectivity */
18606
+ NoNetwork: "no_network",
18607
+ AccountUnavailable: "account_unavailable",
18608
+ BridgeDisabled: "bridge_disabled",
18609
+ BridgeUnavailable: "bridge_unavailable",
18610
+ /* Server-side outcomes */
18611
+ TransientError: "transient_error",
18612
+ PersistentError: "persistent_error",
18613
+ /* Broker-channel failures */
18614
+ BridgeTimeout: "bridge_timeout",
18615
+ BridgeHandshakeFailed: "bridge_handshake_failed",
18616
+ BridgeConnectionReset: "bridge_connection_reset",
18617
+ BridgeResponseInvalid: "bridge_response_invalid",
18618
+ PopupWillRedirect: "popup_will_redirect",
18619
+ ShrGenerationError: "shr_generation_error",
18620
+ /* Fallback */
18621
+ Unknown: "unknown",
18622
+ };
18623
+
18624
+ /*
18625
+ * Copyright (c) Microsoft Corporation. All rights reserved.
18626
+ * Licensed under the MIT License.
18627
+ */
18628
+ /**
18629
+ * Lift a normalized `WebBrokerBridgeError` to one of the four base
18630
+ * MSAL error classes. Callers are responsible for lowering
18631
+ * transport-specific errors into `WebBrokerBridgeError` before calling
18632
+ * this function.
18633
+ */
18634
+ function toAuthError(err) {
18635
+ const correlationId = err.correlationId ?? "";
18636
+ switch (err.code) {
18637
+ case WebBrokerBridgeErrorCode.UserInteractionRequired:
18638
+ return new InteractionRequiredAuthError(err.innerErrorCode || "", correlationId, err.description, err.subError);
18639
+ case WebBrokerBridgeErrorCode.TransientError:
18640
+ case WebBrokerBridgeErrorCode.PersistentError:
18641
+ return new ServerError(err.innerErrorCode || "", correlationId, err.description, err.subError);
18642
+ case WebBrokerBridgeErrorCode.UserCanceled:
18643
+ return new ClientAuthError(userCanceled, correlationId);
18644
+ case WebBrokerBridgeErrorCode.NoNetwork:
18645
+ return new ClientAuthError(noNetworkConnectivity$1, correlationId);
18646
+ case WebBrokerBridgeErrorCode.AccountUnavailable:
18647
+ return new ClientAuthError(noAccountFound, correlationId);
18648
+ case WebBrokerBridgeErrorCode.BridgeDisabled:
18649
+ return new ClientAuthError(nestedAppAuthBridgeDisabled, correlationId);
18650
+ case WebBrokerBridgeErrorCode.BridgeUnavailable:
18651
+ /*
18652
+ * NAA parity: pass through inner code when the broker supplied
18653
+ * one, otherwise fall back to the disabled code.
18654
+ */
18655
+ return new ClientAuthError(err.innerErrorCode ||
18656
+ nestedAppAuthBridgeDisabled, correlationId, err.description);
18657
+ /*
18658
+ * PWB broker-channel failures. The common code doubles as the
18659
+ * concrete errorCode on AuthError so the original error identity
18660
+ * can be recovered by round-tripping the string.
18661
+ */
18662
+ case WebBrokerBridgeErrorCode.BridgeTimeout:
18663
+ case WebBrokerBridgeErrorCode.BridgeHandshakeFailed:
18664
+ case WebBrokerBridgeErrorCode.BridgeConnectionReset:
18665
+ case WebBrokerBridgeErrorCode.BridgeResponseInvalid:
18666
+ case WebBrokerBridgeErrorCode.PopupWillRedirect:
18667
+ case WebBrokerBridgeErrorCode.ShrGenerationError:
18668
+ return new AuthError(err.code, correlationId, err.description, err.subError);
18669
+ case WebBrokerBridgeErrorCode.Unknown:
18670
+ default:
18671
+ return new AuthError(err.innerErrorCode || "unknown_error", correlationId, err.description || "An unknown error occurred", err.subError);
18672
+ }
18673
+ }
18674
+
18320
18675
  /*
18321
18676
  * Copyright (c) Microsoft Corporation. All rights reserved.
18322
18677
  * Licensed under the MIT License.
@@ -18461,30 +18816,9 @@
18461
18816
  */
18462
18817
  fromBridgeError(error) {
18463
18818
  if (isBridgeError(error)) {
18464
- switch (error.status) {
18465
- case BridgeStatusCode.UserCancel:
18466
- return new ClientAuthError(userCanceled, "");
18467
- case BridgeStatusCode.NoNetwork:
18468
- return new ClientAuthError(noNetworkConnectivity$1, "");
18469
- case BridgeStatusCode.AccountUnavailable:
18470
- return new ClientAuthError(noAccountFound, "");
18471
- case BridgeStatusCode.Disabled:
18472
- return new ClientAuthError(nestedAppAuthBridgeDisabled, "");
18473
- case BridgeStatusCode.NestedAppAuthUnavailable:
18474
- return new ClientAuthError(error.code ||
18475
- nestedAppAuthBridgeDisabled, "", error.description);
18476
- case BridgeStatusCode.TransientError:
18477
- case BridgeStatusCode.PersistentError:
18478
- return new ServerError(error.code || "", "", error.description);
18479
- case BridgeStatusCode.UserInteractionRequired:
18480
- return new InteractionRequiredAuthError(error.code || "", "", error.description);
18481
- default:
18482
- return new AuthError(error.code || "", "", error.description);
18483
- }
18484
- }
18485
- else {
18486
- return new AuthError("unknown_error", "", "An unknown error occurred");
18819
+ return toAuthError(bridgeErrorToWebBrokerBridgeError(error));
18487
18820
  }
18821
+ return new AuthError("unknown_error", "", "An unknown error occurred");
18488
18822
  }
18489
18823
  /**
18490
18824
  * Returns an AuthenticationResult from the given cache items
@@ -18520,6 +18854,52 @@
18520
18854
  };
18521
18855
  return authenticationResult;
18522
18856
  }
18857
+ }
18858
+ /**
18859
+ * Converts NAA `BridgeError` into the shared `WebBrokerBridgeError`
18860
+ * taxonomy.
18861
+ */
18862
+ function bridgeErrorToWebBrokerBridgeError(error) {
18863
+ switch (error.status) {
18864
+ case BridgeStatusCode.UserCancel:
18865
+ return { code: WebBrokerBridgeErrorCode.UserCanceled };
18866
+ case BridgeStatusCode.NoNetwork:
18867
+ return { code: WebBrokerBridgeErrorCode.NoNetwork };
18868
+ case BridgeStatusCode.AccountUnavailable:
18869
+ return { code: WebBrokerBridgeErrorCode.AccountUnavailable };
18870
+ case BridgeStatusCode.Disabled:
18871
+ return { code: WebBrokerBridgeErrorCode.BridgeDisabled };
18872
+ case BridgeStatusCode.NestedAppAuthUnavailable:
18873
+ return {
18874
+ code: WebBrokerBridgeErrorCode.BridgeUnavailable,
18875
+ innerErrorCode: error.code,
18876
+ description: error.description,
18877
+ };
18878
+ case BridgeStatusCode.TransientError:
18879
+ return {
18880
+ code: WebBrokerBridgeErrorCode.TransientError,
18881
+ innerErrorCode: error.code,
18882
+ description: error.description,
18883
+ };
18884
+ case BridgeStatusCode.PersistentError:
18885
+ return {
18886
+ code: WebBrokerBridgeErrorCode.PersistentError,
18887
+ innerErrorCode: error.code,
18888
+ description: error.description,
18889
+ };
18890
+ case BridgeStatusCode.UserInteractionRequired:
18891
+ return {
18892
+ code: WebBrokerBridgeErrorCode.UserInteractionRequired,
18893
+ innerErrorCode: error.code,
18894
+ description: error.description,
18895
+ };
18896
+ default:
18897
+ return {
18898
+ code: WebBrokerBridgeErrorCode.Unknown,
18899
+ innerErrorCode: error.code,
18900
+ description: error.description,
18901
+ };
18902
+ }
18523
18903
  }
18524
18904
 
18525
18905
  /*
@@ -19005,6 +19385,66 @@
19005
19385
  }
19006
19386
  }
19007
19387
 
19388
+ /*
19389
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19390
+ * Licensed under the MIT License.
19391
+ */
19392
+ /**
19393
+ * Correlates outbound requests with inbound responses by `requestId`.
19394
+ */
19395
+ class PendingRequestRegistry {
19396
+ constructor() {
19397
+ this.pending = new Map();
19398
+ }
19399
+ /**
19400
+ * Register a pending request. Returns a promise that resolves when a
19401
+ * response with the matching `requestId` arrives, or rejects if the
19402
+ * caller invokes `reject` for that id.
19403
+ */
19404
+ register(requestId) {
19405
+ return new Promise((resolve, reject) => {
19406
+ this.pending.set(requestId, { resolve, reject });
19407
+ });
19408
+ }
19409
+ /** Resolve a pending request. No-op if `requestId` isn't registered. */
19410
+ resolve(requestId, response) {
19411
+ const entry = this.pending.get(requestId);
19412
+ if (entry === undefined) {
19413
+ return;
19414
+ }
19415
+ this.pending.delete(requestId);
19416
+ entry.resolve(response);
19417
+ }
19418
+ /** Reject a pending request. No-op if `requestId` isn't registered. */
19419
+ reject(requestId, reason) {
19420
+ const entry = this.pending.get(requestId);
19421
+ if (entry === undefined) {
19422
+ return;
19423
+ }
19424
+ this.pending.delete(requestId);
19425
+ entry.reject(reason);
19426
+ }
19427
+ /** True if `requestId` has an in-flight registration. */
19428
+ has(requestId) {
19429
+ return this.pending.has(requestId);
19430
+ }
19431
+ /**
19432
+ * Register, then invoke `send` synchronously. If `send` throws, the
19433
+ * pending entry is cleared and the promise rejects with the thrown
19434
+ * error.
19435
+ */
19436
+ async sendAndAwait(message, send) {
19437
+ const promise = this.register(message.requestId);
19438
+ try {
19439
+ send(message);
19440
+ }
19441
+ catch (err) {
19442
+ this.reject(message.requestId, err);
19443
+ }
19444
+ return promise;
19445
+ }
19446
+ }
19447
+
19008
19448
  /*
19009
19449
  * Copyright (c) Microsoft Corporation. All rights reserved.
19010
19450
  * Licensed under the MIT License.
@@ -19032,28 +19472,14 @@
19032
19472
  window.nestedAppAuthBridge.addEventListener("message", (response) => {
19033
19473
  const responsePayload = typeof response === "string" ? response : response.data;
19034
19474
  const responseEnvelope = JSON.parse(responsePayload);
19035
- const request = BridgeProxy.bridgeRequests.find((element) => element.requestId === responseEnvelope.requestId);
19036
- if (request !== undefined) {
19037
- BridgeProxy.bridgeRequests.splice(BridgeProxy.bridgeRequests.indexOf(request), 1);
19038
- if (responseEnvelope.success) {
19039
- request.resolve(responseEnvelope);
19040
- }
19041
- else {
19042
- request.reject(responseEnvelope.error);
19043
- }
19475
+ if (responseEnvelope.success) {
19476
+ BridgeProxy.pendingRegistry.resolve(responseEnvelope.requestId, responseEnvelope);
19477
+ }
19478
+ else {
19479
+ BridgeProxy.pendingRegistry.reject(responseEnvelope.requestId, responseEnvelope.error);
19044
19480
  }
19045
19481
  });
19046
- const bridgeResponse = await new Promise((resolve, reject) => {
19047
- const message = BridgeProxy.buildRequest("GetInitContext");
19048
- const request = {
19049
- requestId: message.requestId,
19050
- method: message.method,
19051
- resolve: resolve,
19052
- reject: reject,
19053
- };
19054
- BridgeProxy.bridgeRequests.push(request);
19055
- window.nestedAppAuthBridge.postMessage(JSON.stringify(message));
19056
- });
19482
+ const bridgeResponse = await BridgeProxy.sendRequestViaRegistry(BridgeProxy.buildRequest("GetInitContext"));
19057
19483
  return BridgeProxy.validateBridgeResultOrThrow(bridgeResponse.initContext);
19058
19484
  }
19059
19485
  catch (error) {
@@ -19109,18 +19535,22 @@
19109
19535
  * @returns a promise that resolves to a response of provided type or rejects with a BridgeError
19110
19536
  */
19111
19537
  sendRequest(method, requestParams) {
19112
- const message = BridgeProxy.buildRequest(method, requestParams);
19113
- const promise = new Promise((resolve, reject) => {
19114
- const request = {
19115
- requestId: message.requestId,
19116
- method: message.method,
19117
- resolve: resolve,
19118
- reject: reject,
19119
- };
19120
- BridgeProxy.bridgeRequests.push(request);
19538
+ return BridgeProxy.sendRequestViaRegistry(BridgeProxy.buildRequest(method, requestParams));
19539
+ }
19540
+ /**
19541
+ * Registers `message.requestId` with the shared pending-request
19542
+ * registry, then posts the envelope over the host bridge. Resolves
19543
+ * with the matching response envelope; rejects with the raw
19544
+ * `BridgeError` payload.
19545
+ */
19546
+ static sendRequestViaRegistry(message) {
19547
+ const correlationKey = {
19548
+ requestId: message.requestId,
19549
+ type: message.method,
19550
+ };
19551
+ return BridgeProxy.pendingRegistry.sendAndAwait(correlationKey, () => {
19121
19552
  window.nestedAppAuthBridge.postMessage(JSON.stringify(message));
19122
19553
  });
19123
- return promise;
19124
19554
  }
19125
19555
  static validateBridgeResultOrThrow(input) {
19126
19556
  if (input === undefined) {
@@ -19152,7 +19582,11 @@
19152
19582
  return new BridgeProxy(response.sdkName, response.sdkVersion, response.accountContext, response.capabilities);
19153
19583
  }
19154
19584
  }
19155
- BridgeProxy.bridgeRequests = [];
19585
+ /**
19586
+ * Correlates outbound bridge requests with inbound responses by
19587
+ * `requestId`
19588
+ */
19589
+ BridgeProxy.pendingRegistry = new PendingRequestRegistry();
19156
19590
 
19157
19591
  /*
19158
19592
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -19921,7 +20355,8 @@
19921
20355
  const loggerOptions = (shrOptions && shrOptions.loggerOptions) || {};
19922
20356
  this.logger = new Logger(loggerOptions, name, version);
19923
20357
  this.cryptoOps = new CryptoOps(this.logger);
19924
- this.popTokenGenerator = new PopTokenGenerator(this.cryptoOps, new StubPerformanceClient());
20358
+ const tokenBindingKeyManager = new TokenBindingKeyManager(this.logger);
20359
+ this.popTokenGenerator = new PopTokenGenerator(this.cryptoOps, tokenBindingKeyManager, new StubPerformanceClient());
19925
20360
  this.shrParameters = shrParameters;
19926
20361
  }
19927
20362
  /**