@azure/msal-browser 5.17.1 → 5.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) 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 +2 -4
  5. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -1
  6. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +1 -1
  8. package/dist/cache/AccountManager.mjs +1 -1
  9. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +15 -7
  11. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  12. package/dist/cache/CacheHelpers.mjs +1 -1
  13. package/dist/cache/CacheKeys.mjs +1 -1
  14. package/dist/cache/CookieStorage.mjs +1 -1
  15. package/dist/cache/DatabaseStorage.mjs +1 -1
  16. package/dist/cache/EncryptedData.mjs +1 -1
  17. package/dist/cache/LocalStorage.mjs +1 -1
  18. package/dist/cache/MemoryStorage.mjs +1 -1
  19. package/dist/cache/SessionStorage.mjs +1 -1
  20. package/dist/cache/TokenCache.mjs +1 -1
  21. package/dist/config/Configuration.mjs +1 -1
  22. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  23. package/dist/controllers/StandardController.mjs +36 -28
  24. package/dist/controllers/StandardController.mjs.map +1 -1
  25. package/dist/crypto/BrowserCrypto.mjs +1 -1
  26. package/dist/crypto/CryptoOps.mjs +1 -1
  27. package/dist/crypto/PkceGenerator.mjs +1 -1
  28. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  29. package/dist/custom_auth/CustomAuthConstants.mjs +1 -1
  30. package/dist/custom_auth/CustomAuthPublicClientApplication.mjs +1 -1
  31. package/dist/custom_auth/controller/CustomAuthStandardController.mjs +1 -1
  32. package/dist/custom_auth/core/CustomAuthAuthority.mjs +1 -1
  33. package/dist/custom_auth/core/auth_flow/AuthFlowErrorBase.mjs +1 -1
  34. package/dist/custom_auth/core/auth_flow/AuthFlowResultBase.mjs +1 -1
  35. package/dist/custom_auth/core/auth_flow/AuthFlowState.mjs +1 -1
  36. package/dist/custom_auth/core/auth_flow/AuthFlowStateTypes.mjs +1 -1
  37. package/dist/custom_auth/core/auth_flow/jit/error_type/AuthMethodRegistrationError.mjs +1 -1
  38. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationChallengeMethodResult.mjs +1 -1
  39. package/dist/custom_auth/core/auth_flow/jit/result/AuthMethodRegistrationSubmitChallengeResult.mjs +1 -1
  40. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationCompletedState.mjs +1 -1
  41. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationFailedState.mjs +1 -1
  42. package/dist/custom_auth/core/auth_flow/jit/state/AuthMethodRegistrationState.mjs +1 -1
  43. package/dist/custom_auth/core/auth_flow/mfa/error_type/MfaError.mjs +1 -1
  44. package/dist/custom_auth/core/auth_flow/mfa/result/MfaRequestChallengeResult.mjs +1 -1
  45. package/dist/custom_auth/core/auth_flow/mfa/result/MfaSubmitChallengeResult.mjs +1 -1
  46. package/dist/custom_auth/core/auth_flow/mfa/state/MfaCompletedState.mjs +1 -1
  47. package/dist/custom_auth/core/auth_flow/mfa/state/MfaFailedState.mjs +1 -1
  48. package/dist/custom_auth/core/auth_flow/mfa/state/MfaState.mjs +1 -1
  49. package/dist/custom_auth/core/error/CustomAuthApiError.mjs +1 -1
  50. package/dist/custom_auth/core/error/CustomAuthError.mjs +1 -1
  51. package/dist/custom_auth/core/error/HttpError.mjs +1 -1
  52. package/dist/custom_auth/core/error/HttpErrorCodes.mjs +1 -1
  53. package/dist/custom_auth/core/error/InvalidArgumentError.mjs +1 -1
  54. package/dist/custom_auth/core/error/InvalidConfigurationError.mjs +1 -1
  55. package/dist/custom_auth/core/error/InvalidConfigurationErrorCodes.mjs +1 -1
  56. package/dist/custom_auth/core/error/MethodNotImplementedError.mjs +1 -1
  57. package/dist/custom_auth/core/error/MsalCustomAuthError.mjs +1 -1
  58. package/dist/custom_auth/core/error/NoCachedAccountFoundError.mjs +1 -1
  59. package/dist/custom_auth/core/error/ParsedUrlError.mjs +1 -1
  60. package/dist/custom_auth/core/error/ParsedUrlErrorCodes.mjs +1 -1
  61. package/dist/custom_auth/core/error/UnexpectedError.mjs +1 -1
  62. package/dist/custom_auth/core/error/UnsupportedEnvironmentError.mjs +1 -1
  63. package/dist/custom_auth/core/error/UserAccountAttributeError.mjs +1 -1
  64. package/dist/custom_auth/core/error/UserAlreadySignedInError.mjs +1 -1
  65. package/dist/custom_auth/core/interaction_client/CustomAuthInteractionClientBase.mjs +1 -1
  66. package/dist/custom_auth/core/interaction_client/CustomAuthInterationClientFactory.mjs +1 -1
  67. package/dist/custom_auth/core/interaction_client/jit/JitClient.mjs +1 -1
  68. package/dist/custom_auth/core/interaction_client/jit/result/JitActionResult.mjs +1 -1
  69. package/dist/custom_auth/core/interaction_client/mfa/MfaClient.mjs +1 -1
  70. package/dist/custom_auth/core/interaction_client/mfa/result/MfaActionResult.mjs +1 -1
  71. package/dist/custom_auth/core/network_client/custom_auth_api/BaseApiClient.mjs +1 -1
  72. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiClient.mjs +1 -1
  73. package/dist/custom_auth/core/network_client/custom_auth_api/CustomAuthApiEndpoint.mjs +1 -1
  74. package/dist/custom_auth/core/network_client/custom_auth_api/RegisterApiClient.mjs +1 -1
  75. package/dist/custom_auth/core/network_client/custom_auth_api/ResetPasswordApiClient.mjs +1 -1
  76. package/dist/custom_auth/core/network_client/custom_auth_api/SignInApiClient.mjs +1 -1
  77. package/dist/custom_auth/core/network_client/custom_auth_api/SignupApiClient.mjs +1 -1
  78. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiErrorCodes.mjs +1 -1
  79. package/dist/custom_auth/core/network_client/custom_auth_api/types/ApiSuberrors.mjs +1 -1
  80. package/dist/custom_auth/core/network_client/http_client/FetchHttpClient.mjs +1 -1
  81. package/dist/custom_auth/core/network_client/http_client/IHttpClient.mjs +1 -1
  82. package/dist/custom_auth/core/telemetry/PublicApiId.mjs +1 -1
  83. package/dist/custom_auth/core/utils/ArgumentValidator.mjs +1 -1
  84. package/dist/custom_auth/core/utils/CustomHeaderUtils.mjs +1 -1
  85. package/dist/custom_auth/core/utils/UrlUtils.mjs +1 -1
  86. package/dist/custom_auth/get_account/auth_flow/CustomAuthAccountData.mjs +1 -1
  87. package/dist/custom_auth/get_account/auth_flow/error_type/GetAccountError.mjs +1 -1
  88. package/dist/custom_auth/get_account/auth_flow/result/GetAccessTokenResult.mjs +1 -1
  89. package/dist/custom_auth/get_account/auth_flow/result/GetAccountResult.mjs +1 -1
  90. package/dist/custom_auth/get_account/auth_flow/result/SignOutResult.mjs +1 -1
  91. package/dist/custom_auth/get_account/auth_flow/state/GetAccessTokenState.mjs +1 -1
  92. package/dist/custom_auth/get_account/auth_flow/state/GetAccountState.mjs +1 -1
  93. package/dist/custom_auth/get_account/auth_flow/state/SignOutState.mjs +1 -1
  94. package/dist/custom_auth/get_account/interaction_client/CustomAuthSilentCacheClient.mjs +1 -1
  95. package/dist/custom_auth/index.mjs +1 -1
  96. package/dist/custom_auth/operating_context/CustomAuthOperatingContext.mjs +1 -1
  97. package/dist/custom_auth/reset_password/auth_flow/error_type/ResetPasswordError.mjs +1 -1
  98. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordResendCodeResult.mjs +1 -1
  99. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordStartResult.mjs +1 -1
  100. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitCodeResult.mjs +1 -1
  101. package/dist/custom_auth/reset_password/auth_flow/result/ResetPasswordSubmitPasswordResult.mjs +1 -1
  102. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCodeRequiredState.mjs +1 -1
  103. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordCompletedState.mjs +1 -1
  104. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordFailedState.mjs +1 -1
  105. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordPasswordRequiredState.mjs +1 -1
  106. package/dist/custom_auth/reset_password/auth_flow/state/ResetPasswordState.mjs +1 -1
  107. package/dist/custom_auth/reset_password/interaction_client/ResetPasswordClient.mjs +1 -1
  108. package/dist/custom_auth/sign_in/auth_flow/SignInScenario.mjs +1 -1
  109. package/dist/custom_auth/sign_in/auth_flow/error_type/SignInError.mjs +1 -1
  110. package/dist/custom_auth/sign_in/auth_flow/result/SignInResendCodeResult.mjs +1 -1
  111. package/dist/custom_auth/sign_in/auth_flow/result/SignInResult.mjs +1 -1
  112. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitCodeResult.mjs +1 -1
  113. package/dist/custom_auth/sign_in/auth_flow/result/SignInSubmitPasswordResult.mjs +1 -1
  114. package/dist/custom_auth/sign_in/auth_flow/state/SignInCodeRequiredState.mjs +1 -1
  115. package/dist/custom_auth/sign_in/auth_flow/state/SignInCompletedState.mjs +1 -1
  116. package/dist/custom_auth/sign_in/auth_flow/state/SignInContinuationState.mjs +1 -1
  117. package/dist/custom_auth/sign_in/auth_flow/state/SignInFailedState.mjs +1 -1
  118. package/dist/custom_auth/sign_in/auth_flow/state/SignInPasswordRequiredState.mjs +1 -1
  119. package/dist/custom_auth/sign_in/auth_flow/state/SignInState.mjs +1 -1
  120. package/dist/custom_auth/sign_in/interaction_client/SignInClient.mjs +1 -1
  121. package/dist/custom_auth/sign_in/interaction_client/result/SignInActionResult.mjs +1 -1
  122. package/dist/custom_auth/sign_up/auth_flow/error_type/SignUpError.mjs +1 -1
  123. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResendCodeResult.mjs +1 -1
  124. package/dist/custom_auth/sign_up/auth_flow/result/SignUpResult.mjs +1 -1
  125. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitAttributesResult.mjs +1 -1
  126. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitCodeResult.mjs +1 -1
  127. package/dist/custom_auth/sign_up/auth_flow/result/SignUpSubmitPasswordResult.mjs +1 -1
  128. package/dist/custom_auth/sign_up/auth_flow/state/SignUpAttributesRequiredState.mjs +1 -1
  129. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCodeRequiredState.mjs +1 -1
  130. package/dist/custom_auth/sign_up/auth_flow/state/SignUpCompletedState.mjs +1 -1
  131. package/dist/custom_auth/sign_up/auth_flow/state/SignUpFailedState.mjs +1 -1
  132. package/dist/custom_auth/sign_up/auth_flow/state/SignUpPasswordRequiredState.mjs +1 -1
  133. package/dist/custom_auth/sign_up/auth_flow/state/SignUpState.mjs +1 -1
  134. package/dist/custom_auth/sign_up/interaction_client/SignUpClient.mjs +1 -1
  135. package/dist/custom_auth/sign_up/interaction_client/result/SignUpActionResult.mjs +1 -1
  136. package/dist/encode/Base64Decode.mjs +1 -1
  137. package/dist/encode/Base64Encode.mjs +1 -1
  138. package/dist/error/BrowserAuthError.mjs +1 -1
  139. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  140. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  141. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  142. package/dist/error/NativeAuthError.mjs +1 -1
  143. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  144. package/dist/error/NestedAppAuthError.mjs +1 -1
  145. package/dist/event/EventHandler.mjs +1 -1
  146. package/dist/event/EventMessage.mjs +1 -1
  147. package/dist/event/EventType.mjs +1 -1
  148. package/dist/index.mjs +1 -1
  149. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  150. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  151. package/dist/interaction_client/PlatformAuthInteractionClient.mjs +146 -61
  152. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -1
  153. package/dist/interaction_client/PopupClient.mjs +1 -1
  154. package/dist/interaction_client/RedirectClient.mjs +1 -1
  155. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  156. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  157. package/dist/interaction_client/SilentIframeClient.mjs +1 -1
  158. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  159. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  160. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  161. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  162. package/dist/log-strings-mapping.json +246 -246
  163. package/dist/naa/BridgeError.mjs +1 -1
  164. package/dist/naa/BridgeProxy.mjs +1 -1
  165. package/dist/naa/BridgeStatusCode.mjs +1 -1
  166. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +4 -2
  167. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -1
  168. package/dist/navigation/NavigationClient.mjs +1 -1
  169. package/dist/network/FetchClient.mjs +39 -13
  170. package/dist/network/FetchClient.mjs.map +1 -1
  171. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  172. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  173. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  174. package/dist/packageMetadata.mjs +2 -2
  175. package/dist/popup_relay/constants.mjs +1 -1
  176. package/dist/popup_relay/index.mjs +1 -1
  177. package/dist/popup_relay/relayClient.mjs +1 -1
  178. package/dist/protocol/Authorize.mjs +1 -1
  179. package/dist/redirect_bridge/index.mjs +1 -1
  180. package/dist/request/RequestHelpers.mjs +1 -1
  181. package/dist/response/ResponseHandler.mjs +1 -1
  182. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  183. package/dist/telemetry/BrowserPerformanceEvents.mjs +1 -1
  184. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  185. package/dist/telemetry/BrowserRootPerformanceEvents.mjs +1 -1
  186. package/dist/utils/BrowserConstants.mjs +1 -1
  187. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  188. package/dist/utils/BrowserUtils.mjs +1 -1
  189. package/dist/utils/Helpers.mjs +1 -1
  190. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  191. package/lib/custom-auth-path/log-strings-mapping.json +2 -2
  192. package/lib/custom-auth-path/msal-custom-auth.cjs +453 -207
  193. package/lib/custom-auth-path/msal-custom-auth.cjs.map +1 -1
  194. package/lib/custom-auth-path/msal-custom-auth.js +453 -207
  195. package/lib/custom-auth-path/msal-custom-auth.js.map +1 -1
  196. package/lib/log-strings-mapping.json +2 -2
  197. package/lib/msal-browser.cjs +458 -209
  198. package/lib/msal-browser.cjs.map +1 -1
  199. package/lib/msal-browser.js +458 -209
  200. package/lib/msal-browser.js.map +1 -1
  201. package/lib/msal-browser.min.js +2 -2
  202. package/lib/popup-relay/msal-popup-relay.cjs +2 -2
  203. package/lib/popup-relay/msal-popup-relay.cjs.map +1 -1
  204. package/lib/popup-relay/msal-popup-relay.js +2 -2
  205. package/lib/popup-relay/msal-popup-relay.js.map +1 -1
  206. package/lib/popup-relay/msal-popup-relay.min.js +1 -1
  207. package/lib/redirect-bridge/msal-redirect-bridge.cjs +10 -10
  208. package/lib/redirect-bridge/msal-redirect-bridge.cjs.map +1 -1
  209. package/lib/redirect-bridge/msal-redirect-bridge.js +10 -10
  210. package/lib/redirect-bridge/msal-redirect-bridge.js.map +1 -1
  211. package/lib/redirect-bridge/msal-redirect-bridge.min.js +1 -1
  212. package/package.json +2 -2
  213. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +0 -4
  214. package/src/broker/nativeBroker/PlatformAuthRequest.ts +6 -8
  215. package/src/cache/BrowserCacheManager.ts +24 -6
  216. package/src/controllers/StandardController.ts +44 -31
  217. package/src/interaction_client/PlatformAuthInteractionClient.ts +194 -74
  218. package/src/naa/TokenRequest.ts +1 -0
  219. package/src/naa/mapping/NestedAppAuthAdapter.ts +5 -0
  220. package/src/network/FetchClient.ts +62 -14
  221. package/src/packageMetadata.ts +1 -1
  222. package/src/webBrokerBridge/IWebBrokerBridgeMessage.ts +42 -0
  223. package/src/webBrokerBridge/PendingRequestRegistry.ts +79 -0
  224. package/src/webBrokerBridge/WebBrokerBridgeError.ts +69 -0
  225. package/src/webBrokerBridge/WebBrokerBridgeErrorMap.ts +108 -0
  226. package/src/webBrokerBridge/index.ts +25 -0
  227. package/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -1
  228. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts +4 -6
  229. package/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -1
  230. package/types/cache/BrowserCacheManager.d.ts +7 -5
  231. package/types/cache/BrowserCacheManager.d.ts.map +1 -1
  232. package/types/controllers/StandardController.d.ts +3 -0
  233. package/types/controllers/StandardController.d.ts.map +1 -1
  234. package/types/custom_auth/CustomAuthConstants.d.ts +1 -1
  235. package/types/interaction_client/PlatformAuthInteractionClient.d.ts +13 -3
  236. package/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -1
  237. package/types/naa/TokenRequest.d.ts +1 -0
  238. package/types/naa/TokenRequest.d.ts.map +1 -1
  239. package/types/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -1
  240. package/types/network/FetchClient.d.ts.map +1 -1
  241. package/types/packageMetadata.d.ts +1 -1
  242. package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts +35 -0
  243. package/types/webBrokerBridge/IWebBrokerBridgeMessage.d.ts.map +1 -0
  244. package/types/webBrokerBridge/PendingRequestRegistry.d.ts +27 -0
  245. package/types/webBrokerBridge/PendingRequestRegistry.d.ts.map +1 -0
  246. package/types/webBrokerBridge/WebBrokerBridgeError.d.ts +50 -0
  247. package/types/webBrokerBridge/WebBrokerBridgeError.d.ts.map +1 -0
  248. package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts +10 -0
  249. package/types/webBrokerBridge/WebBrokerBridgeErrorMap.d.ts.map +1 -0
  250. package/types/webBrokerBridge/index.d.ts +16 -0
  251. package/types/webBrokerBridge/index.d.ts.map +1 -0
