@azure/msal-browser 4.12.0 → 4.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/app/PublicClientNext.mjs +1 -1
  4. package/dist/broker/nativeBroker/IPlatformAuthHandler.d.ts +12 -0
  5. package/dist/broker/nativeBroker/IPlatformAuthHandler.d.ts.map +1 -0
  6. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  7. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +30 -0
  8. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -0
  9. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs +143 -0
  10. package/dist/broker/nativeBroker/PlatformAuthDOMHandler.mjs.map +1 -0
  11. package/dist/broker/nativeBroker/{NativeMessageHandler.d.ts → PlatformAuthExtensionHandler.d.ts} +16 -16
  12. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -0
  13. package/dist/broker/nativeBroker/{NativeMessageHandler.mjs → PlatformAuthExtensionHandler.mjs} +66 -58
  14. package/dist/broker/nativeBroker/PlatformAuthExtensionHandler.mjs.map +1 -0
  15. package/dist/broker/nativeBroker/PlatformAuthProvider.d.ts +26 -0
  16. package/dist/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -0
  17. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs +108 -0
  18. package/dist/broker/nativeBroker/PlatformAuthProvider.mjs.map +1 -0
  19. package/dist/broker/nativeBroker/{NativeRequest.d.ts → PlatformAuthRequest.d.ts} +34 -3
  20. package/dist/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -0
  21. package/dist/broker/nativeBroker/{NativeResponse.d.ts → PlatformAuthResponse.d.ts} +24 -2
  22. package/dist/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -0
  23. package/dist/cache/AccountManager.mjs +1 -1
  24. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  25. package/dist/cache/BrowserCacheManager.d.ts +6 -2
  26. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  27. package/dist/cache/BrowserCacheManager.mjs +17 -2
  28. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  29. package/dist/cache/CacheHelpers.mjs +1 -1
  30. package/dist/cache/CookieStorage.mjs +1 -1
  31. package/dist/cache/DatabaseStorage.mjs +1 -1
  32. package/dist/cache/LocalStorage.mjs +1 -1
  33. package/dist/cache/MemoryStorage.mjs +1 -1
  34. package/dist/cache/SessionStorage.mjs +1 -1
  35. package/dist/cache/TokenCache.mjs +1 -1
  36. package/dist/config/Configuration.mjs +1 -1
  37. package/dist/controllers/ControllerFactory.mjs +1 -1
  38. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  39. package/dist/controllers/StandardController.d.ts +2 -2
  40. package/dist/controllers/StandardController.d.ts.map +1 -1
  41. package/dist/controllers/StandardController.mjs +30 -29
  42. package/dist/controllers/StandardController.mjs.map +1 -1
  43. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  44. package/dist/crypto/BrowserCrypto.mjs +1 -1
  45. package/dist/crypto/CryptoOps.mjs +1 -1
  46. package/dist/crypto/PkceGenerator.mjs +1 -1
  47. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  48. package/dist/encode/Base64Decode.mjs +1 -1
  49. package/dist/encode/Base64Encode.mjs +1 -1
  50. package/dist/error/BrowserAuthError.mjs +1 -1
  51. package/dist/error/BrowserAuthErrorCodes.mjs +1 -1
  52. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  53. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  54. package/dist/error/NativeAuthError.mjs +1 -1
  55. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  56. package/dist/error/NestedAppAuthError.mjs +1 -1
  57. package/dist/event/EventHandler.mjs +1 -1
  58. package/dist/event/EventMessage.d.ts +10 -1
  59. package/dist/event/EventMessage.d.ts.map +1 -1
  60. package/dist/event/EventMessage.mjs +1 -1
  61. package/dist/event/EventMessage.mjs.map +1 -1
  62. package/dist/event/EventType.d.ts +1 -0
  63. package/dist/event/EventType.d.ts.map +1 -1
  64. package/dist/event/EventType.mjs +2 -1
  65. package/dist/event/EventType.mjs.map +1 -1
  66. package/dist/index.d.ts +2 -1
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.mjs +2 -1
  69. package/dist/index.mjs.map +1 -1
  70. package/dist/interaction_client/BaseInteractionClient.d.ts +3 -3
  71. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  72. package/dist/interaction_client/BaseInteractionClient.mjs +3 -3
  73. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  74. package/dist/interaction_client/{NativeInteractionClient.d.ts → PlatformAuthInteractionClient.d.ts} +21 -23
  75. package/dist/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -0
  76. package/dist/interaction_client/{NativeInteractionClient.mjs → PlatformAuthInteractionClient.mjs} +80 -111
  77. package/dist/interaction_client/PlatformAuthInteractionClient.mjs.map +1 -0
  78. package/dist/interaction_client/PopupClient.d.ts +2 -2
  79. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  80. package/dist/interaction_client/PopupClient.mjs +7 -7
  81. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  82. package/dist/interaction_client/RedirectClient.d.ts +2 -2
  83. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  84. package/dist/interaction_client/RedirectClient.mjs +7 -8
  85. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  86. package/dist/interaction_client/SilentAuthCodeClient.d.ts +2 -2
  87. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  88. package/dist/interaction_client/SilentAuthCodeClient.mjs +3 -3
  89. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  90. package/dist/interaction_client/SilentIframeClient.d.ts +2 -2
  91. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  92. package/dist/interaction_client/SilentIframeClient.mjs +7 -8
  93. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  94. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  95. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  96. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  97. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  98. package/dist/naa/BridgeError.mjs +1 -1
  99. package/dist/naa/BridgeProxy.mjs +1 -1
  100. package/dist/naa/BridgeStatusCode.mjs +1 -1
  101. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  102. package/dist/navigation/NavigationClient.mjs +3 -3
  103. package/dist/navigation/NavigationClient.mjs.map +1 -1
  104. package/dist/network/FetchClient.mjs +1 -1
  105. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  106. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  107. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  108. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  109. package/dist/packageMetadata.d.ts +1 -1
  110. package/dist/packageMetadata.mjs +2 -2
  111. package/dist/protocol/Authorize.d.ts +4 -4
  112. package/dist/protocol/Authorize.d.ts.map +1 -1
  113. package/dist/protocol/Authorize.mjs +10 -9
  114. package/dist/protocol/Authorize.mjs.map +1 -1
  115. package/dist/request/RequestHelpers.mjs +1 -1
  116. package/dist/response/ResponseHandler.mjs +1 -1
  117. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  118. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  119. package/dist/utils/BrowserConstants.d.ts +8 -1
  120. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  121. package/dist/utils/BrowserConstants.mjs +11 -4
  122. package/dist/utils/BrowserConstants.mjs.map +1 -1
  123. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  124. package/dist/utils/BrowserUtils.mjs +1 -1
  125. package/dist/utils/MsalFrameStatsUtils.mjs +1 -1
  126. package/lib/msal-browser.cjs +1541 -1320
  127. package/lib/msal-browser.cjs.map +1 -1
  128. package/lib/msal-browser.js +1541 -1320
  129. package/lib/msal-browser.js.map +1 -1
  130. package/lib/msal-browser.min.js +66 -66
  131. package/lib/types/broker/nativeBroker/IPlatformAuthHandler.d.ts +12 -0
  132. package/lib/types/broker/nativeBroker/IPlatformAuthHandler.d.ts.map +1 -0
  133. package/lib/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts +30 -0
  134. package/lib/types/broker/nativeBroker/PlatformAuthDOMHandler.d.ts.map +1 -0
  135. package/lib/types/broker/nativeBroker/{NativeMessageHandler.d.ts → PlatformAuthExtensionHandler.d.ts} +16 -16
  136. package/lib/types/broker/nativeBroker/PlatformAuthExtensionHandler.d.ts.map +1 -0
  137. package/lib/types/broker/nativeBroker/PlatformAuthProvider.d.ts +26 -0
  138. package/lib/types/broker/nativeBroker/PlatformAuthProvider.d.ts.map +1 -0
  139. package/lib/types/broker/nativeBroker/{NativeRequest.d.ts → PlatformAuthRequest.d.ts} +34 -3
  140. package/lib/types/broker/nativeBroker/PlatformAuthRequest.d.ts.map +1 -0
  141. package/lib/types/broker/nativeBroker/{NativeResponse.d.ts → PlatformAuthResponse.d.ts} +24 -2
  142. package/lib/types/broker/nativeBroker/PlatformAuthResponse.d.ts.map +1 -0
  143. package/lib/types/cache/BrowserCacheManager.d.ts +6 -2
  144. package/lib/types/cache/BrowserCacheManager.d.ts.map +1 -1
  145. package/lib/types/controllers/StandardController.d.ts +2 -2
  146. package/lib/types/controllers/StandardController.d.ts.map +1 -1
  147. package/lib/types/event/EventMessage.d.ts +10 -1
  148. package/lib/types/event/EventMessage.d.ts.map +1 -1
  149. package/lib/types/event/EventType.d.ts +1 -0
  150. package/lib/types/event/EventType.d.ts.map +1 -1
  151. package/lib/types/index.d.ts +2 -1
  152. package/lib/types/index.d.ts.map +1 -1
  153. package/lib/types/interaction_client/BaseInteractionClient.d.ts +3 -3
  154. package/lib/types/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  155. package/lib/types/interaction_client/{NativeInteractionClient.d.ts → PlatformAuthInteractionClient.d.ts} +21 -23
  156. package/lib/types/interaction_client/PlatformAuthInteractionClient.d.ts.map +1 -0
  157. package/lib/types/interaction_client/PopupClient.d.ts +2 -2
  158. package/lib/types/interaction_client/PopupClient.d.ts.map +1 -1
  159. package/lib/types/interaction_client/RedirectClient.d.ts +2 -2
  160. package/lib/types/interaction_client/RedirectClient.d.ts.map +1 -1
  161. package/lib/types/interaction_client/SilentAuthCodeClient.d.ts +2 -2
  162. package/lib/types/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  163. package/lib/types/interaction_client/SilentIframeClient.d.ts +2 -2
  164. package/lib/types/interaction_client/SilentIframeClient.d.ts.map +1 -1
  165. package/lib/types/packageMetadata.d.ts +1 -1
  166. package/lib/types/protocol/Authorize.d.ts +4 -4
  167. package/lib/types/protocol/Authorize.d.ts.map +1 -1
  168. package/lib/types/utils/BrowserConstants.d.ts +8 -1
  169. package/lib/types/utils/BrowserConstants.d.ts.map +1 -1
  170. package/package.json +2 -2
  171. package/src/broker/nativeBroker/IPlatformAuthHandler.ts +17 -0
  172. package/src/broker/nativeBroker/PlatformAuthDOMHandler.ts +248 -0
  173. package/src/broker/nativeBroker/{NativeMessageHandler.ts → PlatformAuthExtensionHandler.ts} +90 -79
  174. package/src/broker/nativeBroker/PlatformAuthProvider.ts +164 -0
  175. package/src/broker/nativeBroker/{NativeRequest.ts → PlatformAuthRequest.ts} +41 -2
  176. package/src/broker/nativeBroker/{NativeResponse.ts → PlatformAuthResponse.ts} +25 -1
  177. package/src/cache/BrowserCacheManager.ts +27 -3
  178. package/src/controllers/StandardController.ts +51 -45
  179. package/src/event/EventMessage.ts +11 -0
  180. package/src/event/EventType.ts +1 -0
  181. package/src/index.ts +3 -0
  182. package/src/interaction_client/BaseInteractionClient.ts +4 -4
  183. package/src/interaction_client/{NativeInteractionClient.ts → PlatformAuthInteractionClient.ts} +136 -167
  184. package/src/interaction_client/PopupClient.ts +8 -7
  185. package/src/interaction_client/RedirectClient.ts +12 -12
  186. package/src/interaction_client/SilentAuthCodeClient.ts +3 -3
  187. package/src/interaction_client/SilentIframeClient.ts +12 -12
  188. package/src/navigation/NavigationClient.ts +2 -2
  189. package/src/packageMetadata.ts +1 -1
  190. package/src/protocol/Authorize.ts +12 -10
  191. package/src/utils/BrowserConstants.ts +9 -1
  192. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +0 -1
  193. package/dist/broker/nativeBroker/NativeMessageHandler.mjs.map +0 -1
  194. package/dist/broker/nativeBroker/NativeRequest.d.ts.map +0 -1
  195. package/dist/broker/nativeBroker/NativeResponse.d.ts.map +0 -1
  196. package/dist/interaction_client/NativeInteractionClient.d.ts.map +0 -1
  197. package/dist/interaction_client/NativeInteractionClient.mjs.map +0 -1
  198. package/lib/types/broker/nativeBroker/NativeMessageHandler.d.ts.map +0 -1
  199. package/lib/types/broker/nativeBroker/NativeRequest.d.ts.map +0 -1
  200. package/lib/types/broker/nativeBroker/NativeResponse.d.ts.map +0 -1
  201. package/lib/types/interaction_client/NativeInteractionClient.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EventType.mjs","sources":["../../src/event/EventType.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;AAGG;AAEU,MAAA,SAAS,GAAG;AACrB,IAAA,gBAAgB,EAAE,sBAAsB;AACxC,IAAA,cAAc,EAAE,oBAAoB;AACpC,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,eAAe,EAAE,qBAAqB;AACtC,IAAA,sBAAsB,EAAE,2BAA2B;AACnD,IAAA,WAAW,EAAE,iBAAiB;AAC9B,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IA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AA2B,EAAE,8BAA8B;AAC3D,IAAA,6BAA6B,EAAE,gCAAgC;AAC/D,IAAA,6BAA6B,EAAE,gCAAgC;AAC/D,IAAA,qBAAqB,EAAE,0BAA0B;AACjD,IAAA,mBAAmB,EAAE,wBAAwB;AAC7C,IAAA,YAAY,EAAE,kBAAkB;AAChC,IAAA,YAAY,EAAE,kBAAkB;AAChC,IAAA,cAAc,EAAE,oBAAoB;AACpC,IAAA,cAAc,EAAE,oBAAoB;AACpC,IAAA,UAAU,EAAE,gBAAgB;AAC5B,IAAA,oBAAoB,EAAE,yBAAyB;AAC/C,IAAA,6BAA6B,EAAE,kCAAkC;;;;;"}
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export { MemoryStorage } from "./cache/MemoryStorage.js";
32
32
  export { LocalStorage } from "./cache/LocalStorage.js";
