@azure/msal-browser 3.1.0 → 3.3.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 (282) hide show
  1. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  2. package/dist/app/IPublicClientApplication.mjs +20 -19
  3. package/dist/app/IPublicClientApplication.mjs.map +1 -1
  4. package/dist/app/PublicClientApplication.d.ts +14 -6
  5. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  6. package/dist/app/PublicClientApplication.mjs +18 -8
  7. package/dist/app/PublicClientApplication.mjs.map +1 -1
  8. package/dist/app/PublicClientNext.d.ts +274 -0
  9. package/dist/app/PublicClientNext.d.ts.map +1 -0
  10. package/dist/app/PublicClientNext.mjs +362 -0
  11. package/dist/app/PublicClientNext.mjs.map +1 -0
  12. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +3 -4
  13. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
  14. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +13 -13
  15. package/dist/broker/nativeBroker/NativeMessageHandler.mjs.map +1 -1
  16. package/dist/broker/nativeBroker/NativeStatusCodes.d.ts +8 -0
  17. package/dist/broker/nativeBroker/NativeStatusCodes.d.ts.map +1 -0
  18. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +16 -0
  19. package/dist/broker/nativeBroker/NativeStatusCodes.mjs.map +1 -0
  20. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  21. package/dist/cache/BrowserCacheManager.d.ts +4 -15
  22. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  23. package/dist/cache/BrowserCacheManager.mjs +13 -69
  24. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  25. package/dist/cache/BrowserStorage.d.ts.map +1 -1
  26. package/dist/cache/BrowserStorage.mjs +7 -9
  27. package/dist/cache/BrowserStorage.mjs.map +1 -1
  28. package/dist/cache/CryptoKeyStore.mjs +1 -1
  29. package/dist/cache/DatabaseStorage.mjs +1 -1
  30. package/dist/cache/MemoryStorage.mjs +1 -1
  31. package/dist/cache/TokenCache.mjs +1 -1
  32. package/dist/config/Configuration.d.ts +4 -0
  33. package/dist/config/Configuration.d.ts.map +1 -1
  34. package/dist/config/Configuration.mjs +8 -7
  35. package/dist/config/Configuration.mjs.map +1 -1
  36. package/dist/controllers/ControllerFactory.d.ts +2 -1
  37. package/dist/controllers/ControllerFactory.d.ts.map +1 -1
  38. package/dist/controllers/ControllerFactory.mjs +26 -19
  39. package/dist/controllers/ControllerFactory.mjs.map +1 -1
  40. package/dist/controllers/IController.d.ts +3 -2
  41. package/dist/controllers/IController.d.ts.map +1 -1
  42. package/dist/controllers/NestedAppAuthController.d.ts +96 -0
  43. package/dist/controllers/NestedAppAuthController.d.ts.map +1 -0
  44. package/dist/controllers/NestedAppAuthController.mjs +345 -0
  45. package/dist/controllers/NestedAppAuthController.mjs.map +1 -0
  46. package/dist/controllers/StandardController.d.ts +11 -6
  47. package/dist/controllers/StandardController.d.ts.map +1 -1
  48. package/dist/controllers/StandardController.mjs +67 -45
  49. package/dist/controllers/StandardController.mjs.map +1 -1
  50. package/dist/controllers/UnknownOperatingContextController.d.ts +88 -0
  51. package/dist/controllers/UnknownOperatingContextController.d.ts.map +1 -0
  52. package/dist/controllers/UnknownOperatingContextController.mjs +275 -0
  53. package/dist/controllers/UnknownOperatingContextController.mjs.map +1 -0
  54. package/dist/crypto/BrowserCrypto.d.ts +44 -49
  55. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  56. package/dist/crypto/BrowserCrypto.mjs +77 -77
  57. package/dist/crypto/BrowserCrypto.mjs.map +1 -1
  58. package/dist/crypto/CryptoOps.d.ts +1 -7
  59. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  60. package/dist/crypto/CryptoOps.mjs +18 -23
  61. package/dist/crypto/CryptoOps.mjs.map +1 -1
  62. package/dist/crypto/PkceGenerator.d.ts +6 -21
  63. package/dist/crypto/PkceGenerator.d.ts.map +1 -1
  64. package/dist/crypto/PkceGenerator.mjs +45 -46
  65. package/dist/crypto/PkceGenerator.mjs.map +1 -1
  66. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  67. package/dist/encode/Base64Decode.d.ts.map +1 -1
  68. package/dist/encode/Base64Decode.mjs +18 -2
  69. package/dist/encode/Base64Decode.mjs.map +1 -1
  70. package/dist/encode/Base64Encode.mjs +1 -1
  71. package/dist/error/BrowserAuthError.d.ts +10 -1
  72. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  73. package/dist/error/BrowserAuthError.mjs +12 -3
  74. package/dist/error/BrowserAuthError.mjs.map +1 -1
  75. package/dist/error/BrowserAuthErrorCodes.d.ts +1 -0
  76. package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -1
  77. package/dist/error/BrowserAuthErrorCodes.mjs +3 -2
  78. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
  79. package/dist/error/BrowserConfigurationAuthError.d.ts +9 -46
  80. package/dist/error/BrowserConfigurationAuthError.d.ts.map +1 -1
  81. package/dist/error/BrowserConfigurationAuthError.mjs +20 -73
  82. package/dist/error/BrowserConfigurationAuthError.mjs.map +1 -1
  83. package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts +4 -0
  84. package/dist/error/BrowserConfigurationAuthErrorCodes.d.ts.map +1 -0
  85. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +12 -0
  86. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs.map +1 -0
  87. package/dist/error/NativeAuthError.d.ts +17 -45
  88. package/dist/error/NativeAuthError.d.ts.map +1 -1
  89. package/dist/error/NativeAuthError.mjs +47 -78
  90. package/dist/error/NativeAuthError.mjs.map +1 -1
  91. package/dist/error/NativeAuthErrorCodes.d.ts +3 -0
  92. package/dist/error/NativeAuthErrorCodes.d.ts.map +1 -0
  93. package/dist/error/NativeAuthErrorCodes.mjs +11 -0
  94. package/dist/error/NativeAuthErrorCodes.mjs.map +1 -0
  95. package/dist/error/NestedAppAuthError.d.ts +15 -0
  96. package/dist/error/NestedAppAuthError.d.ts.map +1 -0
  97. package/dist/error/NestedAppAuthError.mjs +30 -0
  98. package/dist/error/NestedAppAuthError.mjs.map +1 -0
  99. package/dist/event/EventHandler.d.ts.map +1 -1
  100. package/dist/event/EventHandler.mjs +3 -2
  101. package/dist/event/EventHandler.mjs.map +1 -1
  102. package/dist/event/EventMessage.mjs +1 -1
  103. package/dist/event/EventType.mjs +1 -1
  104. package/dist/index.d.ts +5 -7
  105. package/dist/index.d.ts.map +1 -1
  106. package/dist/index.mjs +7 -3
  107. package/dist/index.mjs.map +1 -1
  108. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  109. package/dist/interaction_client/BaseInteractionClient.mjs +10 -11
  110. package/dist/interaction_client/BaseInteractionClient.mjs.map +1 -1
  111. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  112. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  113. package/dist/interaction_client/NativeInteractionClient.mjs +26 -13
  114. package/dist/interaction_client/NativeInteractionClient.mjs.map +1 -1
  115. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  116. package/dist/interaction_client/PopupClient.mjs +5 -4
  117. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  118. package/dist/interaction_client/RedirectClient.mjs +7 -7
  119. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  120. package/dist/interaction_client/SilentAuthCodeClient.mjs +7 -10
  121. package/dist/interaction_client/SilentAuthCodeClient.mjs.map +1 -1
  122. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  123. package/dist/interaction_client/SilentCacheClient.mjs +11 -18
  124. package/dist/interaction_client/SilentCacheClient.mjs.map +1 -1
  125. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  126. package/dist/interaction_client/SilentIframeClient.mjs +27 -13
  127. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  128. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  129. package/dist/interaction_client/SilentRefreshClient.mjs +8 -18
  130. package/dist/interaction_client/SilentRefreshClient.mjs.map +1 -1
  131. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  132. package/dist/interaction_client/StandardInteractionClient.mjs +16 -37
  133. package/dist/interaction_client/StandardInteractionClient.mjs.map +1 -1
  134. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  135. package/dist/interaction_handler/InteractionHandler.mjs +6 -9
  136. package/dist/interaction_handler/InteractionHandler.mjs.map +1 -1
  137. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  138. package/dist/interaction_handler/RedirectHandler.mjs +3 -3
  139. package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
  140. package/dist/interaction_handler/SilentHandler.d.ts +13 -47
  141. package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
  142. package/dist/interaction_handler/SilentHandler.mjs +120 -156
  143. package/dist/interaction_handler/SilentHandler.mjs.map +1 -1
  144. package/dist/naa/AccountInfo.d.ts +13 -0
  145. package/dist/naa/AccountInfo.d.ts.map +1 -0
  146. package/dist/naa/AccountRequests.d.ts +10 -0
  147. package/dist/naa/AccountRequests.d.ts.map +1 -0
  148. package/dist/naa/AuthBridge.d.ts +6 -0
  149. package/dist/naa/AuthBridge.d.ts.map +1 -0
  150. package/dist/naa/BridgeCapabilities.d.ts +4 -0
  151. package/dist/naa/BridgeCapabilities.d.ts.map +1 -0
  152. package/dist/naa/BridgeError.d.ts +10 -0
  153. package/dist/naa/BridgeError.d.ts.map +1 -0
  154. package/dist/naa/BridgeError.mjs +12 -0
  155. package/dist/naa/BridgeError.mjs.map +1 -0
  156. package/dist/naa/BridgeProxy.d.ts +72 -0
  157. package/dist/naa/BridgeProxy.d.ts.map +1 -0
  158. package/dist/naa/BridgeProxy.mjs +154 -0
  159. package/dist/naa/BridgeProxy.mjs.map +1 -0
  160. package/dist/naa/BridgeRequest.d.ts +7 -0
  161. package/dist/naa/BridgeRequest.d.ts.map +1 -0
  162. package/dist/naa/BridgeRequestEnvelope.d.ts +14 -0
  163. package/dist/naa/BridgeRequestEnvelope.d.ts.map +1 -0
  164. package/dist/naa/BridgeResponseEnvelope.d.ts +11 -0
  165. package/dist/naa/BridgeResponseEnvelope.d.ts.map +1 -0
  166. package/dist/naa/BridgeStatusCode.d.ts +11 -0
  167. package/dist/naa/BridgeStatusCode.d.ts.map +1 -0
  168. package/dist/naa/BridgeStatusCode.mjs +20 -0
  169. package/dist/naa/BridgeStatusCode.mjs.map +1 -0
  170. package/dist/naa/IBridgeProxy.d.ts +11 -0
  171. package/dist/naa/IBridgeProxy.d.ts.map +1 -0
  172. package/dist/naa/InitializeBridgeResponse.d.ts +7 -0
  173. package/dist/naa/InitializeBridgeResponse.d.ts.map +1 -0
  174. package/dist/naa/TokenRequest.d.ts +22 -0
  175. package/dist/naa/TokenRequest.d.ts.map +1 -0
  176. package/dist/naa/TokenResponse.d.ts +17 -0
  177. package/dist/naa/TokenResponse.d.ts.map +1 -0
  178. package/dist/naa/mapping/NestedAppAuthAdapter.d.ts +26 -0
  179. package/dist/naa/mapping/NestedAppAuthAdapter.d.ts.map +1 -0
  180. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +178 -0
  181. package/dist/naa/mapping/NestedAppAuthAdapter.mjs.map +1 -0
  182. package/dist/navigation/NavigationClient.mjs +1 -1
  183. package/dist/network/FetchClient.mjs +1 -1
  184. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  185. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  186. package/dist/operatingcontext/TeamsAppOperatingContext.d.ts +7 -0
  187. package/dist/operatingcontext/TeamsAppOperatingContext.d.ts.map +1 -1
  188. package/dist/operatingcontext/TeamsAppOperatingContext.mjs +45 -4
  189. package/dist/operatingcontext/TeamsAppOperatingContext.mjs.map +1 -1
  190. package/dist/operatingcontext/UnknownOperatingContext.d.ts +26 -0
  191. package/dist/operatingcontext/UnknownOperatingContext.d.ts.map +1 -0
  192. package/dist/operatingcontext/UnknownOperatingContext.mjs +49 -0
  193. package/dist/operatingcontext/UnknownOperatingContext.mjs.map +1 -0
  194. package/dist/packageMetadata.d.ts +1 -1
  195. package/dist/packageMetadata.mjs +2 -2
  196. package/dist/telemetry/BrowserPerformanceClient.mjs +1 -1
  197. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  198. package/dist/utils/BrowserConstants.mjs +1 -1
  199. package/dist/utils/BrowserProtocolUtils.d.ts.map +1 -1
  200. package/dist/utils/BrowserProtocolUtils.mjs +3 -3
  201. package/dist/utils/BrowserProtocolUtils.mjs.map +1 -1
  202. package/dist/utils/BrowserUtils.d.ts +54 -53
  203. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  204. package/dist/utils/BrowserUtils.mjs +114 -102
  205. package/dist/utils/BrowserUtils.mjs.map +1 -1
  206. package/lib/msal-browser.cjs +61 -18042
  207. package/lib/msal-browser.cjs.map +1 -1
  208. package/lib/msal-browser.js +13593 -12505
  209. package/lib/msal-browser.js.map +1 -1
  210. package/lib/msal-browser.min.js +66 -65
  211. package/package.json +2 -2
  212. package/src/app/IPublicClientApplication.ts +55 -18
  213. package/src/app/PublicClientApplication.ts +19 -7
  214. package/src/app/PublicClientNext.ts +442 -0
  215. package/src/broker/nativeBroker/NativeMessageHandler.ts +12 -15
  216. package/src/broker/nativeBroker/NativeStatusCodes.ts +13 -0
  217. package/src/cache/BrowserCacheManager.ts +29 -103
  218. package/src/cache/BrowserStorage.ts +9 -11
  219. package/src/config/Configuration.ts +21 -8
  220. package/src/controllers/ControllerFactory.ts +36 -25
  221. package/src/controllers/IController.ts +4 -1
  222. package/src/controllers/NestedAppAuthController.ts +525 -0
  223. package/src/controllers/StandardController.ts +163 -98
  224. package/src/controllers/UnknownOperatingContextController.ts +383 -0
  225. package/src/crypto/BrowserCrypto.ts +119 -103
  226. package/src/crypto/CryptoOps.ts +18 -27
  227. package/src/crypto/PkceGenerator.ts +93 -54
  228. package/src/encode/Base64Decode.ts +21 -1
  229. package/src/error/BrowserAuthError.ts +13 -1
  230. package/src/error/BrowserAuthErrorCodes.ts +1 -0
  231. package/src/error/BrowserConfigurationAuthError.ts +33 -102
  232. package/src/error/BrowserConfigurationAuthErrorCodes.ts +9 -0
  233. package/src/error/NativeAuthError.ts +73 -101
  234. package/src/error/NativeAuthErrorCodes.ts +7 -0
  235. package/src/error/NestedAppAuthError.ts +32 -0
  236. package/src/event/EventHandler.ts +2 -1
  237. package/src/index.ts +8 -10
  238. package/src/interaction_client/BaseInteractionClient.ts +14 -8
  239. package/src/interaction_client/NativeInteractionClient.ts +48 -14
  240. package/src/interaction_client/PopupClient.ts +2 -1
  241. package/src/interaction_client/RedirectClient.ts +1 -1
  242. package/src/interaction_client/SilentAuthCodeClient.ts +22 -19
  243. package/src/interaction_client/SilentCacheClient.ts +28 -28
  244. package/src/interaction_client/SilentIframeClient.ts +54 -18
  245. package/src/interaction_client/SilentRefreshClient.ts +26 -28
  246. package/src/interaction_client/StandardInteractionClient.ts +37 -68
  247. package/src/interaction_handler/InteractionHandler.ts +20 -15
  248. package/src/interaction_handler/RedirectHandler.ts +6 -2
  249. package/src/interaction_handler/SilentHandler.ts +177 -230
  250. package/src/naa/AccountInfo.ts +17 -0
  251. package/src/naa/AccountRequests.ts +16 -0
  252. package/src/naa/AuthBridge.ts +16 -0
  253. package/src/naa/BridgeCapabilities.ts +8 -0
  254. package/src/naa/BridgeError.ts +18 -0
  255. package/src/naa/BridgeProxy.ts +230 -0
  256. package/src/naa/BridgeRequest.ts +12 -0
  257. package/src/naa/BridgeRequestEnvelope.ts +46 -0
  258. package/src/naa/BridgeResponseEnvelope.ts +21 -0
  259. package/src/naa/BridgeStatusCode.ts +15 -0
  260. package/src/naa/IBridgeProxy.ts +25 -0
  261. package/src/naa/InitializeBridgeResponse.ts +12 -0
  262. package/src/naa/TokenRequest.ts +26 -0
  263. package/src/naa/TokenResponse.ts +61 -0
  264. package/src/naa/mapping/NestedAppAuthAdapter.ts +252 -0
  265. package/src/operatingcontext/TeamsAppOperatingContext.ts +43 -3
  266. package/src/operatingcontext/UnknownOperatingContext.ts +48 -0
  267. package/src/packageMetadata.ts +1 -1
  268. package/src/utils/BrowserProtocolUtils.ts +3 -2
  269. package/src/utils/BrowserUtils.ts +133 -125
  270. package/dist/crypto/ISubtleCrypto.d.ts +0 -10
  271. package/dist/crypto/ISubtleCrypto.d.ts.map +0 -1
  272. package/dist/crypto/ModernBrowserCrypto.d.ts +0 -10
  273. package/dist/crypto/ModernBrowserCrypto.d.ts.map +0 -1
  274. package/dist/crypto/ModernBrowserCrypto.mjs +0 -31
  275. package/dist/crypto/ModernBrowserCrypto.mjs.map +0 -1
  276. package/dist/utils/BrowserStringUtils.d.ts +0 -22
  277. package/dist/utils/BrowserStringUtils.d.ts.map +0 -1
  278. package/dist/utils/BrowserStringUtils.mjs +0 -144
  279. package/dist/utils/BrowserStringUtils.mjs.map +0 -1
  280. package/src/crypto/ISubtleCrypto.ts +0 -30
  281. package/src/crypto/ModernBrowserCrypto.ts +0 -69
  282. package/src/utils/BrowserStringUtils.ts +0 -143
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "type": "git",
11
11
  "url": "https://github.com/AzureAD/microsoft-authentication-library-for-js.git"