@@ -27,6 +27,7 @@ import {
27
27
  ScopeSet,
28
28
  ServerTelemetryManager,
29
29
  SignedHttpRequestParameters,
30
+ StoreInCache,
30
31
  TimeUtils,
31
32
  TokenClaims,
32
33
  UrlString,
@@ -182,77 +183,119 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
182
183
  this.config.system.serverTelemetryEnabled
183
184
  );
184
185
 
186
+ // initialize native request (statically builds the request; does not contact the broker)
187
+ let nativeRequest: PlatformAuthRequest;
185
188
  try {
186
- // initialize native request
187
- const nativeRequest = await this.initializePlatformRequest(request);
189
+ nativeRequest = await this.initializePlatformRequest(request);
190
+ } catch (e) {
191
+ /*
192
+ * Request initialization (e.g. PoP token generation or authority
193
+ * resolution) failed before the broker was contacted, so end the
194
+ * measurement here to avoid an orphaned sub-measurement.
195
+ * Broker was never engaged, so this was not a native broker outcome.
196
+ */
197
+ nativeATMeasurement.add({
198
+ isNativeBroker: false,
199
+ });
200
+ nativeATMeasurement.end(
201
+ {
202
+ success: false,
203
+ },
204
+ e
205
+ );
206
+ throw e;
207
+ }
188
208
 