33
33
  export { SessionStorage } from "./cache/SessionStorage.js";
34
34
  export { IWindowStorage } from "./cache/IWindowStorage.js";
35
- export { EventMessage, EventPayload, EventError, EventCallbackFunction, EventMessageUtils, PopupEvent, } from "./event/EventMessage.js";
35
+ export { EventMessage, EventPayload, EventError, EventCallbackFunction, EventMessageUtils, PopupEvent, BrokerConnectionEvent, } from "./event/EventMessage.js";
36
36
  export { EventType } from "./event/EventType.js";
37
37
  export { EventHandler } from "./event/EventHandler.js";
38
38
  export { SignedHttpRequest, SignedHttpRequestOptions, } from "./crypto/SignedHttpRequest.js";
@@ -41,4 +41,5 @@ export { BrowserPerformanceClient } from "./telemetry/BrowserPerformanceClient.j
41
41
  export { BrowserPerformanceMeasurement } from "./telemetry/BrowserPerformanceMeasurement.js";
42
42
  export { AuthenticationScheme, AccountInfo, AccountEntity, IdTokenClaims, AuthError, AuthErrorCodes, AuthErrorMessage, ClientAuthError, ClientAuthErrorCodes, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorCodes, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorCodes, InteractionRequiredAuthErrorMessage, ServerError, INetworkModule, NetworkResponse, NetworkRequestOptions, ILoggerCallback, Logger, LogLevel, ProtocolMode, ServerResponseType, PromptValue, ExternalTokenResponse, StringUtils, UrlString, JsonWebTokenTypes, AzureCloudInstance, AzureCloudOptions, AuthenticationHeaderParser, OIDC_DEFAULT_SCOPES, PerformanceCallbackFunction, PerformanceEvent, PerformanceEvents, InProgressPerformanceEvent, TenantProfile, IPerformanceClient, StubPerformanceClient, } from "@azure/msal-common/browser";