12
12
  },
13
- "version": "3.1.0",
13
+ "version": "3.3.0",
14
14
  "description": "Microsoft Authentication Library for js",
15
15
  "keywords": [
16
16
  "implicit",
@@ -100,6 +100,6 @@
100
100
  "typescript": "^4.9.5"
101
101
  },
102
102
  "dependencies": {
103
- "@azure/msal-common": "14.0.3"
103
+ "@azure/msal-common": "14.2.0"
104
104
  }
105
105
  }
@@ -13,7 +13,10 @@ import { PopupRequest } from "../request/PopupRequest";
13
13
  import { SilentRequest } from "../request/SilentRequest";
14
14
  import { SsoSilentRequest } from "../request/SsoSilentRequest";
15
15
  import { EndSessionRequest } from "../request/EndSessionRequest";
16
- import { BrowserConfigurationAuthError } from "../error/BrowserConfigurationAuthError";
16
+ import {
17
+ BrowserConfigurationAuthErrorCodes,
18
+ createBrowserConfigurationAuthError,
19
+ } from "../error/BrowserConfigurationAuthError";
17
20
  import { WrapperSKU } from "../utils/BrowserConstants";
18
21
  import { INavigationClient } from "../navigation/INavigationClient";
19
22
  import { EndSessionPopupRequest } from "../request/EndSessionPopupRequest";