189
- // check if the tokens can be retrieved from internal cache
190
- try {
191
- const result = await this.acquireTokensFromCache(
192
- this.accountId,
193
- nativeRequest
194
- );
195
- nativeATMeasurement.end({
196
- success: true,
197
- isNativeBroker: false, // Should be true only when the result is coming directly from the broker
198
- fromCache: true,
199
- });
200
- return result;
201
- } catch (e) {
202
- if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
203
- this.logger.info(
204
- "MSAL internal Cache does not contain tokens, return error as per cache policy",
205
- this.correlationId
206
- );
207
- nativeATMeasurement.end({
208
- success: false,
209
- brokerErrorCode: "cache_request_failed",
210
- });
211
- throw e;
212
- }
213
- // continue with a native call for any and all errors
209
+ // check if the tokens can be retrieved from internal cache
210
+ try {
211
+ const result = await this.acquireTokensFromCache(
212
+ this.accountId,
213
+ nativeRequest
214
+ );
215
+ // Served from the native internal cache; token did not come directly from the broker
216
+ nativeATMeasurement.add({
217
+ isNativeBroker: false,
218
+ });
219
+ nativeATMeasurement.end({
220
+ success: true,
221
+ fromCache: true,
222
+ });
223
+ return result;
224
+ } catch (e) {
225
+ if (cacheLookupPolicy === CacheLookupPolicy.AccessToken) {
214
226
  this.logger.info(
215
- "MSAL internal Cache does not contain tokens, proceed to make a native call",
227
+ "MSAL internal Cache does not contain tokens, return error as per cache policy",
216
228
  this.correlationId
217
229
  );
230
+ nativeATMeasurement.add({
231
+ isNativeBroker: false,
232
+ });
233
+ nativeATMeasurement.end({
234
+ success: false,
235
+ });
236
+ throw e;
218
237
  }
238
+ // continue with a native call for any and all errors
239
+ this.logger.info(
240
+ "MSAL internal Cache does not contain tokens, proceed to make a native call",
241
+ this.correlationId
242
+ );
243
+ }
219
244
 