43
43
  export { version } from "./packageMetadata.js";
44
+ export { isPlatformBrokerAvailable } from "./broker/nativeBroker/PlatformAuthProvider.js";
44
45
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAEH,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB,OAAO,EACH,uBAAuB,EACvB,qCAAqC,EACrC,qCAAqC,GACxC,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EACH,aAAa,EACb,kBAAkB,EAClB,YAAY,EACZ,oBAAoB,EACpB,uBAAuB,EACvB,oBAAoB,EACpB,yBAAyB,GAC5B,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,eAAe,EACf,iBAAiB,EACjB,oBAAoB,EACpB,UAAU,EACV,KAAK,EACL,iBAAiB,GACpB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EACH,gBAAgB,EAChB,uBAAuB,EACvB,qBAAqB,GACxB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACH,6BAA6B,EAC7B,kCAAkC,EAClC,oCAAoC,GACvC,MAAM,0CAA0C,CAAC;AAGlD,OAAO,EACH,wBAAwB,EACxB,8BAA8B,GACjC,MAAM,mCAAmC,CA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,EAClB,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,2BAA2B,EAC3B,gBAAgB,EAChB,iBAAiB,EAEjB,0BAA0B,EAC1B,aAAa,EACb,kBAAkB,EAClB,qBAAqB,GACxB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v4.12.0 2025-05-06 */
1
+ /*! @azure/msal-browser v4.13.1 2025-06-10 */
2
2
  'use strict';
3
3
  import * as BrowserUtils from './utils/BrowserUtils.mjs';
4
4
  export { BrowserUtils };
@@ -21,6 +21,7 @@ export { BrowserPerformanceClient } from './telemetry/BrowserPerformanceClient.m
21
21
  export { BrowserPerformanceMeasurement } from './telemetry/BrowserPerformanceMeasurement.mjs';
22
22
  export { AccountEntity, AuthError, AuthErrorCodes, AuthErrorMessage, AuthenticationHeaderParser, AuthenticationScheme, AzureCloudInstance, ClientAuthError, ClientAuthErrorCodes, ClientAuthErrorMessage, ClientConfigurationError, ClientConfigurationErrorCodes, ClientConfigurationErrorMessage, InteractionRequiredAuthError, InteractionRequiredAuthErrorCodes, InteractionRequiredAuthErrorMessage, JsonWebTokenTypes, LogLevel, Logger, OIDC_DEFAULT_SCOPES, PerformanceEvents, PromptValue, ProtocolMode, ServerError, ServerResponseType, StringUtils, StubPerformanceClient, UrlString } from '@azure/msal-common/browser';
23
23
  export { version } from './packageMetadata.mjs';
24
+ export { isPlatformBrokerAvailable } from './broker/nativeBroker/PlatformAuthProvider.mjs';
24
25
  import * as BrowserAuthErrorCodes from './error/BrowserAuthErrorCodes.mjs';
25
26
  export { BrowserAuthErrorCodes };
26
27
  import * as BrowserConfigurationAuthErrorCodes from './error/BrowserConfigurationAuthErrorCodes.mjs';
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -7,9 +7,9 @@ import { RedirectRequest } from "../request/RedirectRequest.js";
7
7
  import { PopupRequest } from "../request/PopupRequest.js";