@@ -74,27 +77,37 @@ export interface IPublicClientApplication {
74
77
  export const stubbedPublicClientApplication: IPublicClientApplication = {
75
78
  initialize: () => {
76
79
  return Promise.reject(
77
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
80
+ createBrowserConfigurationAuthError(
81
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
82
+ )
78
83
  );
79
84
  },
80
85
  acquireTokenPopup: () => {
81
86
  return Promise.reject(
82
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
87
+ createBrowserConfigurationAuthError(
88
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
89
+ )
83
90
  );
84
91
  },
85
92
  acquireTokenRedirect: () => {
86
93
  return Promise.reject(
87
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
94
+ createBrowserConfigurationAuthError(
95
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
96
+ )
88
97
  );
89
98
  },
90
99
  acquireTokenSilent: () => {
91
100
  return Promise.reject(
92
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
101
+ createBrowserConfigurationAuthError(
102
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
103
+ )
93
104
  );
94
105
  },
95
106
  acquireTokenByCode: () => {
96
107
  return Promise.reject(
97
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
108
+ createBrowserConfigurationAuthError(
109
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
110
+ )
98
111
  );
99
112
  },
100
113
  getAllAccounts: () => {
@@ -111,37 +124,51 @@ export const stubbedPublicClientApplication: IPublicClientApplication = {
111
124
  },
112
125
  handleRedirectPromise: () => {
113
126
  return Promise.reject(
114
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
127
+ createBrowserConfigurationAuthError(
128
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
129
+ )
115
130
  );
116
131
  },
117
132
  loginPopup: () => {
118
133
  return Promise.reject(
119
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
134
+ createBrowserConfigurationAuthError(
135
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
136
+ )
120
137
  );
121
138
  },
122
139
  loginRedirect: () => {
123
140
  return Promise.reject(
124
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
141
+ createBrowserConfigurationAuthError(
142
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
143
+ )
125
144
  );
126
145
  },
127
146
  logout: () => {
128
147
  return Promise.reject(
129
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
148
+ createBrowserConfigurationAuthError(
149
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
150
+ )
130
151
  );
131
152
  },
132
153
  logoutRedirect: () => {
133
154
  return Promise.reject(
134
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
155
+ createBrowserConfigurationAuthError(
156
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
157
+ )
135
158
  );
136
159
  },
137
160
  logoutPopup: () => {
138
161
  return Promise.reject(
139
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
162
+ createBrowserConfigurationAuthError(
163
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
164
+ )
140
165
  );
141
166
  },
142
167
  ssoSilent: () => {
143
168
  return Promise.reject(
144
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
169
+ createBrowserConfigurationAuthError(
170
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
171
+ )
145
172
  );
146
173
  },
147
174
  addEventCallback: () => {
@@ -163,10 +190,14 @@ export const stubbedPublicClientApplication: IPublicClientApplication = {
163
190
  return;
164
191
  },
165
192
  getTokenCache: () => {
166
- throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();
193
+ throw createBrowserConfigurationAuthError(
194
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
195
+ );
167
196
  },
168
197
  getLogger: () => {
169
- throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();
198
+ throw createBrowserConfigurationAuthError(
199
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
200
+ );
170
201
  },
171
202
  setLogger: () => {
172
203
  return;
@@ -184,16 +215,22 @@ export const stubbedPublicClientApplication: IPublicClientApplication = {
184
215
  return;
185
216
  },
186
217
  getConfiguration: () => {
187
- throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();
218
+ throw createBrowserConfigurationAuthError(
219
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
220
+ );
188
221
  },
189
222
  hydrateCache: () => {
190
223
  return Promise.reject(
191
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
224
+ createBrowserConfigurationAuthError(
225
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
226
+ )
192
227
  );
193
228
  },
194
229
  clearCache: () => {
195
230
  return Promise.reject(
196
- BrowserConfigurationAuthError.createStubPcaInstanceCalledError()
231
+ createBrowserConfigurationAuthError(
232
+ BrowserConfigurationAuthErrorCodes.stubbedPublicClientApplicationCalled
233
+ )
197
234
  );
198
235
  },
199
236
  };
@@ -15,6 +15,7 @@ import { IController } from "../controllers/IController";
15
15
  import {
16
16
  PerformanceCallbackFunction,
17
17
  AccountInfo,
18
+ AccountFilter,
18
19
  Logger,
19
20
  } from "@azure/msal-common";
20
21
  import { EndSessionRequest } from "../request/EndSessionRequest";
@@ -38,7 +39,7 @@ export class PublicClientApplication implements IPublicClientApplication {
38
39
  configuration: Configuration
39
40
  ): Promise<IPublicClientApplication> {
40
41
  const factory = new ControllerFactory(configuration);
41
- const controller = await factory.createController();
42
+ const controller = await factory.createV3Controller();
42
43
  const pca = new PublicClientApplication(configuration, controller);
43
44
 
44
45
  return pca;
@@ -188,12 +189,22 @@ export class PublicClientApplication implements IPublicClientApplication {
188
189
  this.controller.disableAccountStorageEvents();
189
190
  }
190
191
 
192
+ /**
193
+ * Returns the first account found in the cache that matches the account filter passed in.
194
+ * @param accountFilter
195
+ * @returns The first account found in the cache matching the provided filter or null if no account could be found.
196
+ */
197
+ getAccount(accountFilter: AccountFilter): AccountInfo | null {
198
+ return this.controller.getAccount(accountFilter);
199
+ }
200
+
191
201
  /**
192
202
  * Returns the signed in account matching homeAccountId.
193
203
  * (the account object is created at the time of successful login)
194
204
  * or null when no matching account is found
195
205
  * @param homeAccountId
196
206
  * @returns The account object stored in MSAL
207
+ * @deprecated - Use getAccount instead
197
208
  */
198
209
  getAccountByHomeId(homeAccountId: string): AccountInfo | null {
199
210
  return this.controller.getAccountByHomeId(homeAccountId);
@@ -205,6 +216,7 @@ export class PublicClientApplication implements IPublicClientApplication {
205
216
  * or null when no matching account is found
206
217
  * @param localAccountId
207
218
  * @returns The account object stored in MSAL
219
+ * @deprecated - Use getAccount instead
208
220
  */
209
221
  getAccountByLocalId(localId: string): AccountInfo | null {
210
222
  return this.controller.getAccountByLocalId(localId);
@@ -217,19 +229,19 @@ export class PublicClientApplication implements IPublicClientApplication {
217
229
  * This API is provided for convenience but getAccountById should be used for best reliability
218
230
  * @param userName
219
231
  * @returns The account object stored in MSAL
232
+ * @deprecated - Use getAccount instead
220
233
  */
221
234
  getAccountByUsername(userName: string): AccountInfo | null {
222
235
  return this.controller.getAccountByUsername(userName);
223
236
  }
224
237
 
225
238
  /**
226
- * Returns all accounts that MSAL currently has data for.
227
- * (the account object is created at the time of successful login)
228
- * or empty array when no accounts are found
229
- * @returns Array of account objects in cache
239
+ * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
240
+ * @param accountFilter - (Optional) filter to narrow down the accounts returned
241
+ * @returns Array of AccountInfo objects in cache
230
242
  */
231
- getAllAccounts(): AccountInfo[] {
232
- return this.controller.getAllAccounts();
243
+ getAllAccounts(accountFilter?: AccountFilter): AccountInfo[] {
244
+ return this.controller.getAllAccounts(accountFilter);
233
245
  }
234
246
 
235
247
  /**
@@ -0,0 +1,442 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation. All rights reserved.
3
+ * Licensed under the MIT License.
4
+ */
5
+
6
+ import { ITokenCache } from "../cache/ITokenCache";
7
+ import { INavigationClient } from "../navigation/INavigationClient";
8
+ import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
9
+ import { PopupRequest } from "../request/PopupRequest";
10
+ import { RedirectRequest } from "../request/RedirectRequest";
11
+ import { SilentRequest } from "../request/SilentRequest";
12
+ import { WrapperSKU } from "../utils/BrowserConstants";
13
+ import { IPublicClientApplication } from "./IPublicClientApplication";
14
+ import { IController } from "../controllers/IController";
15
+ import {
16
+ PerformanceCallbackFunction,
17
+ AccountInfo,
18
+ AccountFilter,
19
+ Logger,
20
+ } from "@azure/msal-common";
21
+ import { EndSessionRequest } from "../request/EndSessionRequest";
22
+ import { SsoSilentRequest } from "../request/SsoSilentRequest";
23
+ import { ControllerFactory } from "../controllers/ControllerFactory";
24
+ import { BrowserConfiguration, Configuration } from "../config/Configuration";
25
+ import { EventCallbackFunction } from "../event/EventMessage";
26
+ import { ClearCacheRequest } from "../request/ClearCacheRequest";
27
+ import { AuthenticationResult } from "../response/AuthenticationResult";
28
+ import { UnknownOperatingContextController } from "../controllers/UnknownOperatingContextController";
29
+ import { UnknownOperatingContext } from "../operatingcontext/UnknownOperatingContext";
30
+
31
+ /**
32
+ * PublicClientNext is an early look at the planned implementation of PublicClientApplication in the next major version of MSAL.js.
33
+ * It contains support for multiple API implementations based on the runtime environment that it is running in.
34
+ *
35
+ * The goals of these changes are to provide a clean separation of behavior between different operating contexts (Nested App Auth, Platform Brokers, Plain old Browser, etc.)
36
+ * while still providing a consistent API surface for developers.
37
+ *
38
+ */
39
+ export class PublicClientNext implements IPublicClientApplication {
40
+ /*
41
+ * Definite assignment assertion used below
42
+ * https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-7.html#definite-assignment-assertions
43
+ */
44
+ protected controller!: IController;
45
+ protected configuration: Configuration;
46
+
47
+ public static async createPublicClientApplication(
48
+ configuration: Configuration
49
+ ): Promise<IPublicClientApplication> {
50
+ const factory = new ControllerFactory(configuration);
51
+ const controller = await factory.createController();
52
+ let pca;
53
+ if (controller !== null) {
54
+ pca = new PublicClientNext(configuration, controller);
55
+ } else {
56
+ pca = new PublicClientNext(configuration);
57
+ }
58
+ return pca;
59
+ }
60
+
61
+ /**
62
+ * @constructor
63
+ * Constructor for the PublicClientNext used to instantiate the PublicClientNext object
64
+ *
65
+ * Important attributes in the Configuration object for auth are:
66
+ * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview
67
+ * - authority: the authority URL for your application.
68
+ * - redirect_uri: the uri of your application registered in the portal.
69
+ *
70
+ * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.
71
+ * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}
72
+ * If your application supports Accounts in one organizational directory, replace "Enter_the_Tenant_Info_Here" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).
73
+ * If your application supports Accounts in any organizational directory, replace "Enter_the_Tenant_Info_Here" value with organizations.
74
+ * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace "Enter_the_Tenant_Info_Here" value with common.
75
+ * To restrict support to Personal Microsoft accounts only, replace "Enter_the_Tenant_Info_Here" value with consumers.
76
+ *
77
+ * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/
78
+ * Full B2C functionality will be available in this library in future versions.
79
+ *
80
+ * @param configuration Object for the MSAL PublicClientApplication instance
81
+ * @param IController Optional parameter to explictly set the controller. (Will be removed when we remove public constructor)
82
+ */
83
+ private constructor(
84
+ configuration: Configuration,
85
+ controller?: IController
86
+ ) {
87
+ this.configuration = configuration;
88
+ if (controller) {
89
+ this.controller = controller;
90
+ } else {
91
+ const operatingContext = new UnknownOperatingContext(configuration);
92
+ this.controller = new UnknownOperatingContextController(
93
+ operatingContext
94
+ );
95
+ }
96
+ }
97
+
98
+ /**
99
+ * Initializer function to perform async startup tasks such as connecting to WAM extension
100
+ */
101
+ async initialize(): Promise<void> {
102
+ if (this.controller instanceof UnknownOperatingContextController) {
103
+ const factory = new ControllerFactory(this.configuration);
104
+ const result = await factory.createController();
105
+ if (result !== null) {
106
+ this.controller = result;
107
+ }
108
+ return this.controller.initialize();
109
+ }
110
+ return Promise.resolve();
111
+ }
112
+
113
+ /**
114
+ * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser
115
+ *
116
+ * @param request
117
+ *
118
+ * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
119
+ */
120
+ async acquireTokenPopup(
121
+ request: PopupRequest
122
+ ): Promise<AuthenticationResult> {
123
+ return this.controller.acquireTokenPopup(request);
124
+ }
125
+
126
+ /**
127
+ * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects
128
+ * the page, so any code that follows this function will not execute.
129
+ *
130
+ * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
131
+ * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
132
+ *
133
+ * @param request
134
+ */
135
+ acquireTokenRedirect(request: RedirectRequest): Promise<void> {
136
+ return this.controller.acquireTokenRedirect(request);
137
+ }
138
+
139
+ /**
140
+ * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
141
+ *
142
+ * @param {@link (SilentRequest:type)}
143
+ * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthenticationResult} object
144
+ */
145
+ acquireTokenSilent(
146
+ silentRequest: SilentRequest
147
+ ): Promise<AuthenticationResult> {
148
+ return this.controller.acquireTokenSilent(silentRequest);
149
+ }
150
+
151
+ /**
152
+ * This function redeems an authorization code (passed as code) from the eSTS token endpoint.
153
+ * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.
154
+ * This API is not indended for normal authorization code acquisition and redemption.
155
+ *
156
+ * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.
157
+ *
158
+ * @param request {@link AuthorizationCodeRequest}
159
+ * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
160
+ */
161
+ acquireTokenByCode(
162
+ request: AuthorizationCodeRequest
163
+ ): Promise<AuthenticationResult> {
164
+ return this.controller.acquireTokenByCode(request);
165
+ }
166
+
167
+ /**
168
+ * Adds event callbacks to array
169
+ * @param callback
170
+ */
171
+ addEventCallback(callback: EventCallbackFunction): string | null {
172
+ return this.controller.addEventCallback(callback);
173
+ }
174
+
175
+ /**
176
+ * Removes callback with provided id from callback array
177
+ * @param callbackId
178
+ */
179
+ removeEventCallback(callbackId: string): void {
180
+ return this.controller.removeEventCallback(callbackId);
181
+ }
182
+
183
+ /**
184
+ * Registers a callback to receive performance events.
185
+ *
186
+ * @param {PerformanceCallbackFunction} callback
187
+ * @returns {string}
188
+ */
189
+ addPerformanceCallback(callback: PerformanceCallbackFunction): string {
190
+ return this.controller.addPerformanceCallback(callback);
191
+ }
192
+
193
+ /**
194
+ * Removes a callback registered with addPerformanceCallback.
195
+ *
196
+ * @param {string} callbackId
197
+ * @returns {boolean}
198
+ */
199
+ removePerformanceCallback(callbackId: string): boolean {
200
+ return this.controller.removePerformanceCallback(callbackId);
201
+ }
202
+
203
+ /**
204
+ * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
205
+ */
206
+ enableAccountStorageEvents(): void {
207
+ this.controller.enableAccountStorageEvents();
208
+ }
209
+
210
+ /**
211
+ * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window
212
+ */
213
+ disableAccountStorageEvents(): void {
214
+ this.controller.disableAccountStorageEvents();
215
+ }
216
+
217
+ /**
218
+ * Returns the first account found in the cache that matches the account filter passed in.
219
+ * @param accountFilter
220
+ * @returns The first account found in the cache matching the provided filter or null if no account could be found.
221
+ */
222
+ getAccount(accountFilter: AccountFilter): AccountInfo | null {
223
+ return this.controller.getAccount(accountFilter);
224
+ }
225
+
226
+ /**
227
+ * Returns the signed in account matching homeAccountId.
228
+ * (the account object is created at the time of successful login)
229
+ * or null when no matching account is found
230
+ * @param homeAccountId
231
+ * @returns The account object stored in MSAL
232
+ * @deprecated - Use getAccount instead
233
+ */
234
+ getAccountByHomeId(homeAccountId: string): AccountInfo | null {
235
+ return this.controller.getAccountByHomeId(homeAccountId);
236
+ }
237
+
238
+ /**
239
+ * Returns the signed in account matching localAccountId.
240
+ * (the account object is created at the time of successful login)
241
+ * or null when no matching account is found
242
+ * @param localAccountId
243
+ * @returns The account object stored in MSAL
244
+ * @deprecated - Use getAccount instead
245
+ */
246
+ getAccountByLocalId(localId: string): AccountInfo | null {
247
+ return this.controller.getAccountByLocalId(localId);
248
+ }
249
+
250
+ /**
251
+ * Returns the signed in account matching username.
252
+ * (the account object is created at the time of successful login)
253
+ * or null when no matching account is found.
254
+ * This API is provided for convenience but getAccountById should be used for best reliability
255
+ * @param userName
256
+ * @returns The account object stored in MSAL
257
+ * @deprecated - Use getAccount instead
258
+ */
259
+ getAccountByUsername(userName: string): AccountInfo | null {
260
+ return this.controller.getAccountByUsername(userName);
261
+ }
262
+
263
+ /**
264
+ * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
265
+ * @param accountFilter - (Optional) filter to narrow down the accounts returned
266
+ * @returns Array of AccountInfo objects in cache
267
+ */
268
+ getAllAccounts(accountFilter?: AccountFilter): AccountInfo[] {
269
+ return this.controller.getAllAccounts(accountFilter);
270
+ }
271
+
272
+ /**
273
+ * Event handler function which allows users to fire events after the PublicClientApplication object
274
+ * has loaded during redirect flows. This should be invoked on all page loads involved in redirect
275
+ * auth flows.
276
+ * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.
277
+ * @returns Token response or null. If the return value is null, then no auth redirect was detected.
278
+ */
279
+ handleRedirectPromise(
280
+ hash?: string | undefined
281
+ ): Promise<AuthenticationResult | null> {
282
+ return this.controller.handleRedirectPromise(hash);
283
+ }
284
+
285
+ /**
286
+ * Use when initiating the login process via opening a popup window in the user's browser
287
+ *
288
+ * @param request
289
+ *
290
+ * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
291
+ */
292
+ loginPopup(
293
+ request?: PopupRequest | undefined
294
+ ): Promise<AuthenticationResult> {
295
+ return this.controller.loginPopup(request);
296
+ }
297
+
298
+ /**
299
+ * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so
300
+ * any code that follows this function will not execute.
301
+ *
302
+ * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current
303
+ * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.
304
+ *
305
+ * @param request
306
+ */
307
+ loginRedirect(request?: RedirectRequest | undefined): Promise<void> {
308
+ return this.controller.loginRedirect(request);
309
+ }
310
+
311
+ /**
312
+ * Deprecated logout function. Use logoutRedirect or logoutPopup instead
313
+ * @param logoutRequest
314
+ * @deprecated
315
+ */
316
+ logout(logoutRequest?: EndSessionRequest): Promise<void> {
317
+ return this.controller.logout(logoutRequest);
318
+ }
319
+
320
+ /**
321
+ * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.
322
+ * Default behaviour is to redirect the user to `window.location.href`.
323
+ * @param logoutRequest
324
+ */
325
+ logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void> {
326
+ return this.controller.logoutRedirect(logoutRequest);
327
+ }
328
+
329
+ /**
330
+ * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server
331
+ * @param logoutRequest
332
+ */
333
+ logoutPopup(logoutRequest?: EndSessionRequest): Promise<void> {
334
+ return this.controller.logoutPopup(logoutRequest);
335
+ }
336
+
337
+ /**
338
+ * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:
339
+ * - Any browser using a form of Intelligent Tracking Prevention
340
+ * - If there is not an established session with the service
341
+ *
342
+ * In these cases, the request must be done inside a popup or full frame redirect.
343
+ *
344
+ * For the cases where interaction is required, you cannot send a request with prompt=none.
345
+ *
346
+ * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as
347
+ * you session on the server still exists.
348
+ * @param request {@link SsoSilentRequest}
349
+ *
350
+ * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
351
+ */
352
+ ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult> {
353
+ return this.controller.ssoSilent(request);
354
+ }
355
+
356
+ /**
357
+ * Gets the token cache for the application.
358
+ */
359
+ getTokenCache(): ITokenCache {
360
+ return this.controller.getTokenCache();
361
+ }
362
+
363
+ /**
364
+ * Returns the logger instance
365
+ */
366
+ getLogger(): Logger {
367
+ return this.controller.getLogger();
368
+ }
369
+
370
+ /**
371
+ * Replaces the default logger set in configurations with new Logger with new configurations
372
+ * @param logger Logger instance
373
+ */
374
+ setLogger(logger: Logger): void {
375
+ this.controller.setLogger(logger);
376
+ }
377
+
378
+ /**
379
+ * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.
380
+ * @param account
381
+ */
382
+ setActiveAccount(account: AccountInfo | null): void {
383
+ this.controller.setActiveAccount(account);
384
+ }
385
+
386
+ /**
387
+ * Gets the currently active account
388
+ */
389
+ getActiveAccount(): AccountInfo | null {
390
+ return this.controller.getActiveAccount();
391
+ }
392
+
393
+ /**
394
+ * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.
395
+ * @param sku
396
+ * @param version
397
+ */
398
+ initializeWrapperLibrary(sku: WrapperSKU, version: string): void {
399
+ return this.controller.initializeWrapperLibrary(sku, version);
400
+ }
401
+
402
+ /**
403
+ * Sets navigation client
404
+ * @param navigationClient
405
+ */
406
+ setNavigationClient(navigationClient: INavigationClient): void {
407
+ this.controller.setNavigationClient(navigationClient);
408
+ }
409
+
410
+ /**
411
+ * Returns the configuration object
412
+ * @internal
413
+ */
414
+ getConfiguration(): BrowserConfiguration {
415
+ return this.controller.getConfiguration();
416
+ }
417
+
418
+ /**
419
+ * Hydrates cache with the tokens and account in the AuthenticationResult object
420
+ * @param result
421
+ * @param request - The request object that was used to obtain the AuthenticationResult
422
+ * @returns
423
+ */
424
+ async hydrateCache(
425
+ result: AuthenticationResult,
426
+ request:
427
+ | SilentRequest
428
+ | SsoSilentRequest
429
+ | RedirectRequest
430
+ | PopupRequest
431
+ ): Promise<void> {
432
+ return this.controller.hydrateCache(result, request);
433
+ }
434
+
435
+ /**
436
+ * Clears tokens and account from the browser cache.
437
+ * @param logoutRequest
438
+ */
439
+ clearCache(logoutRequest?: ClearCacheRequest): Promise<void> {
440
+ return this.controller.clearCache(logoutRequest);
441
+ }
442
+ }