245
+ // dispatch the request to the broker
246
+ try {
220
247
  const validatedResponse: PlatformAuthResponse =
221
248
  await this.platformAuthProvider.sendMessage(nativeRequest);
222
249
 
223
- return await this.handleNativeResponse(
250
+ const result = await this.handleNativeResponse(
224
251
  validatedResponse,
225
252
  nativeRequest,
226
- reqTimestamp
227
- )
228
- .then((result: AuthenticationResult) => {
229
- nativeATMeasurement.end({
230
- success: true,
231
- isNativeBroker: true,
232
- requestId: result.requestId,
233
- });
234
- serverTelemetryManager.clearNativeBrokerErrorCode();
235
- return result;
236
- })
237
- .catch((error: AuthError) => {
238
- nativeATMeasurement.end({
239
- success: false,
240
- errorCode: error.errorCode,
241
- subErrorCode: error.subError,
242
- });
243
- throw error;
244
- });
253
+ reqTimestamp,
254
+ request.storeInCache
255
+ );
256
+ nativeATMeasurement.end({
257
+ success: true,
258
+ requestId: result.requestId,
259
+ });
260
+ serverTelemetryManager.clearNativeBrokerErrorCode();
261
+ return result;
245
262
  } catch (e) {
246
263
  if (e instanceof NativeAuthError) {
247
264
  serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
248
265
  }
249
- nativeATMeasurement.end({
250
- success: false,
251
- });
266
+ nativeATMeasurement.end(
267
+ {
268
+ success: false,
269
+ },
270
+ e
271
+ );
272
+ this.setBrokerErrorTelemetry(e);
252
273
  throw e;
253
274
  }