8
8
  import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
9
9
  import { INavigationClient } from "../navigation/INavigationClient.js";
10
- import { NativeMessageHandler } from "../broker/nativeBroker/NativeMessageHandler.js";
11
10
  import { AuthenticationResult } from "../response/AuthenticationResult.js";
12
11
  import { ClearCacheRequest } from "../request/ClearCacheRequest.js";
12
+ import { IPlatformAuthHandler } from "../broker/nativeBroker/IPlatformAuthHandler.js";
13
13
  export declare abstract class BaseInteractionClient {
14
14
  protected config: BrowserConfiguration;
15
15
  protected browserStorage: BrowserCacheManager;
@@ -18,10 +18,10 @@ export declare abstract class BaseInteractionClient {
18
18
  protected logger: Logger;
19
19
  protected eventHandler: EventHandler;
20
20
  protected navigationClient: INavigationClient;
21
- protected nativeMessageHandler: NativeMessageHandler | undefined;
21
+ protected platformAuthProvider: IPlatformAuthHandler | undefined;
22
22
  protected correlationId: string;
23
23
  protected performanceClient: IPerformanceClient;
24
- constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, nativeMessageHandler?: NativeMessageHandler, correlationId?: string);
24
+ constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, performanceClient: IPerformanceClient, platformAuthProvider?: IPlatformAuthHandler, correlationId?: string);
25
25
  abstract acquireToken(request: RedirectRequest | PopupRequest | SsoSilentRequest): Promise<AuthenticationResult | void>;
26
26
  abstract logout(request: EndSessionRequest | ClearCacheRequest | undefined): Promise<void>;
27
27
  protected clearCacheOnLogout(account?: AccountInfo | null): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"BaseInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/BaseInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,OAAO,EACP,cAAc,EACd,MAAM,EACN,WAAW,EAGX,sBAAsB,EAItB,SAAS,EAGT,kBAAkB,EAElB,iBAAiB,EAEjB,UAAU,EACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAIlE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,8BAAsB,qBAAqB;IACvC,SAAS,CAAC,MAAM,EAAE,oBAAoB,CAAC;IACvC,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;IAC9C,SAAS,CAAC,aAAa,EAAE,OAAO,CAAC;IACjC,SAAS,CAAC,aAAa,EAAE,cAAc,CAAC;IACxC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,YAAY,EAAE,YAAY,CAAC;IACrC,SAAS,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;IAC9C,SAAS,CAAC,o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AAE,oBAAoB,EAC5B,WAAW,EAAE,mBAAmB,EAChC,aAAa,EAAE,OAAO,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,iBAAiB,EACnC,iBAAiB,EAAE,kBAAkB,EACrC,oBAAoB,CAAC,EAAE,oBAAoB,EAC3C,aAAa,CAAC,EAAE,MAAM;IAkB1B,QAAQ,CAAC,YAAY,CACjB,OAAO,EAAE,eAAe,GAAG,YAAY,GAAG,gBAAgB,GAC3D,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;IAEvC,QAAQ,CAAC,MAAM,CACX,OAAO,EAAE,iBAAiB,GAAG,iBAAiB,GAAG,SAAS,GAC3D,OAAO,CAAC,IAAI,CAAC;cAEA,kBAAkB,CAC9B,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,GAC7B,OAAO,CAAC,IAAI,CAAC;IA2ChB;;;;;;OAMG;IACH,cAAc,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM;IASnD;;;;;OAKG;IACH,SAAS,CAAC,gCAAgC,CACtC,KAAK,EAAE,MAAM,EACb,YAAY,CAAC,EAAE,OAAO,GACvB,sBAAsB;IAiBzB;;;;;;;;OAQG;cACa,sBAAsB,CAAC,MAAM,EAAE;QAC3C,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,wBAAwB,CAAC,EAAE,iBAAiB,CAAC;QAC7C,2BAA2B,CAAC,EAAE,UAAU,CAAC;QACzC,OAAO,CAAC,EAAE,WAAW,CAAC;KACzB,GAAG,OAAO,CAAC,SAAS,CAAC;CAmEzB"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v4.12.0 2025-05-06 */
1
+ /*! @azure/msal-browser v4.13.1 2025-06-10 */
2
2
  'use strict';
3
3
  import { AccountEntity, UrlString, ServerTelemetryManager, PerformanceEvents, Authority, invokeAsync, AuthorityFactory, createClientConfigurationError, ClientConfigurationErrorCodes } from '@azure/msal-common/browser';
4
4
  import { version } from '../packageMetadata.mjs';
@@ -11,14 +11,14 @@ import { createNewGuid } from '../crypto/BrowserCrypto.mjs';
11
11
  * Licensed under the MIT License.
12
12
  */
13
13
  class BaseInteractionClient {
14
- constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, nativeMessageHandler, correlationId) {
14
+ constructor(config, storageImpl, browserCrypto, logger, eventHandler, navigationClient, performanceClient, platformAuthProvider, correlationId) {
15
15
  this.config = config;
16
16
  this.browserStorage = storageImpl;
17
17
  this.browserCrypto = browserCrypto;
18
18
  this.networkClient = this.config.system.networkClient;
19
19
  this.eventHandler = eventHandler;
20
20
  this.navigationClient = navigationClient;
21
- this.nativeMessageHandler = nativeMessageHandler;
21
+ this.platformAuthProvider = platformAuthProvider;
22
22
  this.correlationId = correlationId || createNewGuid();
23
23
  this.logger = logger.clone(BrowserConstants.MSAL_SKU, version, this.correlationId);
24
24
  this.performanceClient = performanceClient;
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v4.12.0 2025-05-06 */
1
+ /*! @azure/msal-browser v4.13.1 2025-06-10 */
2
2
  'use strict';
3
3
  import { AuthorizationCodeClient } from '@azure/msal-common/browser';
4
4
 
@@ -6,25 +6,25 @@ import { EventHandler } from "../event/EventHandler.js";
6
6
  import { PopupRequest } from "../request/PopupRequest.js";
7
7
  import { SilentRequest } from "../request/SilentRequest.js";
8
8
  import { SsoSilentRequest } from "../request/SsoSilentRequest.js";
9
- import { NativeMessageHandler } from "../broker/nativeBroker/NativeMessageHandler.js";
10
9
  import { ApiId, CacheLookupPolicy } from "../utils/BrowserConstants.js";
11
- import { NativeTokenRequest } from "../broker/nativeBroker/NativeRequest.js";
12
- import { MATS, NativeResponse } from "../broker/nativeBroker/NativeResponse.js";
10
+ import { PlatformAuthRequest } from "../broker/nativeBroker/PlatformAuthRequest.js";
11
+ import { MATS, PlatformAuthResponse } from "../broker/nativeBroker/PlatformAuthResponse.js";
13
12
  import { RedirectRequest } from "../request/RedirectRequest.js";
14
13
  import { INavigationClient } from "../navigation/INavigationClient.js";
15
14
  import { SilentCacheClient } from "./SilentCacheClient.js";
16
15
  import { AuthenticationResult } from "../response/AuthenticationResult.js";
17
- export declare class NativeInteractionClient extends BaseInteractionClient {
16
+ import { IPlatformAuthHandler } from "../broker/nativeBroker/IPlatformAuthHandler.js";
17
+ export declare class PlatformAuthInteractionClient extends BaseInteractionClient {
18
18
  protected apiId: ApiId;
19
19
  protected accountId: string;
20
- protected nativeMessageHandler: NativeMessageHandler;
20
+ protected platformAuthProvider: IPlatformAuthHandler;
21
21
  protected silentCacheClient: SilentCacheClient;
22
22
  protected nativeStorageManager: BrowserCacheManager;
23
23
  protected skus: string;
24
- constructor(config: BrowserConfiguration, browserStorage: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, provider: NativeMessageHandler, accountId: string, nativeStorageImpl: BrowserCacheManager, correlationId?: string);
24
+ constructor(config: BrowserConfiguration, browserStorage: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, apiId: ApiId, performanceClient: IPerformanceClient, provider: IPlatformAuthHandler, accountId: string, nativeStorageImpl: BrowserCacheManager, correlationId?: string);
25
25
  /**
26
26
  * Adds SKUs to request extra query parameters
27
- * @param request {NativeTokenRequest}
27
+ * @param request {PlatformAuthRequest}
28
28
  * @private
29
29
  */
30
30
  private addRequestSKUs;
@@ -46,7 +46,7 @@ export declare class NativeInteractionClient extends BaseInteractionClient {
46
46
  * @param request
47
47
  * @returns authenticationResult
48
48
  */
49
- protected acquireTokensFromCache(nativeAccountId: string, request: NativeTokenRequest): Promise<AuthenticationResult>;
49
+ protected acquireTokensFromCache(nativeAccountId: string, request: PlatformAuthRequest): Promise<AuthenticationResult>;
50
50
  /**
51
51
  * Acquires a token from native platform then redirects to the redirectUri instead of returning the response
52
52
  * @param {RedirectRequest} request
@@ -70,27 +70,27 @@ export declare class NativeInteractionClient extends BaseInteractionClient {
70
70
  * @param request
71
71
  * @param reqTimestamp
72
72
  */
73
- protected handleNativeResponse(response: NativeResponse, request: NativeTokenRequest, reqTimestamp: number): Promise<AuthenticationResult>;
73
+ protected handleNativeResponse(response: PlatformAuthResponse, request: PlatformAuthRequest, reqTimestamp: number): Promise<AuthenticationResult>;
74
74
  /**
75
75
  * creates an homeAccountIdentifier for the account
76
76
  * @param response
77
77
  * @param idTokenObj
78
78
  * @returns
79
79
  */
80
- protected createHomeAccountIdentifier(response: NativeResponse, idTokenClaims: TokenClaims): string;
80
+ protected createHomeAccountIdentifier(response: PlatformAuthResponse, idTokenClaims: TokenClaims): string;
81
81
  /**
82
82
  * Helper to generate scopes
83
83
  * @param response
84
84
  * @param request
85
85
  * @returns
86
86
  */
87
- generateScopes(response: NativeResponse, request: NativeTokenRequest): ScopeSet;
87
+ generateScopes(requestScopes: string, responseScopes?: string): ScopeSet;
88
88
  /**
89
89
  * If PoP token is requesred, records the PoP token if returned from the WAM, else generates one in the browser
90
90
  * @param request
91
91
  * @param response
92
92
  */
93
- generatePopAccessToken(response: NativeResponse, request: NativeTokenRequest): Promise<string>;
93
+ generatePopAccessToken(response: PlatformAuthResponse, request: PlatformAuthRequest): Promise<string>;
94
94
  /**
95
95
  * Generates authentication result
96
96
  * @param response
@@ -101,7 +101,7 @@ export declare class NativeInteractionClient extends BaseInteractionClient {
101
101
  * @param reqTimestamp
102
102
  * @returns
103
103
  */
104
- protected generateAuthenticationResult(response: NativeResponse, request: NativeTokenRequest, idTokenClaims: TokenClaims, accountEntity: AccountEntity, authority: string, reqTimestamp: number): Promise<AuthenticationResult>;
104
+ protected generateAuthenticationResult(response: PlatformAuthResponse, request: PlatformAuthRequest, idTokenClaims: TokenClaims, accountEntity: AccountEntity, authority: string, reqTimestamp: number): Promise<AuthenticationResult>;
105
105
  /**
106
106
  * cache the account entity in browser storage
107
107
  * @param accountEntity
@@ -117,13 +117,9 @@ export declare class NativeInteractionClient extends BaseInteractionClient {
117
117
  * @param tenantId
118
118
  * @param reqTimestamp
119
119
  */
120
- cacheNativeTokens(response: NativeResponse, request: NativeTokenRequest, homeAccountIdentifier: string, idTokenClaims: TokenClaims, responseAccessToken: string, tenantId: string, reqTimestamp: number): Promise<void>;
121
- protected addTelemetryFromNativeResponse(response: NativeResponse): MATS | null;
122
- /**
123
- * Validates native platform response before processing
124
- * @param response
125
- */
126
- private validateNativeResponse;
120
+ cacheNativeTokens(response: PlatformAuthResponse, request: PlatformAuthRequest, homeAccountIdentifier: string, idTokenClaims: TokenClaims, responseAccessToken: string, tenantId: string, reqTimestamp: number): Promise<void>;
121
+ getExpiresInValue(tokenType: string, expiresIn: string | number | undefined): number;
122
+ protected addTelemetryFromNativeResponse(matsResponse?: string): MATS | null;
127
123
  /**
128
124
  * Gets MATS telemetry from native response
129
125
  * @param response
@@ -140,12 +136,14 @@ export declare class NativeInteractionClient extends BaseInteractionClient {
140
136
  * Translates developer provided request object into NativeRequest object
141
137
  * @param request
142
138
  */
143
- protected initializeNativeRequest(request: PopupRequest | SsoSilentRequest): Promise<NativeTokenRequest>;
139
+ protected initializeNativeRequest(request: PopupRequest | SsoSilentRequest): Promise<PlatformAuthRequest>;
140
+ private getCanonicalAuthority;
141
+ private getPrompt;
144
142
  /**
145
143
  * Handles extra broker request parameters
146
- * @param request {NativeTokenRequest}
144
+ * @param request {PlatformAuthRequest}
147
145
  * @private
148
146
  */
149
147
  private handleExtraBrokerParams;
150
148
  }
151
- //# sourceMappingURL=NativeInteractionClient.d.ts.map
149
+ //# sourceMappingURL=PlatformAuthInteractionClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlatformAuthInteractionClient.d.ts","sourceRoot":"","sources":["../../src/interaction_client/PlatformAuthInteractionClient.ts"],"names":[],"mappings":"AAKA,OAAO,EACH,MAAM,EACN,OAAO,EAIP,aAAa,EAEb,QAAQ,EAOR,kBAAkB,EAQlB,WAAW,EAOX,0BAA0B,E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-06 */
1
+ /*! @azure/msal-browser v4.13.1 2025-06-10 */
2
2
  'use strict';
3
- import { ServerTelemetryManager, AADServerParamKeys, PerformanceEvents, TimeUtils, ScopeSet, createClientAuthError, ClientAuthErrorCodes, AuthToken, buildAccountToCache, AccountEntity, Constants, AuthorityType, AuthenticationScheme, PopTokenGenerator, updateAccountTenantProfileData, CacheHelpers, createAuthError, AuthErrorCodes, UrlString, OIDC_DEFAULT_SCOPES, invokeAsync, PromptValue } from '@azure/msal-common/browser';
3
+ import { ServerTelemetryManager, AADServerParamKeys, PerformanceEvents, TimeUtils, ScopeSet, createClientAuthError, ClientAuthErrorCodes, AuthToken, buildAccountToCache, AccountEntity, Constants, AuthorityType, AuthenticationScheme, PopTokenGenerator, updateAccountTenantProfileData, CacheHelpers, OIDC_DEFAULT_SCOPES, invokeAsync, UrlString, PromptValue } from '@azure/msal-common/browser';
4
4
  import { BaseInteractionClient } from './BaseInteractionClient.mjs';
5
- import { NativeConstants, BrowserConstants, CacheLookupPolicy, NativeExtensionMethod, TemporaryCacheKeys, ApiId } from '../utils/BrowserConstants.mjs';
5
+ import { BrowserConstants, CacheLookupPolicy, TemporaryCacheKeys, PlatformAuthConstants, ApiId } from '../utils/BrowserConstants.mjs';
6
6
  import { NativeAuthError, isFatalNativeAuthError, createNativeAuthError } from '../error/NativeAuthError.mjs';
7
7
  import { createBrowserAuthError } from '../error/BrowserAuthError.mjs';
8
8
  import { SilentCacheClient } from './SilentCacheClient.mjs';
9
9
  import { base64Decode } from '../encode/Base64Decode.mjs';
10
10
  import { version } from '../packageMetadata.mjs';
11
- import { invalidPopTokenRequest, nativePromptNotSupported } from '../error/BrowserAuthErrorCodes.mjs';
12
11
  import { userSwitch } from '../error/NativeAuthErrorCodes.mjs';
12
+ import { invalidPopTokenRequest, nativePromptNotSupported } from '../error/BrowserAuthErrorCodes.mjs';
13
13
 
14
14
  /*
15
15
  * Copyright (c) Microsoft Corporation. All rights reserved.
16
16
  * Licensed under the MIT License.
17
17
  */
18
- class NativeInteractionClient extends BaseInteractionClient {
18
+ class PlatformAuthInteractionClient extends BaseInteractionClient {
19
19
  constructor(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, apiId, performanceClient, provider, accountId, nativeStorageImpl, correlationId) {
20
20
  super(config, browserStorage, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
21
21
  this.apiId = apiId;
22
22
  this.accountId = accountId;
23
- this.nativeMessageHandler = provider;
23
+ this.platformAuthProvider = provider;
24
24
  this.nativeStorageManager = nativeStorageImpl;
25
25
  this.silentCacheClient = new SilentCacheClient(config, this.nativeStorageManager, browserCrypto, logger, eventHandler, navigationClient, performanceClient, provider, correlationId);
26
- const extensionName = this.nativeMessageHandler.getExtensionId() ===
27
- NativeConstants.PREFERRED_EXTENSION_ID
28
- ? "chrome"
29
- : this.nativeMessageHandler.getExtensionId()?.length
30
- ? "unknown"
31
- : undefined;
26
+ const extensionName = this.platformAuthProvider.getExtensionName();
32
27
  this.skus = ServerTelemetryManager.makeExtraSkuString({
33
28
  libraryName: BrowserConstants.MSAL_SKU,
34
29
  libraryVersion: version,
35
30
  extensionName: extensionName,
36
- extensionVersion: this.nativeMessageHandler.getExtensionVersion(),
31
+ extensionVersion: this.platformAuthProvider.getExtensionVersion(),
37
32
  });
38
33
  }
39
34
  /**
40
35
  * Adds SKUs to request extra query parameters
41
- * @param request {NativeTokenRequest}
36
+ * @param request {PlatformAuthRequest}
42
37
  * @private
43
38
  */
44
39
  addRequestSKUs(request) {
@@ -79,14 +74,7 @@ class NativeInteractionClient extends BaseInteractionClient {
79
74
  // continue with a native call for any and all errors
80
75
  this.logger.info("MSAL internal Cache does not contain tokens, proceed to make a native call");
81
76
  }
82
- const { ...nativeTokenRequest } = nativeRequest;
83
- // fall back to native calls
84
- const messageBody = {
85
- method: NativeExtensionMethod.GetToken,
86
- request: nativeTokenRequest,
87
- };
88
- const response = await this.nativeMessageHandler.sendMessage(messageBody);
89
- const validatedResponse = this.validateNativeResponse(response);
77
+ const validatedResponse = await this.platformAuthProvider.sendMessage(nativeRequest);
90
78
  return await this.handleNativeResponse(validatedResponse, nativeRequest, reqTimestamp)
91
79
  .then((result) => {
92
80
  nativeATMeasurement.end({
@@ -175,13 +163,8 @@ class NativeInteractionClient extends BaseInteractionClient {
175
163
  const { ...remainingParameters } = request;
176
164
  delete remainingParameters.onRedirectNavigate;
177
165
  const nativeRequest = await this.initializeNativeRequest(remainingParameters);
178
- const messageBody = {
179
- method: NativeExtensionMethod.GetToken,
180
- request: nativeRequest,
181
- };
182
166
  try {
183
- const response = await this.nativeMessageHandler.sendMessage(messageBody);
184
- this.validateNativeResponse(response);
167
+ await this.platformAuthProvider.sendMessage(nativeRequest);
185
168
  }
186
169
  catch (e) {
187
170
  // Only throw fatal errors here to allow application to fallback to regular redirect. Otherwise proceed and the error will be thrown in handleRedirectPromise
@@ -230,20 +213,14 @@ class NativeInteractionClient extends BaseInteractionClient {
230
213
  this.logger.verbose("NativeInteractionClient - handleRedirectPromise called and prompt was included in the original request, removing prompt from cached request to prevent second interaction with native broker window.");
231
214
  }
232
215
  this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
233
- const messageBody = {
234
- method: NativeExtensionMethod.GetToken,
235
- request: request,
236
- };
237
216
  const reqTimestamp = TimeUtils.nowSeconds();
238
217
  try {
239
218
  this.logger.verbose("NativeInteractionClient - handleRedirectPromise sending message to native broker.");
240
- const response = await this.nativeMessageHandler.sendMessage(messageBody);
241
- this.validateNativeResponse(response);
242
- const result = this.handleNativeResponse(response, request, reqTimestamp);
243
- const res = await result;
219
+ const response = await this.platformAuthProvider.sendMessage(request);
220
+ const authResult = await this.handleNativeResponse(response, request, reqTimestamp);
244
221
  const serverTelemetryManager = this.initializeServerTelemetryManager(this.apiId);
245
222
  serverTelemetryManager.clearNativeBrokerErrorCode();
246
- return res;
223
+ return authResult;
247
224
  }
248
225
  catch (e) {
249
226
  throw e;
@@ -314,10 +291,10 @@ class NativeInteractionClient extends BaseInteractionClient {
314
291
  * @param request
315
292
  * @returns
316
293
  */
317
- generateScopes(response, request) {
318
- return response.scope
319
- ? ScopeSet.fromString(response.scope)
320
- : ScopeSet.fromString(request.scope);
294
+ generateScopes(requestScopes, responseScopes) {
295
+ return responseScopes
296
+ ? ScopeSet.fromString(responseScopes)
297
+ : ScopeSet.fromString(requestScopes);
321
298
  }
322
299
  /**
323
300
  * If PoP token is requesred, records the PoP token if returned from the WAM, else generates one in the browser
@@ -369,11 +346,9 @@ class NativeInteractionClient extends BaseInteractionClient {
369
346
  */
370
347
  async generateAuthenticationResult(response, request, idTokenClaims, accountEntity, authority, reqTimestamp) {
371
348
  // Add Native Broker fields to Telemetry
372
- const mats = this.addTelemetryFromNativeResponse(response);
349
+ const mats = this.addTelemetryFromNativeResponse(response.properties.MATS);
373
350
  // If scopes not returned in server response, use request scopes
374
- const responseScopes = response.scope
375
- ? ScopeSet.fromString(response.scope)
376
- : ScopeSet.fromString(request.scope);
351
+ const responseScopes = this.generateScopes(request.scope, response.scope);
377
352
  const accountProperties = response.account.properties || {};
378
353
  const uid = accountProperties["UID"] ||
379
354
  idTokenClaims.oid ||
@@ -446,7 +421,7 @@ class NativeInteractionClient extends BaseInteractionClient {
446
421
  ? parseInt(response.expires_in, 10)
447
422
  : response.expires_in) || 0;
448
423
  const tokenExpirationSeconds = reqTimestamp + expiresIn;
449
- const responseScopes = this.generateScopes(response, request);
424
+ const responseScopes = this.generateScopes(response.scope, request.scope);
450
425
  const cachedAccessToken = CacheHelpers.createAccessTokenEntity(homeAccountIdentifier, request.authority, responseAccessToken, request.clientId, idTokenClaims.tid || tenantId, responseScopes.printScopes(), tokenExpirationSeconds, 0, base64Decode, undefined, request.tokenType, undefined, request.keyId);
451
426
  const nativeCacheRecord = {
452
427
  idToken: cachedIdToken,
@@ -454,14 +429,21 @@ class NativeInteractionClient extends BaseInteractionClient {
454
429
  };
455
430
  return this.nativeStorageManager.saveCacheRecord(nativeCacheRecord, this.correlationId, request.storeInCache);
456
431
  }
457
- addTelemetryFromNativeResponse(response) {
458
- const mats = this.getMATSFromResponse(response);
432
+ getExpiresInValue(tokenType, expiresIn) {
433
+ return tokenType === AuthenticationScheme.POP
434
+ ? Constants.SHR_NONCE_VALIDITY
435
+ : (typeof expiresIn === "string"
436
+ ? parseInt(expiresIn, 10)
437
+ : expiresIn) || 0;
438
+ }
439
+ addTelemetryFromNativeResponse(matsResponse) {
440
+ const mats = this.getMATSFromResponse(matsResponse);
459
441
  if (!mats) {
460
442
  return null;
461
443
  }
462
444
  this.performanceClient.addFields({
463
- extensionId: this.nativeMessageHandler.getExtensionId(),
464
- extensionVersion: this.nativeMessageHandler.getExtensionVersion(),
445
+ extensionId: this.platformAuthProvider.getExtensionId(),
446
+ extensionVersion: this.platformAuthProvider.getExtensionVersion(),
465
447
  matsBrokerVersion: mats.broker_version,
466
448
  matsAccountJoinOnStart: mats.account_join_on_start,
467
449
  matsAccountJoinOnEnd: mats.account_join_on_end,
@@ -478,32 +460,15 @@ class NativeInteractionClient extends BaseInteractionClient {
478
460
  }, this.correlationId);
479
461
  return mats;
480
462
  }
481
- /**
482
- * Validates native platform response before processing
483
- * @param response
484
- */
485
- validateNativeResponse(response) {
486
- if (response.hasOwnProperty("access_token") &&
487
- response.hasOwnProperty("id_token") &&
488
- response.hasOwnProperty("client_info") &&
489
- response.hasOwnProperty("account") &&
490
- response.hasOwnProperty("scope") &&
491
- response.hasOwnProperty("expires_in")) {
492
- return response;
493
- }
494
- else {
495
- throw createAuthError(AuthErrorCodes.unexpectedError, "Response missing expected properties.");
496
- }
497
- }
498
463
  /**
499
464
  * Gets MATS telemetry from native response
500
465
  * @param response
501
466
  * @returns
502
467
  */
503
- getMATSFromResponse(response) {
504
- if (response.properties.MATS) {
468
+ getMATSFromResponse(matsResponse) {
469
+ if (matsResponse) {
505
470
  try {
506
- return JSON.parse(response.properties.MATS);
471
+ return JSON.parse(matsResponse);
507
472
  }
508
473
  catch (e) {
509
474
  this.logger.error("NativeInteractionClient - Error parsing MATS telemetry, returning null instead");
@@ -529,46 +494,11 @@ class NativeInteractionClient extends BaseInteractionClient {
529
494
  */
530
495
  async initializeNativeRequest(request) {
531
496
  this.logger.trace("NativeInteractionClient - initializeNativeRequest called");
532
- const requestAuthority = request.authority || this.config.auth.authority;
533
- if (request.account) {
534
- // validate authority
535
- await this.getDiscoveredAuthority({
536
- requestAuthority,
537
- requestAzureCloudOptions: request.azureCloudOptions,
538
- account: request.account,
539
- });
540
- }
541
- const canonicalAuthority = new UrlString(requestAuthority);
542
- canonicalAuthority.validateAsUri();
497
+ const canonicalAuthority = await this.getCanonicalAuthority(request);
543
498
  // 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.
544
499
  const { scopes, ...remainingProperties } = request;
545
500
  const scopeSet = new ScopeSet(scopes || []);
546
501
  scopeSet.appendScopes(OIDC_DEFAULT_SCOPES);
547
- const getPrompt = () => {
548
- // If request is silent, prompt is always none
549
- switch (this.apiId) {
550
- case ApiId.ssoSilent:
551
- case ApiId.acquireTokenSilent_silentFlow:
552
- this.logger.trace("initializeNativeRequest: silent request sets prompt to none");
553
- return PromptValue.NONE;
554
- }
555
- // Prompt not provided, request may proceed and native broker decides if it needs to prompt
556
- if (!request.prompt) {
557
- this.logger.trace("initializeNativeRequest: prompt was not provided");
558
- return undefined;
559
- }
560
- // If request is interactive, check if prompt provided is allowed to go directly to native broker
561
- switch (request.prompt) {
562
- case PromptValue.NONE:
563
- case PromptValue.CONSENT:
564
- case PromptValue.LOGIN:
565
- this.logger.trace("initializeNativeRequest: prompt is compatible with native flow");
566
- return request.prompt;
567
- default:
568
- this.logger.trace(`initializeNativeRequest: prompt = ${request.prompt} is not compatible with native flow`);
569
- throw createBrowserAuthError(nativePromptNotSupported);
570
- }
571
- };
572
502
  const validatedRequest = {
573
503
  ...remainingProperties,
574
504
  accountId: this.accountId,
@@ -576,7 +506,7 @@ class NativeInteractionClient extends BaseInteractionClient {
576
506
  authority: canonicalAuthority.urlString,
577
507
  scope: scopeSet.printScopes(),
578
508
  redirectUri: this.getRedirectUri(request.redirectUri),
579
- prompt: getPrompt(),
509
+ prompt: this.getPrompt(request.prompt),
580
510
  correlationId: this.correlationId,
581
511
  tokenType: request.authenticationScheme,
582
512
  windowTitleSubstring: document.title,
@@ -595,7 +525,7 @@ class NativeInteractionClient extends BaseInteractionClient {
595
525
  validatedRequest.extraParameters =
596
526
  validatedRequest.extraParameters || {};
597
527
  validatedRequest.extraParameters.telemetry =
598
- NativeConstants.MATS_TELEMETRY;
528
+ PlatformAuthConstants.MATS_TELEMETRY;
599
529
  if (request.authenticationScheme === AuthenticationScheme.POP) {
600
530
  // add POP request type
601
531
  const shrParameters = {
@@ -623,9 +553,48 @@ class NativeInteractionClient extends BaseInteractionClient {
623
553
  this.addRequestSKUs(validatedRequest);
624
554
  return validatedRequest;
625
555
  }
556
+ async getCanonicalAuthority(request) {
557
+ const requestAuthority = request.authority || this.config.auth.authority;
558
+ if (request.account) {
559
+ // validate authority
560
+ await this.getDiscoveredAuthority({
561
+ requestAuthority,
562
+ requestAzureCloudOptions: request.azureCloudOptions,
563
+ account: request.account,
564
+ });
565
+ }
566
+ const canonicalAuthority = new UrlString(requestAuthority);
567
+ canonicalAuthority.validateAsUri();
568
+ return canonicalAuthority;
569
+ }
570
+ getPrompt(prompt) {
571
+ // If request is silent, prompt is always none
572
+ switch (this.apiId) {
573
+ case ApiId.ssoSilent:
574
+ case ApiId.acquireTokenSilent_silentFlow:
575
+ this.logger.trace("initializeNativeRequest: silent request sets prompt to none");
576
+ return PromptValue.NONE;
577
+ }
578
+ // Prompt not provided, request may proceed and native broker decides if it needs to prompt
579
+ if (!prompt) {
580
+ this.logger.trace("initializeNativeRequest: prompt was not provided");
581
+ return undefined;
582
+ }
583
+ // If request is interactive, check if prompt provided is allowed to go directly to native broker
584
+ switch (prompt) {
585
+ case PromptValue.NONE:
586
+ case PromptValue.CONSENT:
587
+ case PromptValue.LOGIN:
588
+ this.logger.trace("initializeNativeRequest: prompt is compatible with native flow");
589
+ return prompt;
590
+ default:
591
+ this.logger.trace(`initializeNativeRequest: prompt = ${prompt} is not compatible with native flow`);
592
+ throw createBrowserAuthError(nativePromptNotSupported);
593
+ }
594
+ }
626
595
  /**
627
596
  * Handles extra broker request parameters
628
- * @param request {NativeTokenRequest}
597
+ * @param request {PlatformAuthRequest}
629
598
  * @private
630
599
  */
631
600
  handleExtraBrokerParams(request) {
@@ -659,5 +628,5 @@ class NativeInteractionClient extends BaseInteractionClient {
659
628
  }
660
629
  }
661
630
 
662
- export { NativeInteractionClient };
663
- //# sourceMappingURL=NativeInteractionClient.mjs.map
631
+ export { PlatformAuthInteractionClient };
632
+ //# sourceMappingURL=PlatformAuthInteractionClient.mjs.map