254
275
  }
255
276
 
277
+ /**
278
+ * Records platform-broker error telemetry on the root event for the current
279
+ * correlationId. `isNativeBroker` is set optimistically to true because the
280
+ * broker was engaged; when the caller subsequently falls back to a web flow
281
+ * that succeeds, the root success measurement overrides it to false via
282
+ * `result.fromPlatformBroker`. Terminal broker errors (no fallback) retain
283
+ * true. `brokerErrorName`/`brokerErrorCode` are recorded when the error is an `AuthError`.
284
+ * @param error error thrown by the broker interaction
285
+ */
286
+ private setBrokerErrorTelemetry(error: unknown): void {
287
+ if (error instanceof AuthError) {
288
+ this.performanceClient.addFields(
289
+ {
290
+ isNativeBroker: true,
291
+ brokerErrorName: error.name,
292
+ brokerErrorCode: error.errorCode,
293
+ },
294
+ this.correlationId
295
+ );
296
+ }
297
+ }
298
+
256
299
  /**
257
300
  * Creates silent flow request
258
301
  * @param request
@@ -263,7 +306,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
263
306
  request: PlatformAuthRequest,
264
307
  cachedAccount: AccountInfo
265
308
  ): CommonSilentFlowRequest {
266
- return {
309
+ const silentRequest: CommonSilentFlowRequest = {
267
310
  authority: request.authority,
268
311
  correlationId: this.correlationId,
269
312
  scopes: ScopeSet.fromString(
@@ -273,6 +316,13 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
273
316
  account: cachedAccount,
274
317
  forceRefresh: false,
275
318
  };
319
+
320
+ // Preserve FMI partition semantics for silent cache filtering.
321
+ if (request.attributeTokens) {
322
+ silentRequest.attributeTokens = request.attributeTokens.split(" ");
323
+ }
324
+
325
+ return silentRequest;
276
326
  }
277
327
 
278
328
  /**
@@ -387,13 +437,23 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
387
437
  );
388
438
  serverTelemetryManager.setNativeBrokerErrorCode(e.errorCode);
389
439
  if (isFatalNativeAuthError(e)) {
440
+ /*
441
+ * Fatal error on redirect initiate always falls back to a
442
+ * regular web redirect, so this request did not complete
443
+ * natively. Token telemetry for the eventual outcome lands
444
+ * in handleRedirectPromise (phase 2).
445
+ */
446
+ this.setBrokerErrorTelemetry(e);
390
447
  throw e;
391
448
  }
392
449
  }
393
450
  }
394
451
  this.browserStorage.setTemporaryCache(
395
452
  TemporaryCacheKeys.NATIVE_REQUEST,
396
- JSON.stringify(nativeRequest),
453
+ JSON.stringify({
454
+ ...nativeRequest,
455
+ storeInCache: request.storeInCache,
456
+ }),
397
457
  true
398
458
  );
399
459
 
@@ -453,7 +513,14 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
453
513
  return null;
454
514
  }
455
515
 
456
- const { prompt, ...request } = cachedRequest;
516
+ /*
517
+ * storeInCache is a client-side cache directive persisted alongside the cached
518
+ * request (not a broker-contract parameter), so extract it here before resending.
519
+ */
520
+ const { prompt, storeInCache, ...request } =
521
+ cachedRequest as PlatformAuthRequest & {
522
+ storeInCache?: StoreInCache;
523
+ };
457
524
  if (prompt) {
458
525
  this.logger.verbose(
459
526
  "NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.",
@@ -479,7 +546,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
479
546
  const authResult = await this.handleNativeResponse(
480
547
  response,
481
548
  request,
482
- reqTimestamp
549
+ reqTimestamp,
550
+ storeInCache
483
551
  );
484
552
 
485
553
  const serverTelemetryManager = initializeServerTelemetryManager(
@@ -492,12 +560,9 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
492
560
  this.config.system.serverTelemetryEnabled
493
561
  );
494
562
  serverTelemetryManager.clearNativeBrokerErrorCode();
495
- this.performanceClient?.addFields(
496
- { isNativeBroker: true },
497
- this.correlationId
498
- );
499
563
  return authResult;
500
564
  } catch (e) {
565
+ this.setBrokerErrorTelemetry(e);
501
566
  throw e;
502
567
  }
503
568
  }
@@ -523,7 +588,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
523
588
  protected async handleNativeResponse(
524
589
  response: PlatformAuthResponse,
525
590
  request: PlatformAuthRequest,
526
- reqTimestamp: number
591
+ reqTimestamp: number,
592
+ storeInCache?: StoreInCache
527
593
  ): Promise<AuthenticationResult> {
528
594
  this.logger.trace(
529
595
  "NativeInteractionClient - handleNativeResponse called.",
@@ -618,7 +684,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
618
684
  idTokenClaims,
619
685
  result.tenantId,
620
686
  reqTimestamp,
621
- authority.getPreferredCache() // environment
687
+ authority.getPreferredCache(), // environment
688
+ storeInCache
622
689
  );
623
690
 
624
691
  return result;
@@ -806,7 +873,9 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
806
873
  correlationId: this.correlationId,
807
874
  state: response.state,
808
875
  fromPlatformBroker: true,
809
- ...(request.resource && { resource: request.resource }),
876
+ ...(request.extraParameters?.resource && {
877
+ resource: request.extraParameters.resource,
878
+ }),
810
879
  };
811
880
 
812
881
  return result;
@@ -851,7 +920,8 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
851
920
  idTokenClaims: TokenClaims,
852
921
  tenantId: string,
853
922
  reqTimestamp: number,
854
- environment: string
923
+ environment: string,
924
+ storeInCache?: StoreInCache
855
925
  ): Promise<void> {
856
926
  const cachedIdToken: IdTokenEntity | null =
857
927
  CacheHelpers.createIdTokenEntity(
@@ -875,6 +945,12 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
875
945
  request.scope
876
946
  );
877
947
 
948
+ const additionalCacheKeyComponents = request.attributeTokens
949
+ ? {
950
+ attribute_tokens: request.attributeTokens,
951
+ }
952
+ : undefined;
953
+
878
954
  const cachedAccessToken: AccessTokenEntity | null =
879
955
  CacheHelpers.createAccessTokenEntity(
880
956
  homeAccountIdentifier,
@@ -890,11 +966,12 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
890
966
  undefined,
891
967
  request.tokenType as Constants.AuthenticationScheme,
892
968
  undefined,
893
- request.keyId
969
+ request.keyId,
970
+ additionalCacheKeyComponents
894
971
  );
895
972
 
896
973
  // save idtoken credential in configured browser storage
897
- if (!!cachedIdToken && request.storeInCache?.idToken !== false) {
974
+ if (!!cachedIdToken && storeInCache?.idToken !== false) {
898
975
  await this.browserStorage.setIdTokenCredential(
899
976
  cachedIdToken,
900
977
  this.correlationId,
@@ -912,7 +989,7 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
912
989
  this.correlationId,
913
990
  AuthToken.isKmsi(idTokenClaims),
914
991
  this.apiId,
915
- request.storeInCache
992
+ storeInCache
916
993
  );
917
994
  }
918
995
 
@@ -1018,8 +1095,11 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1018
1095
  ? undefined
1019
1096
  : this.config.auth.clientCapabilities;
1020
1097
 
1021
- // scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
1022
- const { scopes, claims, ...remainingProperties } = request;
1098
+ /*
1099
+ * scopes are expected to be received by the native broker as "scope" and will be added to the request below. Other properties that should be dropped from the request to the native broker can be included in the object destructuring here.
1100
+ * attributeTokens is destructured out because PlatformAuthRequest represents it as a pre-serialized string, not the caller-provided Array<string>.
1101
+ */
1102
+ const { scopes, claims } = request;
1023
1103
  const scopeSet = new ScopeSet(scopes || [], this.correlationId);
1024
1104
  scopeSet.appendScopes(Constants.OIDC_DEFAULT_SCOPES);
1025
1105
 
@@ -1028,8 +1108,15 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1028
1108
  configClaims?.length ? configClaims : undefined
1029
1109
  );
1030
1110
 
1111
+ const hasAttributeTokens = !!request.attributeTokens?.length;
1112
+ this.performanceClient?.addFields(
1113
+ {
1114
+ hasAttributeTokens,
1115
+ },
1116
+ this.correlationId
1117
+ );
1118
+
1031
1119
  const validatedRequest: PlatformAuthRequest = {
1032
- ...remainingProperties,
1033
1120
  claims: mergedClaims,
1034
1121
  accountId: this.accountId,
1035
1122
  clientId: this.config.auth.clientId,
@@ -1043,15 +1130,31 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1043
1130
  ),
1044
1131
  prompt: this.getPrompt(request.prompt),
1045
1132
  correlationId: this.correlationId,
1133
+ isSts: false,
1046
1134
  tokenType: request.authenticationScheme,
1047
1135
  windowTitleSubstring: document.title,
1136
+ nonce: request.nonce,
1137
+ state: request.state,
1138
+ loginHint: request.loginHint,
1048
1139
  extraParameters: {
1049
1140
  ...request.extraParameters,
1141
+ ...(request.resource && { resource: request.resource }), // resource is set for MCP scenarios
1050
1142
  },
1051
1143
  extendedExpiryToken: false, // Make this configurable?
1052
1144
  keyId: request.popKid,
1145
+ resourceRequestMethod: request.resourceRequestMethod,
1146
+ resourceRequestUri: request.resourceRequestUri,
1147
+ shrClaims: request.shrClaims,
1148
+ shrNonce: request.shrNonce,
1053
1149
  };
1054
1150
 
1151
+ if (hasAttributeTokens) {
1152
+ validatedRequest.attributeTokens =
1153
+ CacheHelpers.serializeAttributeTokens(
1154
+ request.attributeTokens as Array<string>
1155
+ );
1156
+ }
1157
+
1055
1158
  // Check for PoP token requests: signPopToken should only be set to true if popKid is not set
1056
1159
  if (validatedRequest.signPopToken && !!request.popKid) {
1057
1160
  throw createBrowserAuthError(
@@ -1060,7 +1163,10 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1060
1163
  );
1061
1164
  }
1062
1165
 
1063
- this.handleExtraBrokerParams(validatedRequest);
1166
+ this.handleExtraBrokerParams(
1167
+ validatedRequest,
1168
+ request.embeddedClientId
1169
+ );
1064
1170
  validatedRequest.extraParameters =
1065
1171
  validatedRequest.extraParameters || {};
1066
1172
  validatedRequest.extraParameters.telemetry =
@@ -1192,7 +1298,10 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1192
1298
  * @param request {PlatformAuthRequest}
1193
1299
  * @private
1194
1300
  */
1195
- private handleExtraBrokerParams(request: PlatformAuthRequest): void {
1301
+ private handleExtraBrokerParams(
1302
+ request: PlatformAuthRequest,
1303
+ embeddedClientId?: string
1304
+ ): void {
1196
1305
  const hasExtraBrokerParams =
1197
1306
  request.extraParameters &&
1198
1307
  request.extraParameters.hasOwnProperty(
@@ -1205,16 +1314,16 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1205
1314
  AADServerParamKeys.CLIENT_ID
1206
1315
  );
1207
1316
 
1208
- if (!request.embeddedClientId && !hasExtraBrokerParams) {
1317
+ if (!embeddedClientId && !hasExtraBrokerParams) {
1209
1318
  return;
1210
1319
  }
1211
1320
 
1212
1321
  let child_client_id: string = "";
1213
1322
  const child_redirect_uri = request.redirectUri;
1214
1323
 
1215
- if (request.embeddedClientId) {
1324
+ if (embeddedClientId) {
1216
1325
  request.redirectUri = this.config.auth.redirectUri;
1217
- child_client_id = request.embeddedClientId;
1326
+ child_client_id = embeddedClientId;
1218
1327
  } else if (request.extraParameters) {
1219
1328
  request.redirectUri =
1220
1329
  request.extraParameters[AADServerParamKeys.BROKER_REDIRECT_URI];
@@ -1222,7 +1331,18 @@ export class PlatformAuthInteractionClient extends BaseInteractionClient {
1222
1331
  request.extraParameters[AADServerParamKeys.CLIENT_ID];
1223
1332
  }
1224
1333
 
1334
+ const {
1335
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1336
+ [AADServerParamKeys.BROKER_CLIENT_ID]: _brkClientId,
1337
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1338
+ [AADServerParamKeys.BROKER_REDIRECT_URI]: _brkRedirectUri,
1339
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1340
+ [AADServerParamKeys.CLIENT_ID]: _clientId,
1341
+ ...remainingExtraParameters
1342
+ } = request.extraParameters || {};
1343
+
1225
1344
  request.extraParameters = {
1345
+ ...remainingExtraParameters,
1226
1346
  child_client_id,
1227
1347
  child_redirect_uri,
1228
1348
  };
@@ -22,4 +22,5 @@ export type TokenRequest = {
22
22
  extendedExpiryToken?: boolean;
23
23
  extraParameters?: Map<string, string>;
24
24
  forceRefresh?: boolean;
25
+ attributeTokens?: string; // Pre-serialized attribute tokens forwarded to the host app; defaults to `undefined` when missing or empty.
25
26
  };
@@ -30,6 +30,7 @@ import {
30
30
  getTenantIdFromIdTokenClaims,
31
31
  TimeUtils,
32
32
  Constants,
33
+ CacheHelpers,
33
34
  } from "@azure/msal-common/browser";
34
35
  import { isBridgeError } from "../BridgeError.js";
35
36
  import { BridgeStatusCode } from "../BridgeStatusCode.js";
@@ -80,6 +81,9 @@ export class NestedAppAuthAdapter {
80
81
  this.clientCapabilities
81
82
  );
82
83
  const scopes = request.scopes || Constants.OIDC_DEFAULT_SCOPES;
84
+ const attributeTokens = CacheHelpers.serializeAttributeTokens(
85
+ request.attributeTokens
86
+ );
83
87
  const tokenRequest: TokenRequest = {
84
88
  platformBrokerId: request.account?.homeAccountId,
85
89
  clientId: this.clientId,
@@ -93,6 +97,7 @@ export class NestedAppAuthAdapter {
93
97
  request.authenticationScheme ||
94
98
  Constants.AuthenticationScheme.BEARER,
95
99
  extraParameters: extraParams,
100
+ attributeTokens,
96
101
  };
97
102
 
98
103
  return tokenRequest;
@@ -15,6 +15,9 @@ import {
15
15
  } from "../error/BrowserAuthError.js";
16
16
  import { HTTP_REQUEST_TYPE } from "../utils/BrowserConstants.js";
17
17
 
18
+ const MAX_FETCH_POST_RETRIES = 1;
19
+ const RETRY_DELAY_MS = 100;
20
+
18
21
  /**
19
22
  * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
20
23
  */
@@ -85,30 +88,67 @@ export class FetchClient implements INetworkModule {
85
88
  ): Promise<NetworkResponse<T>> {
86
89
  const reqBody = (options && options.body) || "";
87
90
  const reqHeaders = getFetchHeaders(options);
91
+ const correlationId = options?.correlationId;
92
+ const performanceClient = options?.performanceClient;
88
93
 
89
- let response: Response;
90
- let responseStatus = 0;
91
- let responseHeaders: Record<string, string> = {};
92
- try {
93
- response = await fetch(url, {
94
- method: HTTP_REQUEST_TYPE.POST,
95
- headers: reqHeaders,
96
- body: reqBody,
97
- });
98
- } catch (e) {
94
+ let response: Response | undefined;
95
+ let lastError: Error | undefined;
96
+ for (
97
+ let attempt = 1;
98
+ attempt <= MAX_FETCH_POST_RETRIES + 1;
99
+ attempt++
100
+ ) {
101
+ try {
102
+ response = await fetch(url, {
103
+ method: HTTP_REQUEST_TYPE.POST,
104
+ headers: reqHeaders,
105
+ body: reqBody,
106
+ });
107
+ break;
108
+ } catch (e) {
109
+ lastError = e as Error;
110
+ if (!shouldRetryPostFetchError(lastError, attempt)) {
111
+ throw createNetworkError(
112
+ createBrowserAuthError(
113
+ window.navigator.onLine !== false
114
+ ? BrowserAuthErrorCodes.postRequestFailed
115
+ : BrowserAuthErrorCodes.noNetworkConnectivity,
116
+ correlationId || ""
117
+ ),
118
+ undefined,
119
+ undefined,
120
+ lastError
121
+ );
122
+ }
123
+ // Brief backoff before retry
124
+ await new Promise((resolve) =>
125
+ setTimeout(resolve, RETRY_DELAY_MS)
126
+ );
127
+ if (correlationId) {
128
+ performanceClient?.incrementFields(
129
+ { fetchRetryCount: 1 },
130
+ correlationId
131
+ );
132
+ }
133
+ }
134
+ }
135
+
136
+ if (!response) {
99
137
  throw createNetworkError(
100
138
  createBrowserAuthError(
101
- window.navigator.onLine
139
+ window.navigator.onLine !== false
102
140
  ? BrowserAuthErrorCodes.postRequestFailed
103
141
  : BrowserAuthErrorCodes.noNetworkConnectivity,
104
- ""
142
+ correlationId || ""
105
143
  ),
106
144
  undefined,
107
145
  undefined,
108
- e as Error
146
+ lastError
109
147
  );
110
148
  }
111
149
 
150
+ let responseStatus = 0;
151
+ let responseHeaders: Record<string, string> = {};
112
152
  responseHeaders = getHeaderDict(response.headers);
113
153
  try {
114
154
  responseStatus = response.status;
@@ -121,7 +161,7 @@ export class FetchClient implements INetworkModule {
121
161
  throw createNetworkError(
122
162
  createBrowserAuthError(
123
163
  BrowserAuthErrorCodes.failedToParseResponse,
124
- ""
164
+ correlationId || ""
125
165
  ),
126
166
  responseStatus,
127
167
  responseHeaders,
@@ -131,6 +171,14 @@ export class FetchClient implements INetworkModule {
131
171
  }
132
172
  }
133
173
 
174
+ function shouldRetryPostFetchError(error: Error, attempt: number): boolean {
175
+ return (
176
+ attempt <= MAX_FETCH_POST_RETRIES &&
177
+ window.navigator.onLine !== false &&
178
+ error.name !== "AbortError"
179
+ );
180
+ }
181
+
134
182
  /**
135
183
  * Get Fetch API Headers object from string map
136
184
  * @param inputHeaders
@@ -1,3 +1,3 @@
1
1
  /* eslint-disable header/header */
2
2
  export const name = "@azure/msal-browser";
3
- export const version = "5.17.1";
3
+ export const version = "5.18.0";
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { WebBrokerBridgeError } from "./WebBrokerBridgeError.js";
7
+
8
+ /**
9
+ * Structural interface shared by NAA and PWB bridge request messages.
10
+ *
11
+ * Both `BridgeRequestEnvelope` (NAA) and `BrokerAuthRequest` (PWB) satisfy
12
+ * this shape without any wire-format changes; concrete implementations
13
+ * derive `requestId` from whatever correlation identifiers they already
14
+ * carry.
15
+ */
16
+ export interface IWebBrokerBridgeMessage {
17
+ /**
18
+ * Unique identifier used to correlate this request with its response.
19
+ * Format is bridge-specific (NAA uses a GUID; PWB composes
20
+ * `${channelId}:${messageId}`).
21
+ */
22
+ readonly requestId: string;
23
+
24
+ /**
25
+ * Discriminator identifying what this message represents
26
+ * (e.g. `"GetToken"`, `"AuthRequest"`, `"Handshake"`).
27
+ */
28
+ readonly type: string;
29
+ }
30
+
31
+ /**
32
+ * Structural interface shared by NAA and PWB bridge response messages.
33
+ *
34
+ * Responses are matched against pending requests by `requestId`.
35
+ */
36
+ export interface IWebBrokerBridgeResponse extends IWebBrokerBridgeMessage {
37
+ /**
38
+ * When present, indicates the request failed and provides the
39
+ * unified error taxonomy code + optional context. Absent on success.
40
+ */
41
+ error?: WebBrokerBridgeError;
42
+ }