@azure/msal-browser 2.36.0 → 3.0.0-alpha.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 (558) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +213 -213
  3. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  4. package/dist/app/IPublicClientApplication.js +33 -33
  5. package/dist/app/IPublicClientApplication.js.map +1 -1
  6. package/dist/app/PublicClientApplication.d.ts +198 -24
  7. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  8. package/dist/app/PublicClientApplication.js +263 -220
  9. package/dist/app/PublicClientApplication.js.map +1 -1
  10. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +5 -4
  11. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
  12. package/dist/broker/nativeBroker/NativeMessageHandler.js +118 -124
  13. package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -1
  14. package/dist/broker/nativeBroker/NativeRequest.d.ts +4 -4
  15. package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -1
  16. package/dist/broker/nativeBroker/NativeResponse.d.ts +4 -4
  17. package/dist/broker/nativeBroker/NativeResponse.d.ts.map +1 -1
  18. package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
  19. package/dist/cache/AsyncMemoryStorage.js +83 -152
  20. package/dist/cache/AsyncMemoryStorage.js.map +1 -1
  21. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  22. package/dist/cache/BrowserCacheManager.js +420 -412
  23. package/dist/cache/BrowserCacheManager.js.map +1 -1
  24. package/dist/cache/BrowserStorage.d.ts.map +1 -1
  25. package/dist/cache/BrowserStorage.js +19 -19
  26. package/dist/cache/BrowserStorage.js.map +1 -1
  27. package/dist/cache/CryptoKeyStore.d.ts.map +1 -1
  28. package/dist/cache/CryptoKeyStore.js +26 -36
  29. package/dist/cache/CryptoKeyStore.js.map +1 -1
  30. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  31. package/dist/cache/DatabaseStorage.js +127 -191
  32. package/dist/cache/DatabaseStorage.js.map +1 -1
  33. package/dist/cache/ITokenCache.d.ts.map +1 -1
  34. package/dist/cache/MemoryStorage.d.ts.map +1 -1
  35. package/dist/cache/MemoryStorage.js +18 -19
  36. package/dist/cache/MemoryStorage.js.map +1 -1
  37. package/dist/cache/TokenCache.d.ts +1 -1
  38. package/dist/cache/TokenCache.d.ts.map +1 -1
  39. package/dist/cache/TokenCache.js +55 -49
  40. package/dist/cache/TokenCache.js.map +1 -1
  41. package/dist/config/Configuration.d.ts +8 -8
  42. package/dist/config/Configuration.d.ts.map +1 -1
  43. package/dist/config/Configuration.js +53 -31
  44. package/dist/config/Configuration.js.map +1 -1
  45. package/dist/controllers/ControllerFactory.d.ts +10 -0
  46. package/dist/controllers/ControllerFactory.d.ts.map +1 -0
  47. package/dist/controllers/ControllerFactory.js +47 -0
  48. package/dist/controllers/ControllerFactory.js.map +1 -0
  49. package/dist/controllers/IController.d.ts +67 -0
  50. package/dist/controllers/IController.d.ts.map +1 -0
  51. package/dist/{app/ClientApplication.d.ts → controllers/StandardController.d.ts} +96 -15
  52. package/dist/controllers/StandardController.d.ts.map +1 -0
  53. package/dist/controllers/StandardController.js +1299 -0
  54. package/dist/controllers/StandardController.js.map +1 -0
  55. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  56. package/dist/crypto/BrowserCrypto.js +36 -60
  57. package/dist/crypto/BrowserCrypto.js.map +1 -1
  58. package/dist/crypto/CryptoOps.d.ts +1 -1
  59. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  60. package/dist/crypto/CryptoOps.js +93 -151
  61. package/dist/crypto/CryptoOps.js.map +1 -1
  62. package/dist/crypto/GuidGenerator.d.ts.map +1 -1
  63. package/dist/crypto/GuidGenerator.js +36 -25
  64. package/dist/crypto/GuidGenerator.js.map +1 -1
  65. package/dist/crypto/ISubtleCrypto.d.ts.map +1 -1
  66. package/dist/crypto/ModernBrowserCrypto.d.ts.map +1 -1
  67. package/dist/crypto/ModernBrowserCrypto.js +20 -44
  68. package/dist/crypto/ModernBrowserCrypto.js.map +1 -1
  69. package/dist/crypto/MsBrowserCrypto.d.ts.map +1 -1
  70. package/dist/crypto/MsBrowserCrypto.js +65 -89
  71. package/dist/crypto/MsBrowserCrypto.js.map +1 -1
  72. package/dist/crypto/MsrBrowserCrypto.d.ts.map +1 -1
  73. package/dist/crypto/MsrBrowserCrypto.js +23 -47
  74. package/dist/crypto/MsrBrowserCrypto.js.map +1 -1
  75. package/dist/crypto/PkceGenerator.d.ts.map +1 -1
  76. package/dist/crypto/PkceGenerator.js +28 -49
  77. package/dist/crypto/PkceGenerator.js.map +1 -1
  78. package/dist/crypto/SignedHttpRequest.d.ts +1 -1
  79. package/dist/crypto/SignedHttpRequest.d.ts.map +1 -1
  80. package/dist/crypto/SignedHttpRequest.js +15 -37
  81. package/dist/crypto/SignedHttpRequest.js.map +1 -1
  82. package/dist/encode/Base64Decode.d.ts.map +1 -1
  83. package/dist/encode/Base64Decode.js +32 -33
  84. package/dist/encode/Base64Decode.js.map +1 -1
  85. package/dist/encode/Base64Encode.d.ts.map +1 -1
  86. package/dist/encode/Base64Encode.js +34 -35
  87. package/dist/encode/Base64Encode.js.map +1 -1
  88. package/dist/error/BrowserAuthError.d.ts +1 -1
  89. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  90. package/dist/error/BrowserAuthError.js +161 -163
  91. package/dist/error/BrowserAuthError.js.map +1 -1
  92. package/dist/error/BrowserConfigurationAuthError.d.ts.map +1 -1
  93. package/dist/error/BrowserConfigurationAuthError.js +32 -36
  94. package/dist/error/BrowserConfigurationAuthError.js.map +1 -1
  95. package/dist/error/NativeAuthError.d.ts +1 -1
  96. package/dist/error/NativeAuthError.d.ts.map +1 -1
  97. package/dist/error/NativeAuthError.js +26 -27
  98. package/dist/error/NativeAuthError.js.map +1 -1
  99. package/dist/event/EventHandler.d.ts.map +1 -1
  100. package/dist/event/EventHandler.js +33 -33
  101. package/dist/event/EventHandler.js.map +1 -1
  102. package/dist/event/EventMessage.d.ts +5 -5
  103. package/dist/event/EventMessage.d.ts.map +1 -1
  104. package/dist/event/EventMessage.js +18 -14
  105. package/dist/event/EventMessage.js.map +1 -1
  106. package/dist/event/EventType.js +1 -1
  107. package/dist/event/EventType.js.map +1 -1
  108. package/dist/index.d.ts +8 -8
  109. package/dist/index.d.ts.map +1 -1
  110. package/dist/index.js +1 -1
  111. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  112. package/dist/interaction_client/BaseInteractionClient.js +92 -123
  113. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  114. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts.map +1 -1
  115. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +6 -10
  116. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -1
  117. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
  118. package/dist/interaction_client/NativeInteractionClient.js +336 -393
  119. package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
  120. package/dist/interaction_client/PopupClient.d.ts +1 -1
  121. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  122. package/dist/interaction_client/PopupClient.js +224 -246
  123. package/dist/interaction_client/PopupClient.js.map +1 -1
  124. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  125. package/dist/interaction_client/RedirectClient.js +244 -292
  126. package/dist/interaction_client/RedirectClient.js.map +1 -1
  127. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  128. package/dist/interaction_client/SilentAuthCodeClient.js +50 -63
  129. package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
  130. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  131. package/dist/interaction_client/SilentCacheClient.js +50 -81
  132. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  133. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  134. package/dist/interaction_client/SilentIframeClient.js +107 -125
  135. package/dist/interaction_client/SilentIframeClient.js.map +1 -1
  136. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  137. package/dist/interaction_client/SilentRefreshClient.js +44 -72
  138. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  139. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  140. package/dist/interaction_client/StandardInteractionClient.js +144 -180
  141. package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
  142. package/dist/interaction_handler/InteractionHandler.d.ts +1 -1
  143. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  144. package/dist/interaction_handler/InteractionHandler.js +84 -110
  145. package/dist/interaction_handler/InteractionHandler.js.map +1 -1
  146. package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
  147. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  148. package/dist/interaction_handler/RedirectHandler.js +105 -122
  149. package/dist/interaction_handler/RedirectHandler.js.map +1 -1
  150. package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
  151. package/dist/interaction_handler/SilentHandler.js +76 -65
  152. package/dist/interaction_handler/SilentHandler.js.map +1 -1
  153. package/dist/internals.js +1 -1
  154. package/dist/internals.js.map +1 -1
  155. package/dist/navigation/NavigationClient.d.ts.map +1 -1
  156. package/dist/navigation/NavigationClient.js +11 -14
  157. package/dist/navigation/NavigationClient.js.map +1 -1
  158. package/dist/navigation/NavigationOptions.d.ts +1 -1
  159. package/dist/navigation/NavigationOptions.d.ts.map +1 -1
  160. package/dist/network/FetchClient.d.ts.map +1 -1
  161. package/dist/network/FetchClient.js +66 -96
  162. package/dist/network/FetchClient.js.map +1 -1
  163. package/dist/network/XhrClient.d.ts.map +1 -1
  164. package/dist/network/XhrClient.js +38 -51
  165. package/dist/network/XhrClient.js.map +1 -1
  166. package/dist/operatingcontext/BaseOperatingContext.d.ts +41 -0
  167. package/dist/operatingcontext/BaseOperatingContext.d.ts.map +1 -0
  168. package/dist/operatingcontext/BaseOperatingContext.js +53 -0
  169. package/dist/operatingcontext/BaseOperatingContext.js.map +1 -0
  170. package/dist/operatingcontext/StandardOperatingContext.d.ts +26 -0
  171. package/dist/operatingcontext/StandardOperatingContext.d.ts.map +1 -0
  172. package/dist/operatingcontext/StandardOperatingContext.js +50 -0
  173. package/dist/operatingcontext/StandardOperatingContext.js.map +1 -0
  174. package/dist/operatingcontext/TeamsAppOperatingContext.d.ts +26 -0
  175. package/dist/operatingcontext/TeamsAppOperatingContext.d.ts.map +1 -0
  176. package/dist/operatingcontext/TeamsAppOperatingContext.js +49 -0
  177. package/dist/operatingcontext/TeamsAppOperatingContext.js.map +1 -0
  178. package/dist/packageMetadata.d.ts +1 -1
  179. package/dist/packageMetadata.d.ts.map +1 -1
  180. package/dist/packageMetadata.js +3 -3
  181. package/dist/packageMetadata.js.map +1 -1
  182. package/dist/request/AuthorizationCodeRequest.d.ts +1 -1
  183. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
  184. package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
  185. package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
  186. package/dist/request/EndSessionPopupRequest.d.ts +1 -1
  187. package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
  188. package/dist/request/EndSessionRequest.d.ts +1 -1
  189. package/dist/request/EndSessionRequest.d.ts.map +1 -1
  190. package/dist/request/PopupRequest.d.ts +1 -1
  191. package/dist/request/PopupRequest.d.ts.map +1 -1
  192. package/dist/request/PopupWindowAttributes.d.ts +3 -3
  193. package/dist/request/PopupWindowAttributes.d.ts.map +1 -1
  194. package/dist/request/RedirectRequest.d.ts +1 -1
  195. package/dist/request/RedirectRequest.d.ts.map +1 -1
  196. package/dist/request/SilentRequest.d.ts +1 -1
  197. package/dist/request/SilentRequest.d.ts.map +1 -1
  198. package/dist/request/SsoSilentRequest.d.ts +1 -1
  199. package/dist/request/SsoSilentRequest.d.ts.map +1 -1
  200. package/dist/telemetry/BrowserPerformanceClient.d.ts +1 -1
  201. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  202. package/dist/telemetry/BrowserPerformanceClient.js +62 -57
  203. package/dist/telemetry/BrowserPerformanceClient.js.map +1 -1
  204. package/dist/telemetry/BrowserPerformanceMeasurement.d.ts.map +1 -1
  205. package/dist/telemetry/BrowserPerformanceMeasurement.js +30 -31
  206. package/dist/telemetry/BrowserPerformanceMeasurement.js.map +1 -1
  207. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  208. package/dist/utils/BrowserConstants.js +10 -10
  209. package/dist/utils/BrowserConstants.js.map +1 -1
  210. package/dist/utils/BrowserProtocolUtils.d.ts +1 -1
  211. package/dist/utils/BrowserProtocolUtils.d.ts.map +1 -1
  212. package/dist/utils/BrowserProtocolUtils.js +9 -12
  213. package/dist/utils/BrowserProtocolUtils.js.map +1 -1
  214. package/dist/utils/BrowserStringUtils.d.ts.map +1 -1
  215. package/dist/utils/BrowserStringUtils.js +83 -49
  216. package/dist/utils/BrowserStringUtils.js.map +1 -1
  217. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  218. package/dist/utils/BrowserUtils.js +51 -49
  219. package/dist/utils/BrowserUtils.js.map +1 -1
  220. package/dist/utils/MathUtils.d.ts.map +1 -1
  221. package/dist/utils/MathUtils.js +6 -9
  222. package/dist/utils/MathUtils.js.map +1 -1
  223. package/node_modules/@azure/msal-common/LICENSE +21 -0
  224. package/node_modules/@azure/msal-common/README.md +62 -0
  225. package/node_modules/@azure/msal-common/dist/account/AccountInfo.d.ts +32 -0
  226. package/node_modules/@azure/msal-common/dist/account/AccountInfo.d.ts.map +1 -0
  227. package/node_modules/@azure/msal-common/dist/account/AuthToken.d.ts +21 -0
  228. package/node_modules/@azure/msal-common/dist/account/AuthToken.d.ts.map +1 -0
  229. package/node_modules/@azure/msal-common/dist/account/AuthToken.js +56 -0
  230. package/node_modules/@azure/msal-common/dist/account/AuthToken.js.map +1 -0
  231. package/node_modules/@azure/msal-common/dist/account/CcsCredential.d.ts +9 -0
  232. package/node_modules/@azure/msal-common/dist/account/CcsCredential.d.ts.map +1 -0
  233. package/node_modules/@azure/msal-common/dist/account/CcsCredential.js +14 -0
  234. package/node_modules/@azure/msal-common/dist/account/CcsCredential.js.map +1 -0
  235. package/node_modules/@azure/msal-common/dist/account/ClientCredentials.d.ts +15 -0
  236. package/node_modules/@azure/msal-common/dist/account/ClientCredentials.d.ts.map +1 -0
  237. package/node_modules/@azure/msal-common/dist/account/ClientInfo.d.ts +20 -0
  238. package/node_modules/@azure/msal-common/dist/account/ClientInfo.d.ts.map +1 -0
  239. package/node_modules/@azure/msal-common/dist/account/ClientInfo.js +46 -0
  240. package/node_modules/@azure/msal-common/dist/account/ClientInfo.js.map +1 -0
  241. package/node_modules/@azure/msal-common/dist/account/DecodedAuthToken.d.ts +9 -0
  242. package/node_modules/@azure/msal-common/dist/account/DecodedAuthToken.d.ts.map +1 -0
  243. package/node_modules/@azure/msal-common/dist/account/TokenClaims.d.ts +66 -0
  244. package/node_modules/@azure/msal-common/dist/account/TokenClaims.d.ts.map +1 -0
  245. package/node_modules/@azure/msal-common/dist/authority/Authority.d.ts +216 -0
  246. package/node_modules/@azure/msal-common/dist/authority/Authority.d.ts.map +1 -0
  247. package/node_modules/@azure/msal-common/dist/authority/Authority.js +688 -0
  248. package/node_modules/@azure/msal-common/dist/authority/Authority.js.map +1 -0
  249. package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.d.ts +31 -0
  250. package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.d.ts.map +1 -0
  251. package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.js +58 -0
  252. package/node_modules/@azure/msal-common/dist/authority/AuthorityFactory.js.map +1 -0
  253. package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.d.ts +623 -0
  254. package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.d.ts.map +1 -0
  255. package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.js +881 -0
  256. package/node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.js.map +1 -0
  257. package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.d.ts +19 -0
  258. package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.d.ts.map +1 -0
  259. package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.js +24 -0
  260. package/node_modules/@azure/msal-common/dist/authority/AuthorityOptions.js.map +1 -0
  261. package/node_modules/@azure/msal-common/dist/authority/AuthorityType.d.ts +10 -0
  262. package/node_modules/@azure/msal-common/dist/authority/AuthorityType.d.ts.map +1 -0
  263. package/node_modules/@azure/msal-common/dist/authority/AuthorityType.js +19 -0
  264. package/node_modules/@azure/msal-common/dist/authority/AuthorityType.js.map +1 -0
  265. package/node_modules/@azure/msal-common/dist/authority/AzureRegion.d.ts +2 -0
  266. package/node_modules/@azure/msal-common/dist/authority/AzureRegion.d.ts.map +1 -0
  267. package/node_modules/@azure/msal-common/dist/authority/AzureRegionConfiguration.d.ts +6 -0
  268. package/node_modules/@azure/msal-common/dist/authority/AzureRegionConfiguration.d.ts.map +1 -0
  269. package/node_modules/@azure/msal-common/dist/authority/CloudDiscoveryMetadata.d.ts +6 -0
  270. package/node_modules/@azure/msal-common/dist/authority/CloudDiscoveryMetadata.d.ts.map +1 -0
  271. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +14 -0
  272. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts.map +1 -0
  273. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.js +13 -0
  274. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.js.map +1 -0
  275. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.d.ts +10 -0
  276. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.d.ts.map +1 -0
  277. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.js +13 -0
  278. package/node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -0
  279. package/node_modules/@azure/msal-common/dist/authority/ImdsOptions.d.ts +6 -0
  280. package/node_modules/@azure/msal-common/dist/authority/ImdsOptions.d.ts.map +1 -0
  281. package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.d.ts +12 -0
  282. package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.d.ts.map +1 -0
  283. package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.js +15 -0
  284. package/node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.js.map +1 -0
  285. package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.d.ts +8 -0
  286. package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.d.ts.map +1 -0
  287. package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.js +17 -0
  288. package/node_modules/@azure/msal-common/dist/authority/ProtocolMode.js.map +1 -0
  289. package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.d.ts +31 -0
  290. package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.d.ts.map +1 -0
  291. package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.js +116 -0
  292. package/node_modules/@azure/msal-common/dist/authority/RegionDiscovery.js.map +1 -0
  293. package/node_modules/@azure/msal-common/dist/authority/RegionDiscoveryMetadata.d.ts +7 -0
  294. package/node_modules/@azure/msal-common/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -0
  295. package/node_modules/@azure/msal-common/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +16 -0
  296. package/node_modules/@azure/msal-common/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -0
  297. package/node_modules/@azure/msal-common/dist/cache/CacheManager.d.ts +444 -0
  298. package/node_modules/@azure/msal-common/dist/cache/CacheManager.d.ts.map +1 -0
  299. package/node_modules/@azure/msal-common/dist/cache/CacheManager.js +1024 -0
  300. package/node_modules/@azure/msal-common/dist/cache/CacheManager.js.map +1 -0
  301. package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.d.ts +57 -0
  302. package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -0
  303. package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.js +123 -0
  304. package/node_modules/@azure/msal-common/dist/cache/entities/AccessTokenEntity.js.map +1 -0
  305. package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.d.ts +100 -0
  306. package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.d.ts.map +1 -0
  307. package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.js +259 -0
  308. package/node_modules/@azure/msal-common/dist/cache/entities/AccountEntity.js.map +1 -0
  309. package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.d.ts +40 -0
  310. package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.d.ts.map +1 -0
  311. package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.js +73 -0
  312. package/node_modules/@azure/msal-common/dist/cache/entities/AppMetadataEntity.js.map +1 -0
  313. package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.d.ts +48 -0
  314. package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -0
  315. package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.js +85 -0
  316. package/node_modules/@azure/msal-common/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -0
  317. package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.d.ts +14 -0
  318. package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.d.ts.map +1 -0
  319. package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.js +18 -0
  320. package/node_modules/@azure/msal-common/dist/cache/entities/CacheRecord.js.map +1 -0
  321. package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.d.ts +89 -0
  322. package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.d.ts.map +1 -0
  323. package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.js +144 -0
  324. package/node_modules/@azure/msal-common/dist/cache/entities/CredentialEntity.js.map +1 -0
  325. package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.d.ts +35 -0
  326. package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.d.ts.map +1 -0
  327. package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.js +64 -0
  328. package/node_modules/@azure/msal-common/dist/cache/entities/IdTokenEntity.js.map +1 -0
  329. package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.d.ts +37 -0
  330. package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.d.ts.map +1 -0
  331. package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.js +67 -0
  332. package/node_modules/@azure/msal-common/dist/cache/entities/RefreshTokenEntity.js.map +1 -0
  333. package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.d.ts +13 -0
  334. package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.d.ts.map +1 -0
  335. package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.js +34 -0
  336. package/node_modules/@azure/msal-common/dist/cache/entities/ServerTelemetryEntity.js.map +1 -0
  337. package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.d.ts +14 -0
  338. package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.d.ts.map +1 -0
  339. package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.js +30 -0
  340. package/node_modules/@azure/msal-common/dist/cache/entities/ThrottlingEntity.js.map +1 -0
  341. package/node_modules/@azure/msal-common/dist/cache/interface/ICacheManager.d.ts +166 -0
  342. package/node_modules/@azure/msal-common/dist/cache/interface/ICacheManager.d.ts.map +1 -0
  343. package/node_modules/@azure/msal-common/dist/cache/interface/ICachePlugin.d.ts +6 -0
  344. package/node_modules/@azure/msal-common/dist/cache/interface/ICachePlugin.d.ts.map +1 -0
  345. package/node_modules/@azure/msal-common/dist/cache/interface/ISerializableTokenCache.d.ts +5 -0
  346. package/node_modules/@azure/msal-common/dist/cache/interface/ISerializableTokenCache.d.ts.map +1 -0
  347. package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.d.ts +24 -0
  348. package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.d.ts.map +1 -0
  349. package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.js +30 -0
  350. package/node_modules/@azure/msal-common/dist/cache/persistence/TokenCacheContext.js.map +1 -0
  351. package/node_modules/@azure/msal-common/dist/cache/utils/CacheTypes.d.ts +63 -0
  352. package/node_modules/@azure/msal-common/dist/cache/utils/CacheTypes.d.ts.map +1 -0
  353. package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.d.ts +72 -0
  354. package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.d.ts.map +1 -0
  355. package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.js +453 -0
  356. package/node_modules/@azure/msal-common/dist/client/AuthorizationCodeClient.js.map +1 -0
  357. package/node_modules/@azure/msal-common/dist/client/BaseClient.d.ts +51 -0
  358. package/node_modules/@azure/msal-common/dist/client/BaseClient.d.ts.map +1 -0
  359. package/node_modules/@azure/msal-common/dist/client/BaseClient.js +107 -0
  360. package/node_modules/@azure/msal-common/dist/client/BaseClient.js.map +1 -0
  361. package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.d.ts +35 -0
  362. package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.d.ts.map +1 -0
  363. package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.js +260 -0
  364. package/node_modules/@azure/msal-common/dist/client/RefreshTokenClient.js.map +1 -0
  365. package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.d.ts +25 -0
  366. package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.d.ts.map +1 -0
  367. package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.js +108 -0
  368. package/node_modules/@azure/msal-common/dist/client/SilentFlowClient.js.map +1 -0
  369. package/node_modules/@azure/msal-common/dist/config/AppTokenProvider.d.ts +39 -0
  370. package/node_modules/@azure/msal-common/dist/config/AppTokenProvider.d.ts.map +1 -0
  371. package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.d.ts +134 -0
  372. package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.d.ts.map +1 -0
  373. package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.js +101 -0
  374. package/node_modules/@azure/msal-common/dist/config/ClientConfiguration.js.map +1 -0
  375. package/node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts +63 -0
  376. package/node_modules/@azure/msal-common/dist/crypto/ICrypto.d.ts.map +1 -0
  377. package/node_modules/@azure/msal-common/dist/crypto/ICrypto.js +49 -0
  378. package/node_modules/@azure/msal-common/dist/crypto/ICrypto.js.map +1 -0
  379. package/node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts +5 -0
  380. package/node_modules/@azure/msal-common/dist/crypto/IGuidGenerator.d.ts.map +1 -0
  381. package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts +22 -0
  382. package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.d.ts.map +1 -0
  383. package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.js +44 -0
  384. package/node_modules/@azure/msal-common/dist/crypto/JoseHeader.js.map +1 -0
  385. package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts +58 -0
  386. package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.d.ts.map +1 -0
  387. package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.js +92 -0
  388. package/node_modules/@azure/msal-common/dist/crypto/PopTokenGenerator.js.map +1 -0
  389. package/node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts +12 -0
  390. package/node_modules/@azure/msal-common/dist/crypto/SignedHttpRequest.d.ts.map +1 -0
  391. package/node_modules/@azure/msal-common/dist/error/AuthError.d.ts +48 -0
  392. package/node_modules/@azure/msal-common/dist/error/AuthError.d.ts.map +1 -0
  393. package/node_modules/@azure/msal-common/dist/error/AuthError.js +58 -0
  394. package/node_modules/@azure/msal-common/dist/error/AuthError.js.map +1 -0
  395. package/node_modules/@azure/msal-common/dist/error/ClientAuthError.d.ts +413 -0
  396. package/node_modules/@azure/msal-common/dist/error/ClientAuthError.d.ts.map +1 -0
  397. package/node_modules/@azure/msal-common/dist/error/ClientAuthError.js +526 -0
  398. package/node_modules/@azure/msal-common/dist/error/ClientAuthError.js.map +1 -0
  399. package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.d.ts +199 -0
  400. package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.d.ts.map +1 -0
  401. package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.js +256 -0
  402. package/node_modules/@azure/msal-common/dist/error/ClientConfigurationError.js.map +1 -0
  403. package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.d.ts +60 -0
  404. package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.d.ts.map +1 -0
  405. package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.js +86 -0
  406. package/node_modules/@azure/msal-common/dist/error/InteractionRequiredAuthError.js.map +1 -0
  407. package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.d.ts +29 -0
  408. package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.d.ts.map +1 -0
  409. package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.js +46 -0
  410. package/node_modules/@azure/msal-common/dist/error/JoseHeaderError.js.map +1 -0
  411. package/node_modules/@azure/msal-common/dist/error/ServerError.d.ts +8 -0
  412. package/node_modules/@azure/msal-common/dist/error/ServerError.d.ts.map +1 -0
  413. package/node_modules/@azure/msal-common/dist/error/ServerError.js +21 -0
  414. package/node_modules/@azure/msal-common/dist/error/ServerError.js.map +1 -0
  415. package/node_modules/@azure/msal-common/dist/index.cjs.js +8975 -0
  416. package/node_modules/@azure/msal-common/dist/index.cjs.js.map +1 -0
  417. package/node_modules/@azure/msal-common/dist/index.d.ts +94 -0
  418. package/node_modules/@azure/msal-common/dist/index.d.ts.map +1 -0
  419. package/node_modules/@azure/msal-common/dist/index.js +54 -0
  420. package/node_modules/@azure/msal-common/dist/index.js.map +1 -0
  421. package/node_modules/@azure/msal-common/dist/logger/Logger.d.ts +96 -0
  422. package/node_modules/@azure/msal-common/dist/logger/Logger.d.ts.map +1 -0
  423. package/node_modules/@azure/msal-common/dist/logger/Logger.js +205 -0
  424. package/node_modules/@azure/msal-common/dist/logger/Logger.js.map +1 -0
  425. package/node_modules/@azure/msal-common/dist/network/INetworkModule.d.ts +30 -0
  426. package/node_modules/@azure/msal-common/dist/network/INetworkModule.d.ts.map +1 -0
  427. package/node_modules/@azure/msal-common/dist/network/INetworkModule.js +21 -0
  428. package/node_modules/@azure/msal-common/dist/network/INetworkModule.js.map +1 -0
  429. package/node_modules/@azure/msal-common/dist/network/NetworkManager.d.ts +33 -0
  430. package/node_modules/@azure/msal-common/dist/network/NetworkManager.d.ts.map +1 -0
  431. package/node_modules/@azure/msal-common/dist/network/NetworkManager.js +42 -0
  432. package/node_modules/@azure/msal-common/dist/network/NetworkManager.js.map +1 -0
  433. package/node_modules/@azure/msal-common/dist/network/RequestThumbprint.d.ts +17 -0
  434. package/node_modules/@azure/msal-common/dist/network/RequestThumbprint.d.ts.map +1 -0
  435. package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.d.ts +42 -0
  436. package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.d.ts.map +1 -0
  437. package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.js +102 -0
  438. package/node_modules/@azure/msal-common/dist/network/ThrottlingUtils.js.map +1 -0
  439. package/node_modules/@azure/msal-common/dist/packageMetadata.d.ts +3 -0
  440. package/node_modules/@azure/msal-common/dist/packageMetadata.d.ts.map +1 -0
  441. package/node_modules/@azure/msal-common/dist/packageMetadata.js +8 -0
  442. package/node_modules/@azure/msal-common/dist/packageMetadata.js.map +1 -0
  443. package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.d.ts +20 -0
  444. package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
  445. package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.js +63 -0
  446. package/node_modules/@azure/msal-common/dist/request/AuthenticationHeaderParser.js.map +1 -0
  447. package/node_modules/@azure/msal-common/dist/request/BaseAuthRequest.d.ts +38 -0
  448. package/node_modules/@azure/msal-common/dist/request/BaseAuthRequest.d.ts.map +1 -0
  449. package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationCodeRequest.d.ts +28 -0
  450. package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -0
  451. package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationUrlRequest.d.ts +51 -0
  452. package/node_modules/@azure/msal-common/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -0
  453. package/node_modules/@azure/msal-common/dist/request/CommonClientCredentialRequest.d.ts +18 -0
  454. package/node_modules/@azure/msal-common/dist/request/CommonClientCredentialRequest.d.ts.map +1 -0
  455. package/node_modules/@azure/msal-common/dist/request/CommonDeviceCodeRequest.d.ts +22 -0
  456. package/node_modules/@azure/msal-common/dist/request/CommonDeviceCodeRequest.d.ts.map +1 -0
  457. package/node_modules/@azure/msal-common/dist/request/CommonEndSessionRequest.d.ts +22 -0
  458. package/node_modules/@azure/msal-common/dist/request/CommonEndSessionRequest.d.ts.map +1 -0
  459. package/node_modules/@azure/msal-common/dist/request/CommonOnBehalfOfRequest.d.ts +14 -0
  460. package/node_modules/@azure/msal-common/dist/request/CommonOnBehalfOfRequest.d.ts.map +1 -0
  461. package/node_modules/@azure/msal-common/dist/request/CommonRefreshTokenRequest.d.ts +20 -0
  462. package/node_modules/@azure/msal-common/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -0
  463. package/node_modules/@azure/msal-common/dist/request/CommonSilentFlowRequest.d.ts +19 -0
  464. package/node_modules/@azure/msal-common/dist/request/CommonSilentFlowRequest.d.ts.map +1 -0
  465. package/node_modules/@azure/msal-common/dist/request/CommonUsernamePasswordRequest.d.ts +18 -0
  466. package/node_modules/@azure/msal-common/dist/request/CommonUsernamePasswordRequest.d.ts.map +1 -0
  467. package/node_modules/@azure/msal-common/dist/request/NativeRequest.d.ts +20 -0
  468. package/node_modules/@azure/msal-common/dist/request/NativeRequest.d.ts.map +1 -0
  469. package/node_modules/@azure/msal-common/dist/request/NativeSignOutRequest.d.ts +6 -0
  470. package/node_modules/@azure/msal-common/dist/request/NativeSignOutRequest.d.ts.map +1 -0
  471. package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.d.ts +217 -0
  472. package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.d.ts.map +1 -0
  473. package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.js +385 -0
  474. package/node_modules/@azure/msal-common/dist/request/RequestParameterBuilder.js.map +1 -0
  475. package/node_modules/@azure/msal-common/dist/request/RequestValidator.d.ts +34 -0
  476. package/node_modules/@azure/msal-common/dist/request/RequestValidator.d.ts.map +1 -0
  477. package/node_modules/@azure/msal-common/dist/request/RequestValidator.js +92 -0
  478. package/node_modules/@azure/msal-common/dist/request/RequestValidator.js.map +1 -0
  479. package/node_modules/@azure/msal-common/dist/request/ScopeSet.d.ts +89 -0
  480. package/node_modules/@azure/msal-common/dist/request/ScopeSet.d.ts.map +1 -0
  481. package/node_modules/@azure/msal-common/dist/request/ScopeSet.js +207 -0
  482. package/node_modules/@azure/msal-common/dist/request/ScopeSet.js.map +1 -0
  483. package/node_modules/@azure/msal-common/dist/response/AuthenticationResult.d.ts +40 -0
  484. package/node_modules/@azure/msal-common/dist/response/AuthenticationResult.d.ts.map +1 -0
  485. package/node_modules/@azure/msal-common/dist/response/AuthorizationCodePayload.d.ts +14 -0
  486. package/node_modules/@azure/msal-common/dist/response/AuthorizationCodePayload.d.ts.map +1 -0
  487. package/node_modules/@azure/msal-common/dist/response/DeviceCodeResponse.d.ts +26 -0
  488. package/node_modules/@azure/msal-common/dist/response/DeviceCodeResponse.d.ts.map +1 -0
  489. package/node_modules/@azure/msal-common/dist/response/ExternalTokenResponse.d.ts +16 -0
  490. package/node_modules/@azure/msal-common/dist/response/ExternalTokenResponse.d.ts.map +1 -0
  491. package/node_modules/@azure/msal-common/dist/response/IMDSBadResponse.d.ts +5 -0
  492. package/node_modules/@azure/msal-common/dist/response/IMDSBadResponse.d.ts.map +1 -0
  493. package/node_modules/@azure/msal-common/dist/response/ResponseHandler.d.ts +73 -0
  494. package/node_modules/@azure/msal-common/dist/response/ResponseHandler.d.ts.map +1 -0
  495. package/node_modules/@azure/msal-common/dist/response/ResponseHandler.js +325 -0
  496. package/node_modules/@azure/msal-common/dist/response/ResponseHandler.js.map +1 -0
  497. package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationCodeResponse.d.ts +26 -0
  498. package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationCodeResponse.d.ts.map +1 -0
  499. package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationTokenResponse.d.ts +45 -0
  500. package/node_modules/@azure/msal-common/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -0
  501. package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceClient.d.ts +43 -0
  502. package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -0
  503. package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceMeasurement.d.ts +6 -0
  504. package/node_modules/@azure/msal-common/dist/telemetry/performance/IPerformanceMeasurement.d.ts.map +1 -0
  505. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.d.ts +190 -0
  506. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -0
  507. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.js +413 -0
  508. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceClient.js.map +1 -0
  509. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.d.ts +440 -0
  510. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -0
  511. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.js +232 -0
  512. package/node_modules/@azure/msal-common/dist/telemetry/performance/PerformanceEvent.js.map +1 -0
  513. package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.d.ts +20 -0
  514. package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -0
  515. package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.js +43 -0
  516. package/node_modules/@azure/msal-common/dist/telemetry/performance/StubPerformanceClient.js.map +1 -0
  517. package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.d.ts +66 -0
  518. package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -0
  519. package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.js +206 -0
  520. package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryManager.js.map +1 -0
  521. package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryRequest.d.ts +9 -0
  522. package/node_modules/@azure/msal-common/dist/telemetry/server/ServerTelemetryRequest.d.ts.map +1 -0
  523. package/node_modules/@azure/msal-common/dist/url/IUri.d.ts +13 -0
  524. package/node_modules/@azure/msal-common/dist/url/IUri.d.ts.map +1 -0
  525. package/node_modules/@azure/msal-common/dist/url/UrlString.d.ts +71 -0
  526. package/node_modules/@azure/msal-common/dist/url/UrlString.d.ts.map +1 -0
  527. package/node_modules/@azure/msal-common/dist/url/UrlString.js +252 -0
  528. package/node_modules/@azure/msal-common/dist/url/UrlString.js.map +1 -0
  529. package/node_modules/@azure/msal-common/dist/utils/Constants.d.ts +332 -0
  530. package/node_modules/@azure/msal-common/dist/utils/Constants.d.ts.map +1 -0
  531. package/node_modules/@azure/msal-common/dist/utils/Constants.js +378 -0
  532. package/node_modules/@azure/msal-common/dist/utils/Constants.js.map +1 -0
  533. package/node_modules/@azure/msal-common/dist/utils/MsalTypes.d.ts +7 -0
  534. package/node_modules/@azure/msal-common/dist/utils/MsalTypes.d.ts.map +1 -0
  535. package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.d.ts +43 -0
  536. package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.d.ts.map +1 -0
  537. package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.js +80 -0
  538. package/node_modules/@azure/msal-common/dist/utils/ProtocolUtils.js.map +1 -0
  539. package/node_modules/@azure/msal-common/dist/utils/StringUtils.d.ts +54 -0
  540. package/node_modules/@azure/msal-common/dist/utils/StringUtils.d.ts.map +1 -0
  541. package/node_modules/@azure/msal-common/dist/utils/StringUtils.js +131 -0
  542. package/node_modules/@azure/msal-common/dist/utils/StringUtils.js.map +1 -0
  543. package/node_modules/@azure/msal-common/dist/utils/TimeUtils.d.ts +28 -0
  544. package/node_modules/@azure/msal-common/dist/utils/TimeUtils.d.ts.map +1 -0
  545. package/node_modules/@azure/msal-common/dist/utils/TimeUtils.js +50 -0
  546. package/node_modules/@azure/msal-common/dist/utils/TimeUtils.js.map +1 -0
  547. package/node_modules/@azure/msal-common/package.json +79 -0
  548. package/package.json +99 -95
  549. package/dist/_virtual/_tslib.js +0 -117
  550. package/dist/_virtual/_tslib.js.map +0 -1
  551. package/dist/app/ClientApplication.d.ts.map +0 -1
  552. package/dist/app/ClientApplication.js +0 -1053
  553. package/dist/app/ClientApplication.js.map +0 -1
  554. package/dist/index.cjs.js +0 -18045
  555. package/dist/index.cjs.js.map +0 -1
  556. package/lib/msal-browser.js +0 -18051
  557. package/lib/msal-browser.js.map +0 -1
  558. package/lib/msal-browser.min.js +0 -70
@@ -1,7 +1,6 @@
1
- /*! @azure/msal-browser v2.36.0 2023-04-18 */
1
+ /*! @azure/msal-browser v3.0.0-alpha.0 2023-05-03 */
2
2
  'use strict';
3
- import { __extends, __awaiter, __generator, __spread } from '../_virtual/_tslib.js';
4
- import { CredentialType, RefreshTokenEntity, CacheManager, AccessTokenEntity, IdTokenEntity, AccountEntity, ClientAuthError, AppMetadataEntity, ServerTelemetryEntity, AuthorityMetadataEntity, Constants, PersistentCacheKeys, ThrottlingEntity, StringUtils, ProtocolUtils, CcsCredentialType, IdToken, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common';
3
+ import { CacheManager, CredentialType, RefreshTokenEntity, AccessTokenEntity, IdTokenEntity, AccountEntity, ClientAuthError, AppMetadataEntity, ServerTelemetryEntity, AuthorityMetadataEntity, Constants, PersistentCacheKeys, ThrottlingEntity, StringUtils, ProtocolUtils, IdToken, CcsCredentialType, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common';
5
4
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
6
5
  import { BrowserCacheLocation, StaticCacheKeys, InMemoryCacheKeys, TemporaryCacheKeys } from '../utils/BrowserConstants.js';
7
6
  import { BrowserStorage } from './BrowserStorage.js';
@@ -17,29 +16,27 @@ import { BrowserProtocolUtils } from '../utils/BrowserProtocolUtils.js';
17
16
  * Cookies are only used if storeAuthStateInCookie is true, and are only used for
18
17
  * parameters such as state and nonce, generally.
19
18
  */
20
- var BrowserCacheManager = /** @class */ (function (_super) {
21
- __extends(BrowserCacheManager, _super);
22
- function BrowserCacheManager(clientId, cacheConfig, cryptoImpl, logger) {
23
- var _this = _super.call(this, clientId, cryptoImpl, logger) || this;
19
+ class BrowserCacheManager extends CacheManager {
20
+ constructor(clientId, cacheConfig, cryptoImpl, logger) {
21
+ super(clientId, cryptoImpl, logger);
24
22
  // Cookie life calculation (hours * minutes * seconds * ms)
25
- _this.COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
26
- _this.cacheConfig = cacheConfig;
27
- _this.logger = logger;
28
- _this.internalStorage = new MemoryStorage();
29
- _this.browserStorage = _this.setupBrowserStorage(_this.cacheConfig.cacheLocation);
30
- _this.temporaryCacheStorage = _this.setupTemporaryCacheStorage(_this.cacheConfig.temporaryCacheLocation, _this.cacheConfig.cacheLocation);
23
+ this.COOKIE_LIFE_MULTIPLIER = 24 * 60 * 60 * 1000;
24
+ this.cacheConfig = cacheConfig;
25
+ this.logger = logger;
26
+ this.internalStorage = new MemoryStorage();
27
+ this.browserStorage = this.setupBrowserStorage(this.cacheConfig.cacheLocation);
28
+ this.temporaryCacheStorage = this.setupTemporaryCacheStorage(this.cacheConfig.temporaryCacheLocation, this.cacheConfig.cacheLocation);
31
29
  // Migrate cache entries from older versions of MSAL.
32
30
  if (cacheConfig.cacheMigrationEnabled) {
33
- _this.migrateCacheEntries();
34
- _this.createKeyMaps();
31
+ this.migrateCacheEntries();
32
+ this.createKeyMaps();
35
33
  }
36
- return _this;
37
34
  }
38
35
  /**
39
36
  * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured cacheLocation.
40
37
  * @param cacheLocation
41
38
  */
42
- BrowserCacheManager.prototype.setupBrowserStorage = function (cacheLocation) {
39
+ setupBrowserStorage(cacheLocation) {
43
40
  switch (cacheLocation) {
44
41
  case BrowserCacheLocation.LocalStorage:
45
42
  case BrowserCacheLocation.SessionStorage:
@@ -53,22 +50,20 @@ var BrowserCacheManager = /** @class */ (function (_super) {
53
50
  }
54
51
  this.cacheConfig.cacheLocation = BrowserCacheLocation.MemoryStorage;
55
52
  return new MemoryStorage();
56
- };
53
+ }
57
54
  /**
58
55
  * Returns a window storage class implementing the IWindowStorage interface that corresponds to the configured temporaryCacheLocation.
59
56
  * @param temporaryCacheLocation
60
57
  * @param cacheLocation
61
58
  */
62
- BrowserCacheManager.prototype.setupTemporaryCacheStorage = function (temporaryCacheLocation, cacheLocation) {
59
+ setupTemporaryCacheStorage(temporaryCacheLocation, cacheLocation) {
63
60
  switch (cacheLocation) {
64
61
  case BrowserCacheLocation.LocalStorage:
65
62
  case BrowserCacheLocation.SessionStorage:
66
63
  try {
67
- /*
68
- * When users do not explicitly choose their own temporaryCacheLocation,
69
- * temporary cache items will always be stored in session storage to mitigate problems caused by multiple tabs
70
- */
71
- return new BrowserStorage(temporaryCacheLocation || BrowserCacheLocation.SessionStorage);
64
+ // Temporary cache items will always be stored in session storage to mitigate problems caused by multiple tabs
65
+ return new BrowserStorage(temporaryCacheLocation ||
66
+ BrowserCacheLocation.SessionStorage);
72
67
  }
73
68
  catch (e) {
74
69
  this.logger.verbose(e);
@@ -78,101 +73,109 @@ var BrowserCacheManager = /** @class */ (function (_super) {
78
73
  default:
79
74
  return this.internalStorage;
80
75
  }
81
- };
76
+ }
82
77
  /**
83
78
  * Migrate all old cache entries to new schema. No rollback supported.
84
79
  * @param storeAuthStateInCookie
85
80
  */
86
- BrowserCacheManager.prototype.migrateCacheEntries = function () {
87
- var _this = this;
88
- var idTokenKey = Constants.CACHE_PREFIX + "." + PersistentCacheKeys.ID_TOKEN;
89
- var clientInfoKey = Constants.CACHE_PREFIX + "." + PersistentCacheKeys.CLIENT_INFO;
90
- var errorKey = Constants.CACHE_PREFIX + "." + PersistentCacheKeys.ERROR;
91
- var errorDescKey = Constants.CACHE_PREFIX + "." + PersistentCacheKeys.ERROR_DESC;
92
- var idTokenValue = this.browserStorage.getItem(idTokenKey);
93
- var clientInfoValue = this.browserStorage.getItem(clientInfoKey);
94
- var errorValue = this.browserStorage.getItem(errorKey);
95
- var errorDescValue = this.browserStorage.getItem(errorDescKey);
96
- var values = [idTokenValue, clientInfoValue, errorValue, errorDescValue];
97
- var keysToMigrate = [PersistentCacheKeys.ID_TOKEN, PersistentCacheKeys.CLIENT_INFO, PersistentCacheKeys.ERROR, PersistentCacheKeys.ERROR_DESC];
98
- keysToMigrate.forEach(function (cacheKey, index) { return _this.migrateCacheEntry(cacheKey, values[index]); });
99
- };
81
+ migrateCacheEntries() {
82
+ const idTokenKey = `${Constants.CACHE_PREFIX}.${PersistentCacheKeys.ID_TOKEN}`;
83
+ const clientInfoKey = `${Constants.CACHE_PREFIX}.${PersistentCacheKeys.CLIENT_INFO}`;
84
+ const errorKey = `${Constants.CACHE_PREFIX}.${PersistentCacheKeys.ERROR}`;
85
+ const errorDescKey = `${Constants.CACHE_PREFIX}.${PersistentCacheKeys.ERROR_DESC}`;
86
+ const idTokenValue = this.browserStorage.getItem(idTokenKey);
87
+ const clientInfoValue = this.browserStorage.getItem(clientInfoKey);
88
+ const errorValue = this.browserStorage.getItem(errorKey);
89
+ const errorDescValue = this.browserStorage.getItem(errorDescKey);
90
+ const values = [
91
+ idTokenValue,
92
+ clientInfoValue,
93
+ errorValue,
94
+ errorDescValue,
95
+ ];
96
+ const keysToMigrate = [
97
+ PersistentCacheKeys.ID_TOKEN,
98
+ PersistentCacheKeys.CLIENT_INFO,
99
+ PersistentCacheKeys.ERROR,
100
+ PersistentCacheKeys.ERROR_DESC,
101
+ ];
102
+ keysToMigrate.forEach((cacheKey, index) => this.migrateCacheEntry(cacheKey, values[index]));
103
+ }
100
104
  /**
101
105
  * Utility function to help with migration.
102
106
  * @param newKey
103
107
  * @param value
104
108
  * @param storeAuthStateInCookie
105
109
  */
106
- BrowserCacheManager.prototype.migrateCacheEntry = function (newKey, value) {
110
+ migrateCacheEntry(newKey, value) {
107
111
  if (value) {
108
112
  this.setTemporaryCache(newKey, value, true);
109
113
  }
110
- };
114
+ }
111
115
  /**
112
116
  * Searches all cache entries for MSAL accounts and creates the account key map
113
117
  * This is used to migrate users from older versions of MSAL which did not create the map.
114
118
  * @returns
115
119
  */
116
- BrowserCacheManager.prototype.createKeyMaps = function () {
117
- var _this = this;
120
+ createKeyMaps() {
118
121
  this.logger.trace("BrowserCacheManager - createKeyMaps called.");
119
- var accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);
120
- var tokenKeys = this.getItem(StaticCacheKeys.TOKEN_KEYS + "." + this.clientId);
122
+ const accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);
123
+ const tokenKeys = this.getItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`);
121
124
  if (accountKeys && tokenKeys) {
122
125
  this.logger.verbose("BrowserCacheManager:createKeyMaps - account and token key maps already exist, skipping migration.");
123
126
  // Key maps already exist, no need to iterate through cache
124
127
  return;
125
128
  }
126
- var allKeys = this.browserStorage.getKeys();
127
- allKeys.forEach(function (key) {
128
- if (_this.isCredentialKey(key)) {
129
+ const allKeys = this.browserStorage.getKeys();
130
+ allKeys.forEach((key) => {
131
+ if (this.isCredentialKey(key)) {
129
132
  // Get item, parse, validate and write key to map
130
- var value = _this.getItem(key);
133
+ const value = this.getItem(key);
131
134
  if (value) {
132
- var credObj = _this.validateAndParseJson(value);
135
+ const credObj = this.validateAndParseJson(value);
133
136
  if (credObj && credObj.hasOwnProperty("credentialType")) {
134
137
  switch (credObj["credentialType"]) {
135
138
  case CredentialType.ID_TOKEN:
136
139
  if (IdTokenEntity.isIdTokenEntity(credObj)) {
137
- _this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map");
138
- _this.logger.tracePii("BrowserCacheManager:createKeyMaps - idToken with key: " + key + " found, saving key to token key map");
139
- var idTokenEntity = CacheManager.toObject(new IdTokenEntity(), credObj);
140
- var newKey = _this.updateCredentialCacheKey(key, idTokenEntity);
141
- _this.addTokenKey(newKey, CredentialType.ID_TOKEN);
140
+ this.logger.trace("BrowserCacheManager:createKeyMaps - idToken found, saving key to token key map");
141
+ this.logger.tracePii(`BrowserCacheManager:createKeyMaps - idToken with key: ${key} found, saving key to token key map`);
142
+ const idTokenEntity = CacheManager.toObject(new IdTokenEntity(), credObj);
143
+ const newKey = this.updateCredentialCacheKey(key, idTokenEntity);
144
+ this.addTokenKey(newKey, CredentialType.ID_TOKEN);
142
145
  return;
143
146
  }
144
147
  else {
145
- _this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping.");
146
- _this.logger.tracePii("BrowserCacheManager:createKeyMaps - failed idToken validation on key: " + key);
148
+ this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching idToken schema with value containing idToken credentialType field but value failed IdTokenEntity validation, skipping.");
149
+ this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed idToken validation on key: ${key}`);
147
150
  }
148
151
  break;
149
152
  case CredentialType.ACCESS_TOKEN:
150
153
  case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
151
154
  if (AccessTokenEntity.isAccessTokenEntity(credObj)) {
152
- _this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map");
153
- _this.logger.tracePii("BrowserCacheManager:createKeyMaps - accessToken with key: " + key + " found, saving key to token key map");
154
- var accessTokenEntity = CacheManager.toObject(new AccessTokenEntity(), credObj);
155
- var newKey = _this.updateCredentialCacheKey(key, accessTokenEntity);
156
- _this.addTokenKey(newKey, CredentialType.ACCESS_TOKEN);
155
+ this.logger.trace("BrowserCacheManager:createKeyMaps - accessToken found, saving key to token key map");
156
+ this.logger.tracePii(`BrowserCacheManager:createKeyMaps - accessToken with key: ${key} found, saving key to token key map`);
157
+ const accessTokenEntity = CacheManager.toObject(new AccessTokenEntity(), credObj);
158
+ const newKey = this.updateCredentialCacheKey(key, accessTokenEntity);
159
+ this.addTokenKey(newKey, CredentialType.ACCESS_TOKEN);
157
160
  return;
158
161
  }
159
162
  else {
160
- _this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping.");
161
- _this.logger.tracePii("BrowserCacheManager:createKeyMaps - failed accessToken validation on key: " + key);
163
+ this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching accessToken schema with value containing accessToken credentialType field but value failed AccessTokenEntity validation, skipping.");
164
+ this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed accessToken validation on key: ${key}`);
162
165
  }
163
166
  break;
164
167
  case CredentialType.REFRESH_TOKEN:
165
168
  if (RefreshTokenEntity.isRefreshTokenEntity(credObj)) {
166
- _this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map");
167
- _this.logger.tracePii("BrowserCacheManager:createKeyMaps - refreshToken with key: " + key + " found, saving key to token key map");
168
- var refreshTokenEntity = CacheManager.toObject(new RefreshTokenEntity(), credObj);
169
- var newKey = _this.updateCredentialCacheKey(key, refreshTokenEntity);
170
- _this.addTokenKey(newKey, CredentialType.REFRESH_TOKEN);
169
+ this.logger.trace("BrowserCacheManager:createKeyMaps - refreshToken found, saving key to token key map");
170
+ this.logger.tracePii(`BrowserCacheManager:createKeyMaps - refreshToken with key: ${key} found, saving key to token key map`);
171
+ const refreshTokenEntity = CacheManager.toObject(new RefreshTokenEntity(), credObj);
172
+ const newKey = this.updateCredentialCacheKey(key, refreshTokenEntity);
173
+ this.addTokenKey(newKey, CredentialType.REFRESH_TOKEN);
171
174
  return;
172
175
  }
173
176
  else {
174
- _this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping.");
175
- _this.logger.tracePii("BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: " + key);
177
+ this.logger.trace("BrowserCacheManager:createKeyMaps - key found matching refreshToken schema with value containing refreshToken credentialType field but value failed RefreshTokenEntity validation, skipping.");
178
+ this.logger.tracePii(`BrowserCacheManager:createKeyMaps - failed refreshToken validation on key: ${key}`);
176
179
  }
177
180
  break;
178
181
  // If credentialType isn't one of our predefined ones, it may not be an MSAL cache value. Ignore.
@@ -180,103 +183,106 @@ var BrowserCacheManager = /** @class */ (function (_super) {
180
183
  }
181
184
  }
182
185
  }
183
- if (_this.isAccountKey(key)) {
184
- var value = _this.getItem(key);
186
+ if (this.isAccountKey(key)) {
187
+ const value = this.getItem(key);
185
188
  if (value) {
186
- var accountObj = _this.validateAndParseJson(value);
187
- if (accountObj && AccountEntity.isAccountEntity(accountObj)) {
188
- _this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map");
189
- _this.logger.tracePii("BrowserCacheManager:createKeyMaps - account with key: " + key + " found, saving key to account key map");
190
- _this.addAccountKeyToMap(key);
189
+ const accountObj = this.validateAndParseJson(value);
190
+ if (accountObj &&
191
+ AccountEntity.isAccountEntity(accountObj)) {
192
+ this.logger.trace("BrowserCacheManager:createKeyMaps - account found, saving key to account key map");
193
+ this.logger.tracePii(`BrowserCacheManager:createKeyMaps - account with key: ${key} found, saving key to account key map`);
194
+ this.addAccountKeyToMap(key);
191
195
  }
192
196
  }
193
197
  }
194
198
  });
195
- };
199
+ }
196
200
  /**
197
201
  * Parses passed value as JSON object, JSON.parse() will throw an error.
198
202
  * @param input
199
203
  */
200
- BrowserCacheManager.prototype.validateAndParseJson = function (jsonValue) {
204
+ validateAndParseJson(jsonValue) {
201
205
  try {
202
- var parsedJson = JSON.parse(jsonValue);
206
+ const parsedJson = JSON.parse(jsonValue);
203
207
  /**
204
208
  * There are edge cases in which JSON.parse will successfully parse a non-valid JSON object
205
209
  * (e.g. JSON.parse will parse an escaped string into an unescaped string), so adding a type check
206
210
  * of the parsed value is necessary in order to be certain that the string represents a valid JSON object.
207
211
  *
208
212
  */
209
- return (parsedJson && typeof parsedJson === "object") ? parsedJson : null;
213
+ return parsedJson && typeof parsedJson === "object"
214
+ ? parsedJson
215
+ : null;
210
216
  }
211
217
  catch (error) {
212
218
  return null;
213
219
  }
214
- };
220
+ }
215
221
  /**
216
222
  * fetches the entry from the browser storage based off the key
217
223
  * @param key
218
224
  */
219
- BrowserCacheManager.prototype.getItem = function (key) {
225
+ getItem(key) {
220
226
  return this.browserStorage.getItem(key);
221
- };
227
+ }
222
228
  /**
223
229
  * sets the entry in the browser storage
224
230
  * @param key
225
231
  * @param value
226
232
  */
227
- BrowserCacheManager.prototype.setItem = function (key, value) {
233
+ setItem(key, value) {
228
234
  this.browserStorage.setItem(key, value);
229
- };
235
+ }
230
236
  /**
231
237
  * fetch the account entity from the platform cache
232
238
  * @param accountKey
233
239
  */
234
- BrowserCacheManager.prototype.getAccount = function (accountKey) {
240
+ getAccount(accountKey) {
235
241
  this.logger.trace("BrowserCacheManager.getAccount called");
236
- var account = this.getItem(accountKey);
242
+ const account = this.getItem(accountKey);
237
243
  if (!account) {
238
244
  this.removeAccountKeyFromMap(accountKey);
239
245
  return null;
240
246
  }
241
- var parsedAccount = this.validateAndParseJson(account);
247
+ const parsedAccount = this.validateAndParseJson(account);
242
248
  if (!parsedAccount || !AccountEntity.isAccountEntity(parsedAccount)) {
243
249
  this.removeAccountKeyFromMap(accountKey);
244
250
  return null;
245
251
  }
246
252
  return CacheManager.toObject(new AccountEntity(), parsedAccount);
247
- };
253
+ }
248
254
  /**
249
255
  * set account entity in the platform cache
250
256
  * @param key
251
257
  * @param value
252
258
  */
253
- BrowserCacheManager.prototype.setAccount = function (account) {
259
+ setAccount(account) {
254
260
  this.logger.trace("BrowserCacheManager.setAccount called");
255
- var key = account.generateAccountKey();
261
+ const key = account.generateAccountKey();
256
262
  this.setItem(key, JSON.stringify(account));
257
263
  this.addAccountKeyToMap(key);
258
- };
264
+ }
259
265
  /**
260
266
  * Returns the array of account keys currently cached
261
267
  * @returns
262
268
  */
263
- BrowserCacheManager.prototype.getAccountKeys = function () {
269
+ getAccountKeys() {
264
270
  this.logger.trace("BrowserCacheManager.getAccountKeys called");
265
- var accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);
271
+ const accountKeys = this.getItem(StaticCacheKeys.ACCOUNT_KEYS);
266
272
  if (accountKeys) {
267
273
  return JSON.parse(accountKeys);
268
274
  }
269
275
  this.logger.verbose("BrowserCacheManager.getAccountKeys - No account keys found");
270
276
  return [];
271
- };
277
+ }
272
278
  /**
273
279
  * Add a new account to the key map
274
280
  * @param key
275
281
  */
276
- BrowserCacheManager.prototype.addAccountKeyToMap = function (key) {
282
+ addAccountKeyToMap(key) {
277
283
  this.logger.trace("BrowserCacheManager.addAccountKeyToMap called");
278
- this.logger.tracePii("BrowserCacheManager.addAccountKeyToMap called with key: " + key);
279
- var accountKeys = this.getAccountKeys();
284
+ this.logger.tracePii(`BrowserCacheManager.addAccountKeyToMap called with key: ${key}`);
285
+ const accountKeys = this.getAccountKeys();
280
286
  if (accountKeys.indexOf(key) === -1) {
281
287
  // Only add key if it does not already exist in the map
282
288
  accountKeys.push(key);
@@ -286,16 +292,16 @@ var BrowserCacheManager = /** @class */ (function (_super) {
286
292
  else {
287
293
  this.logger.verbose("BrowserCacheManager.addAccountKeyToMap account key already exists in map");
288
294
  }
289
- };
295
+ }
290
296
  /**
291
297
  * Remove an account from the key map
292
298
  * @param key
293
299
  */
294
- BrowserCacheManager.prototype.removeAccountKeyFromMap = function (key) {
300
+ removeAccountKeyFromMap(key) {
295
301
  this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap called");
296
- this.logger.tracePii("BrowserCacheManager.removeAccountKeyFromMap called with key: " + key);
297
- var accountKeys = this.getAccountKeys();
298
- var removalIndex = accountKeys.indexOf(key);
302
+ this.logger.tracePii(`BrowserCacheManager.removeAccountKeyFromMap called with key: ${key}`);
303
+ const accountKeys = this.getAccountKeys();
304
+ const removalIndex = accountKeys.indexOf(key);
299
305
  if (removalIndex > -1) {
300
306
  accountKeys.splice(removalIndex, 1);
301
307
  this.setItem(StaticCacheKeys.ACCOUNT_KEYS, JSON.stringify(accountKeys));
@@ -304,58 +310,48 @@ var BrowserCacheManager = /** @class */ (function (_super) {
304
310
  else {
305
311
  this.logger.trace("BrowserCacheManager.removeAccountKeyFromMap key not found in existing map");
306
312
  }
307
- };
313
+ }
308
314
  /**
309
315
  * Extends inherited removeAccount function to include removal of the account key from the map
310
316
  * @param key
311
317
  */
312
- BrowserCacheManager.prototype.removeAccount = function (key) {
313
- return __awaiter(this, void 0, void 0, function () {
314
- return __generator(this, function (_a) {
315
- _super.prototype.removeAccount.call(this, key);
316
- this.removeAccountKeyFromMap(key);
317
- return [2 /*return*/];
318
- });
319
- });
320
- };
318
+ async removeAccount(key) {
319
+ super.removeAccount(key);
320
+ this.removeAccountKeyFromMap(key);
321
+ }
321
322
  /**
322
323
  * Removes given idToken from the cache and from the key map
323
324
  * @param key
324
325
  */
325
- BrowserCacheManager.prototype.removeIdToken = function (key) {
326
- _super.prototype.removeIdToken.call(this, key);
326
+ removeIdToken(key) {
327
+ super.removeIdToken(key);
327
328
  this.removeTokenKey(key, CredentialType.ID_TOKEN);
328
- };
329
+ }
329
330
  /**
330
331
  * Removes given accessToken from the cache and from the key map
331
332
  * @param key
332
333
  */
333
- BrowserCacheManager.prototype.removeAccessToken = function (key) {
334
- return __awaiter(this, void 0, void 0, function () {
335
- return __generator(this, function (_a) {
336
- _super.prototype.removeAccessToken.call(this, key);
337
- this.removeTokenKey(key, CredentialType.ACCESS_TOKEN);
338
- return [2 /*return*/];
339
- });
340
- });
341
- };
334
+ async removeAccessToken(key) {
335
+ super.removeAccessToken(key);
336
+ this.removeTokenKey(key, CredentialType.ACCESS_TOKEN);
337
+ }
342
338
  /**
343
339
  * Removes given refreshToken from the cache and from the key map
344
340
  * @param key
345
341
  */
346
- BrowserCacheManager.prototype.removeRefreshToken = function (key) {
347
- _super.prototype.removeRefreshToken.call(this, key);
342
+ removeRefreshToken(key) {
343
+ super.removeRefreshToken(key);
348
344
  this.removeTokenKey(key, CredentialType.REFRESH_TOKEN);
349
- };
345
+ }
350
346
  /**
351
347
  * Gets the keys for the cached tokens associated with this clientId
352
348
  * @returns
353
349
  */
354
- BrowserCacheManager.prototype.getTokenKeys = function () {
350
+ getTokenKeys() {
355
351
  this.logger.trace("BrowserCacheManager.getTokenKeys called");
356
- var item = this.getItem(StaticCacheKeys.TOKEN_KEYS + "." + this.clientId);
352
+ const item = this.getItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`);
357
353
  if (item) {
358
- var tokenKeys = this.validateAndParseJson(item);
354
+ const tokenKeys = this.validateAndParseJson(item);
359
355
  if (tokenKeys &&
360
356
  tokenKeys.hasOwnProperty("idToken") &&
361
357
  tokenKeys.hasOwnProperty("accessToken") &&
@@ -372,17 +368,17 @@ var BrowserCacheManager = /** @class */ (function (_super) {
372
368
  return {
373
369
  idToken: [],
374
370
  accessToken: [],
375
- refreshToken: []
371
+ refreshToken: [],
376
372
  };
377
- };
373
+ }
378
374
  /**
379
375
  * Adds the given key to the token key map
380
376
  * @param key
381
377
  * @param type
382
378
  */
383
- BrowserCacheManager.prototype.addTokenKey = function (key, type) {
379
+ addTokenKey(key, type) {
384
380
  this.logger.trace("BrowserCacheManager addTokenKey called");
385
- var tokenKeys = this.getTokenKeys();
381
+ const tokenKeys = this.getTokenKeys();
386
382
  switch (type) {
387
383
  case CredentialType.ID_TOKEN:
388
384
  if (tokenKeys.idToken.indexOf(key) === -1) {
@@ -403,23 +399,23 @@ var BrowserCacheManager = /** @class */ (function (_super) {
403
399
  }
404
400
  break;
405
401
  default:
406
- this.logger.error("BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: " + type);
402
+ this.logger.error(`BrowserCacheManager:addTokenKey - CredentialType provided invalid. CredentialType: ${type}`);
407
403
  ClientAuthError.createUnexpectedCredentialTypeError();
408
404
  }
409
- this.setItem(StaticCacheKeys.TOKEN_KEYS + "." + this.clientId, JSON.stringify(tokenKeys));
410
- };
405
+ this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));
406
+ }
411
407
  /**
412
408
  * Removes the given key from the token key map
413
409
  * @param key
414
410
  * @param type
415
411
  */
416
- BrowserCacheManager.prototype.removeTokenKey = function (key, type) {
412
+ removeTokenKey(key, type) {
417
413
  this.logger.trace("BrowserCacheManager removeTokenKey called");
418
- var tokenKeys = this.getTokenKeys();
414
+ const tokenKeys = this.getTokenKeys();
419
415
  switch (type) {
420
416
  case CredentialType.ID_TOKEN:
421
- this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: " + key + " from map");
422
- var idRemoval = tokenKeys.idToken.indexOf(key);
417
+ this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove idToken with key: ${key} from map`);
418
+ const idRemoval = tokenKeys.idToken.indexOf(key);
423
419
  if (idRemoval > -1) {
424
420
  this.logger.info("BrowserCacheManager: removeTokenKey - idToken removed from map");
425
421
  tokenKeys.idToken.splice(idRemoval, 1);
@@ -429,8 +425,8 @@ var BrowserCacheManager = /** @class */ (function (_super) {
429
425
  }
430
426
  break;
431
427
  case CredentialType.ACCESS_TOKEN:
432
- this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: " + key + " from map");
433
- var accessRemoval = tokenKeys.accessToken.indexOf(key);
428
+ this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove accessToken with key: ${key} from map`);
429
+ const accessRemoval = tokenKeys.accessToken.indexOf(key);
434
430
  if (accessRemoval > -1) {
435
431
  this.logger.info("BrowserCacheManager: removeTokenKey - accessToken removed from map");
436
432
  tokenKeys.accessToken.splice(accessRemoval, 1);
@@ -440,8 +436,8 @@ var BrowserCacheManager = /** @class */ (function (_super) {
440
436
  }
441
437
  break;
442
438
  case CredentialType.REFRESH_TOKEN:
443
- this.logger.infoPii("BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: " + key + " from map");
444
- var refreshRemoval = tokenKeys.refreshToken.indexOf(key);
439
+ this.logger.infoPii(`BrowserCacheManager: removeTokenKey - attempting to remove refreshToken with key: ${key} from map`);
440
+ const refreshRemoval = tokenKeys.refreshToken.indexOf(key);
445
441
  if (refreshRemoval > -1) {
446
442
  this.logger.info("BrowserCacheManager: removeTokenKey - refreshToken removed from map");
447
443
  tokenKeys.refreshToken.splice(refreshRemoval, 1);
@@ -451,23 +447,23 @@ var BrowserCacheManager = /** @class */ (function (_super) {
451
447
  }
452
448
  break;
453
449
  default:
454
- this.logger.error("BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: " + type);
450
+ this.logger.error(`BrowserCacheManager:removeTokenKey - CredentialType provided invalid. CredentialType: ${type}`);
455
451
  ClientAuthError.createUnexpectedCredentialTypeError();
456
452
  }
457
- this.setItem(StaticCacheKeys.TOKEN_KEYS + "." + this.clientId, JSON.stringify(tokenKeys));
458
- };
453
+ this.setItem(`${StaticCacheKeys.TOKEN_KEYS}.${this.clientId}`, JSON.stringify(tokenKeys));
454
+ }
459
455
  /**
460
456
  * generates idToken entity from a string
461
457
  * @param idTokenKey
462
458
  */
463
- BrowserCacheManager.prototype.getIdTokenCredential = function (idTokenKey) {
464
- var value = this.getItem(idTokenKey);
459
+ getIdTokenCredential(idTokenKey) {
460
+ const value = this.getItem(idTokenKey);
465
461
  if (!value) {
466
462
  this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit");
467
463
  this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);
468
464
  return null;
469
465
  }
470
- var parsedIdToken = this.validateAndParseJson(value);
466
+ const parsedIdToken = this.validateAndParseJson(value);
471
467
  if (!parsedIdToken || !IdTokenEntity.isIdTokenEntity(parsedIdToken)) {
472
468
  this.logger.trace("BrowserCacheManager.getIdTokenCredential: called, no cache hit");
473
469
  this.removeTokenKey(idTokenKey, CredentialType.ID_TOKEN);
@@ -475,198 +471,206 @@ var BrowserCacheManager = /** @class */ (function (_super) {
475
471
  }
476
472
  this.logger.trace("BrowserCacheManager.getIdTokenCredential: cache hit");
477
473
  return CacheManager.toObject(new IdTokenEntity(), parsedIdToken);
478
- };
474
+ }
479
475
  /**
480
476
  * set IdToken credential to the platform cache
481
477
  * @param idToken
482
478
  */
483
- BrowserCacheManager.prototype.setIdTokenCredential = function (idToken) {
479
+ setIdTokenCredential(idToken) {
484
480
  this.logger.trace("BrowserCacheManager.setIdTokenCredential called");
485
- var idTokenKey = idToken.generateCredentialKey();
481
+ const idTokenKey = idToken.generateCredentialKey();
486
482
  this.setItem(idTokenKey, JSON.stringify(idToken));
487
483
  this.addTokenKey(idTokenKey, CredentialType.ID_TOKEN);
488
- };
484
+ }
489
485
  /**
490
486
  * generates accessToken entity from a string
491
487
  * @param key
492
488
  */
493
- BrowserCacheManager.prototype.getAccessTokenCredential = function (accessTokenKey) {
494
- var value = this.getItem(accessTokenKey);
489
+ getAccessTokenCredential(accessTokenKey) {
490
+ const value = this.getItem(accessTokenKey);
495
491
  if (!value) {
496
492
  this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit");
497
493
  this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
498
494
  return null;
499
495
  }
500
- var parsedAccessToken = this.validateAndParseJson(value);
501
- if (!parsedAccessToken || !AccessTokenEntity.isAccessTokenEntity(parsedAccessToken)) {
496
+ const parsedAccessToken = this.validateAndParseJson(value);
497
+ if (!parsedAccessToken ||
498
+ !AccessTokenEntity.isAccessTokenEntity(parsedAccessToken)) {
502
499
  this.logger.trace("BrowserCacheManager.getAccessTokenCredential: called, no cache hit");
503
500
  this.removeTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
504
501
  return null;
505
502
  }
506
503
  this.logger.trace("BrowserCacheManager.getAccessTokenCredential: cache hit");
507
504
  return CacheManager.toObject(new AccessTokenEntity(), parsedAccessToken);
508
- };
505
+ }
509
506
  /**
510
507
  * set accessToken credential to the platform cache
511
508
  * @param accessToken
512
509
  */
513
- BrowserCacheManager.prototype.setAccessTokenCredential = function (accessToken) {
510
+ setAccessTokenCredential(accessToken) {
514
511
  this.logger.trace("BrowserCacheManager.setAccessTokenCredential called");
515
- var accessTokenKey = accessToken.generateCredentialKey();
512
+ const accessTokenKey = accessToken.generateCredentialKey();
516
513
  this.setItem(accessTokenKey, JSON.stringify(accessToken));
517
514
  this.addTokenKey(accessTokenKey, CredentialType.ACCESS_TOKEN);
518
- };
515
+ }
519
516
  /**
520
517
  * generates refreshToken entity from a string
521
518
  * @param refreshTokenKey
522
519
  */
523
- BrowserCacheManager.prototype.getRefreshTokenCredential = function (refreshTokenKey) {
524
- var value = this.getItem(refreshTokenKey);
520
+ getRefreshTokenCredential(refreshTokenKey) {
521
+ const value = this.getItem(refreshTokenKey);
525
522
  if (!value) {
526
523
  this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit");
527
524
  this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
528
525
  return null;
529
526
  }
530
- var parsedRefreshToken = this.validateAndParseJson(value);
531
- if (!parsedRefreshToken || !RefreshTokenEntity.isRefreshTokenEntity(parsedRefreshToken)) {
527
+ const parsedRefreshToken = this.validateAndParseJson(value);
528
+ if (!parsedRefreshToken ||
529
+ !RefreshTokenEntity.isRefreshTokenEntity(parsedRefreshToken)) {
532
530
  this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: called, no cache hit");
533
531
  this.removeTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
534
532
  return null;
535
533
  }
536
534
  this.logger.trace("BrowserCacheManager.getRefreshTokenCredential: cache hit");
537
535
  return CacheManager.toObject(new RefreshTokenEntity(), parsedRefreshToken);
538
- };
536
+ }
539
537
  /**
540
538
  * set refreshToken credential to the platform cache
541
539
  * @param refreshToken
542
540
  */
543
- BrowserCacheManager.prototype.setRefreshTokenCredential = function (refreshToken) {
541
+ setRefreshTokenCredential(refreshToken) {
544
542
  this.logger.trace("BrowserCacheManager.setRefreshTokenCredential called");
545
- var refreshTokenKey = refreshToken.generateCredentialKey();
543
+ const refreshTokenKey = refreshToken.generateCredentialKey();
546
544
  this.setItem(refreshTokenKey, JSON.stringify(refreshToken));
547
545
  this.addTokenKey(refreshTokenKey, CredentialType.REFRESH_TOKEN);
548
- };
546
+ }
549
547
  /**
550
548
  * fetch appMetadata entity from the platform cache
551
549
  * @param appMetadataKey
552
550
  */
553
- BrowserCacheManager.prototype.getAppMetadata = function (appMetadataKey) {
554
- var value = this.getItem(appMetadataKey);
551
+ getAppMetadata(appMetadataKey) {
552
+ const value = this.getItem(appMetadataKey);
555
553
  if (!value) {
556
554
  this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit");
557
555
  return null;
558
556
  }
559
- var parsedMetadata = this.validateAndParseJson(value);
560
- if (!parsedMetadata || !AppMetadataEntity.isAppMetadataEntity(appMetadataKey, parsedMetadata)) {
557
+ const parsedMetadata = this.validateAndParseJson(value);
558
+ if (!parsedMetadata ||
559
+ !AppMetadataEntity.isAppMetadataEntity(appMetadataKey, parsedMetadata)) {
561
560
  this.logger.trace("BrowserCacheManager.getAppMetadata: called, no cache hit");
562
561
  return null;
563
562
  }
564
563
  this.logger.trace("BrowserCacheManager.getAppMetadata: cache hit");
565
564
  return CacheManager.toObject(new AppMetadataEntity(), parsedMetadata);
566
- };
565
+ }
567
566
  /**
568
567
  * set appMetadata entity to the platform cache
569
568
  * @param appMetadata
570
569
  */
571
- BrowserCacheManager.prototype.setAppMetadata = function (appMetadata) {
570
+ setAppMetadata(appMetadata) {
572
571
  this.logger.trace("BrowserCacheManager.setAppMetadata called");
573
- var appMetadataKey = appMetadata.generateAppMetadataKey();
572
+ const appMetadataKey = appMetadata.generateAppMetadataKey();
574
573
  this.setItem(appMetadataKey, JSON.stringify(appMetadata));
575
- };
574
+ }
576
575
  /**
577
576
  * fetch server telemetry entity from the platform cache
578
577
  * @param serverTelemetryKey
579
578
  */
580
- BrowserCacheManager.prototype.getServerTelemetry = function (serverTelemetryKey) {
581
- var value = this.getItem(serverTelemetryKey);
579
+ getServerTelemetry(serverTelemetryKey) {
580
+ const value = this.getItem(serverTelemetryKey);
582
581
  if (!value) {
583
582
  this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit");
584
583
  return null;
585
584
  }
586
- var parsedMetadata = this.validateAndParseJson(value);
587
- if (!parsedMetadata || !ServerTelemetryEntity.isServerTelemetryEntity(serverTelemetryKey, parsedMetadata)) {
585
+ const parsedMetadata = this.validateAndParseJson(value);
586
+ if (!parsedMetadata ||
587
+ !ServerTelemetryEntity.isServerTelemetryEntity(serverTelemetryKey, parsedMetadata)) {
588
588
  this.logger.trace("BrowserCacheManager.getServerTelemetry: called, no cache hit");
589
589
  return null;
590
590
  }
591
591
  this.logger.trace("BrowserCacheManager.getServerTelemetry: cache hit");
592
592
  return CacheManager.toObject(new ServerTelemetryEntity(), parsedMetadata);
593
- };
593
+ }
594
594
  /**
595
595
  * set server telemetry entity to the platform cache
596
596
  * @param serverTelemetryKey
597
597
  * @param serverTelemetry
598
598
  */
599
- BrowserCacheManager.prototype.setServerTelemetry = function (serverTelemetryKey, serverTelemetry) {
599
+ setServerTelemetry(serverTelemetryKey, serverTelemetry) {
600
600
  this.logger.trace("BrowserCacheManager.setServerTelemetry called");
601
601
  this.setItem(serverTelemetryKey, JSON.stringify(serverTelemetry));
602
- };
602
+ }
603
603
  /**
604
604
  *
605
605
  */
606
- BrowserCacheManager.prototype.getAuthorityMetadata = function (key) {
607
- var value = this.internalStorage.getItem(key);
606
+ getAuthorityMetadata(key) {
607
+ const value = this.internalStorage.getItem(key);
608
608
  if (!value) {
609
609
  this.logger.trace("BrowserCacheManager.getAuthorityMetadata: called, no cache hit");
610
610
  return null;
611
611
  }
612
- var parsedMetadata = this.validateAndParseJson(value);
613
- if (parsedMetadata && AuthorityMetadataEntity.isAuthorityMetadataEntity(key, parsedMetadata)) {
612
+ const parsedMetadata = this.validateAndParseJson(value);
613
+ if (parsedMetadata &&
614
+ AuthorityMetadataEntity.isAuthorityMetadataEntity(key, parsedMetadata)) {
614
615
  this.logger.trace("BrowserCacheManager.getAuthorityMetadata: cache hit");
615
616
  return CacheManager.toObject(new AuthorityMetadataEntity(), parsedMetadata);
616
617
  }
617
618
  return null;
618
- };
619
+ }
619
620
  /**
620
621
  *
621
622
  */
622
- BrowserCacheManager.prototype.getAuthorityMetadataKeys = function () {
623
- var _this = this;
624
- var allKeys = this.internalStorage.getKeys();
625
- return allKeys.filter(function (key) {
626
- return _this.isAuthorityMetadata(key);
623
+ getAuthorityMetadataKeys() {
624
+ const allKeys = this.internalStorage.getKeys();
625
+ return allKeys.filter((key) => {
626
+ return this.isAuthorityMetadata(key);
627
627
  });
628
- };
628
+ }
629
629
  /**
630
630
  * Sets wrapper metadata in memory
631
631
  * @param wrapperSKU
632
632
  * @param wrapperVersion
633
633
  */
634
- BrowserCacheManager.prototype.setWrapperMetadata = function (wrapperSKU, wrapperVersion) {
634
+ setWrapperMetadata(wrapperSKU, wrapperVersion) {
635
635
  this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_SKU, wrapperSKU);
636
636
  this.internalStorage.setItem(InMemoryCacheKeys.WRAPPER_VER, wrapperVersion);
637
- };
637
+ }
638
638
  /**
639
639
  * Returns wrapper metadata from in-memory storage
640
640
  */
641
- BrowserCacheManager.prototype.getWrapperMetadata = function () {
642
- var sku = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_SKU) || Constants.EMPTY_STRING;
643
- var version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) || Constants.EMPTY_STRING;
641
+ getWrapperMetadata() {
642
+ const sku = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_SKU) ||
643
+ Constants.EMPTY_STRING;
644
+ const version = this.internalStorage.getItem(InMemoryCacheKeys.WRAPPER_VER) ||
645
+ Constants.EMPTY_STRING;
644
646
  return [sku, version];
645
- };
647
+ }
646
648
  /**
647
649
  *
648
650
  * @param entity
649
651
  */
650
- BrowserCacheManager.prototype.setAuthorityMetadata = function (key, entity) {
652
+ setAuthorityMetadata(key, entity) {
651
653
  this.logger.trace("BrowserCacheManager.setAuthorityMetadata called");
652
654
  this.internalStorage.setItem(key, JSON.stringify(entity));
653
- };
655
+ }
654
656
  /**
655
657
  * Gets the active account
656
658
  */
657
- BrowserCacheManager.prototype.getActiveAccount = function () {
658
- var activeAccountKeyFilters = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
659
- var activeAccountValueFilters = this.getItem(activeAccountKeyFilters);
659
+ getActiveAccount() {
660
+ const activeAccountKeyFilters = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
661
+ const activeAccountValueFilters = this.getItem(activeAccountKeyFilters);
660
662
  if (!activeAccountValueFilters) {
661
663
  // if new active account cache type isn't found, it's an old version, so look for that instead
662
664
  this.logger.trace("BrowserCacheManager.getActiveAccount: No active account filters cache schema found, looking for legacy schema");
663
- var activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);
664
- var activeAccountValueLocal = this.getItem(activeAccountKeyLocal);
665
+ const activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);
666
+ const activeAccountValueLocal = this.getItem(activeAccountKeyLocal);
665
667
  if (!activeAccountValueLocal) {
666
668
  this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
667
669
  return null;
668
670
  }
669
- var activeAccount = this.getAccountInfoByFilter({ localAccountId: activeAccountValueLocal })[0] || null;
671
+ const activeAccount = this.getAccountInfoByFilter({
672
+ localAccountId: activeAccountValueLocal,
673
+ })[0] || null;
670
674
  if (activeAccount) {
671
675
  this.logger.trace("BrowserCacheManager.getActiveAccount: Legacy active account cache schema found");
672
676
  this.logger.trace("BrowserCacheManager.getActiveAccount: Adding active account filters cache schema");
@@ -675,29 +679,29 @@ var BrowserCacheManager = /** @class */ (function (_super) {
675
679
  }
676
680
  return null;
677
681
  }
678
- var activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters);
682
+ const activeAccountValueObj = this.validateAndParseJson(activeAccountValueFilters);
679
683
  if (activeAccountValueObj) {
680
684
  this.logger.trace("BrowserCacheManager.getActiveAccount: Active account filters schema found");
681
- return this.getAccountInfoByFilter({
685
+ return (this.getAccountInfoByFilter({
682
686
  homeAccountId: activeAccountValueObj.homeAccountId,
683
- localAccountId: activeAccountValueObj.localAccountId
684
- })[0] || null;
687
+ localAccountId: activeAccountValueObj.localAccountId,
688
+ })[0] || null);
685
689
  }
686
690
  this.logger.trace("BrowserCacheManager.getActiveAccount: No active account found");
687
691
  return null;
688
- };
692
+ }
689
693
  /**
690
694
  * Sets the active account's localAccountId in cache
691
695
  * @param account
692
696
  */
693
- BrowserCacheManager.prototype.setActiveAccount = function (account) {
694
- var activeAccountKey = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
695
- var activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);
697
+ setActiveAccount(account) {
698
+ const activeAccountKey = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT_FILTERS);
699
+ const activeAccountKeyLocal = this.generateCacheKey(PersistentCacheKeys.ACTIVE_ACCOUNT);
696
700
  if (account) {
697
701
  this.logger.verbose("setActiveAccount: Active account set");
698
- var activeAccountValue = {
702
+ const activeAccountValue = {
699
703
  homeAccountId: account.homeAccountId,
700
- localAccountId: account.localAccountId
704
+ localAccountId: account.localAccountId,
701
705
  };
702
706
  this.browserStorage.setItem(activeAccountKey, JSON.stringify(activeAccountValue));
703
707
  this.browserStorage.setItem(activeAccountKeyLocal, account.localAccountId);
@@ -707,42 +711,49 @@ var BrowserCacheManager = /** @class */ (function (_super) {
707
711
  this.browserStorage.removeItem(activeAccountKey);
708
712
  this.browserStorage.removeItem(activeAccountKeyLocal);
709
713
  }
710
- };
714
+ }
711
715
  /**
712
716
  * Gets a list of accounts that match all of the filters provided
713
717
  * @param account
714
718
  */
715
- BrowserCacheManager.prototype.getAccountInfoByFilter = function (accountFilter) {
716
- var allAccounts = this.getAllAccounts();
717
- this.logger.trace("BrowserCacheManager.getAccountInfoByFilter: total " + allAccounts.length + " accounts found");
718
- return allAccounts.filter(function (accountObj) {
719
- if (accountFilter.username && accountFilter.username.toLowerCase() !== accountObj.username.toLowerCase()) {
719
+ getAccountInfoByFilter(accountFilter) {
720
+ const allAccounts = this.getAllAccounts();
721
+ this.logger.trace(`BrowserCacheManager.getAccountInfoByFilter: total ${allAccounts.length} accounts found`);
722
+ return allAccounts.filter((accountObj) => {
723
+ if (accountFilter.username &&
724
+ accountFilter.username.toLowerCase() !==
725
+ accountObj.username.toLowerCase()) {
720
726
  return false;
721
727
  }
722
- if (accountFilter.homeAccountId && accountFilter.homeAccountId !== accountObj.homeAccountId) {
728
+ if (accountFilter.homeAccountId &&
729
+ accountFilter.homeAccountId !== accountObj.homeAccountId) {
723
730
  return false;
724
731
  }
725
- if (accountFilter.localAccountId && accountFilter.localAccountId !== accountObj.localAccountId) {
732
+ if (accountFilter.localAccountId &&
733
+ accountFilter.localAccountId !== accountObj.localAccountId) {
726
734
  return false;
727
735
  }
728
- if (accountFilter.tenantId && accountFilter.tenantId !== accountObj.tenantId) {
736
+ if (accountFilter.tenantId &&
737
+ accountFilter.tenantId !== accountObj.tenantId) {
729
738
  return false;
730
739
  }
731
- if (accountFilter.environment && accountFilter.environment !== accountObj.environment) {
740
+ if (accountFilter.environment &&
741
+ accountFilter.environment !== accountObj.environment) {
732
742
  return false;
733
743
  }
734
744
  return true;
735
745
  });
736
- };
746
+ }
737
747
  /**
738
748
  * Checks the cache for accounts matching loginHint or SID
739
749
  * @param loginHint
740
750
  * @param sid
741
751
  */
742
- BrowserCacheManager.prototype.getAccountInfoByHints = function (loginHint, sid) {
743
- var matchingAccounts = this.getAllAccounts().filter(function (accountInfo) {
752
+ getAccountInfoByHints(loginHint, sid) {
753
+ const matchingAccounts = this.getAllAccounts().filter((accountInfo) => {
744
754
  if (sid) {
745
- var accountSid = accountInfo.idTokenClaims && accountInfo.idTokenClaims["sid"];
755
+ const accountSid = accountInfo.idTokenClaims &&
756
+ accountInfo.idTokenClaims["sid"];
746
757
  return sid === accountSid;
747
758
  }
748
759
  if (loginHint) {
@@ -757,53 +768,55 @@ var BrowserCacheManager = /** @class */ (function (_super) {
757
768
  throw ClientAuthError.createMultipleMatchingAccountsInCacheError();
758
769
  }
759
770
  return null;
760
- };
771
+ }
761
772
  /**
762
773
  * fetch throttling entity from the platform cache
763
774
  * @param throttlingCacheKey
764
775
  */
765
- BrowserCacheManager.prototype.getThrottlingCache = function (throttlingCacheKey) {
766
- var value = this.getItem(throttlingCacheKey);
776
+ getThrottlingCache(throttlingCacheKey) {
777
+ const value = this.getItem(throttlingCacheKey);
767
778
  if (!value) {
768
779
  this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit");
769
780
  return null;
770
781
  }
771
- var parsedThrottlingCache = this.validateAndParseJson(value);
772
- if (!parsedThrottlingCache || !ThrottlingEntity.isThrottlingEntity(throttlingCacheKey, parsedThrottlingCache)) {
782
+ const parsedThrottlingCache = this.validateAndParseJson(value);
783
+ if (!parsedThrottlingCache ||
784
+ !ThrottlingEntity.isThrottlingEntity(throttlingCacheKey, parsedThrottlingCache)) {
773
785
  this.logger.trace("BrowserCacheManager.getThrottlingCache: called, no cache hit");
774
786
  return null;
775
787
  }
776
788
  this.logger.trace("BrowserCacheManager.getThrottlingCache: cache hit");
777
789
  return CacheManager.toObject(new ThrottlingEntity(), parsedThrottlingCache);
778
- };
790
+ }
779
791
  /**
780
792
  * set throttling entity to the platform cache
781
793
  * @param throttlingCacheKey
782
794
  * @param throttlingCache
783
795
  */
784
- BrowserCacheManager.prototype.setThrottlingCache = function (throttlingCacheKey, throttlingCache) {
796
+ setThrottlingCache(throttlingCacheKey, throttlingCache) {
785
797
  this.logger.trace("BrowserCacheManager.setThrottlingCache called");
786
798
  this.setItem(throttlingCacheKey, JSON.stringify(throttlingCache));
787
- };
799
+ }
788
800
  /**
789
801
  * Gets cache item with given key.
790
802
  * Will retrieve from cookies if storeAuthStateInCookie is set to true.
791
803
  * @param key
792
804
  */
793
- BrowserCacheManager.prototype.getTemporaryCache = function (cacheKey, generateKey) {
794
- var key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
805
+ getTemporaryCache(cacheKey, generateKey) {
806
+ const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
795
807
  if (this.cacheConfig.storeAuthStateInCookie) {
796
- var itemCookie = this.getItemCookie(key);
808
+ const itemCookie = this.getItemCookie(key);
797
809
  if (itemCookie) {
798
810
  this.logger.trace("BrowserCacheManager.getTemporaryCache: storeAuthStateInCookies set to true, retrieving from cookies");
799
811
  return itemCookie;
800
812
  }
801
813
  }
802
- var value = this.temporaryCacheStorage.getItem(key);
814
+ const value = this.temporaryCacheStorage.getItem(key);
803
815
  if (!value) {
804
816
  // If temp cache item not found in session/memory, check local storage for items set by old versions
805
- if (this.cacheConfig.cacheLocation === BrowserCacheLocation.LocalStorage) {
806
- var item = this.browserStorage.getItem(key);
817
+ if (this.cacheConfig.cacheLocation ===
818
+ BrowserCacheLocation.LocalStorage) {
819
+ const item = this.browserStorage.getItem(key);
807
820
  if (item) {
808
821
  this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item found in local storage");
809
822
  return item;
@@ -814,7 +827,7 @@ var BrowserCacheManager = /** @class */ (function (_super) {
814
827
  }
815
828
  this.logger.trace("BrowserCacheManager.getTemporaryCache: Temporary cache item returned");
816
829
  return value;
817
- };
830
+ }
818
831
  /**
819
832
  * Sets the cache item with the key and value given.
820
833
  * Stores in cookie if storeAuthStateInCookie is set to true.
@@ -822,94 +835,89 @@ var BrowserCacheManager = /** @class */ (function (_super) {
822
835
  * @param key
823
836
  * @param value
824
837
  */
825
- BrowserCacheManager.prototype.setTemporaryCache = function (cacheKey, value, generateKey) {
826
- var key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
838
+ setTemporaryCache(cacheKey, value, generateKey) {
839
+ const key = generateKey ? this.generateCacheKey(cacheKey) : cacheKey;
827
840
  this.temporaryCacheStorage.setItem(key, value);
828
841
  if (this.cacheConfig.storeAuthStateInCookie) {
829
842
  this.logger.trace("BrowserCacheManager.setTemporaryCache: storeAuthStateInCookie set to true, setting item cookie");
830
843
  this.setItemCookie(key, value);
831
844
  }
832
- };
845
+ }
833
846
  /**
834
847
  * Removes the cache item with the given key.
835
848
  * Will also clear the cookie item if storeAuthStateInCookie is set to true.
836
849
  * @param key
837
850
  */
838
- BrowserCacheManager.prototype.removeItem = function (key) {
851
+ removeItem(key) {
839
852
  this.browserStorage.removeItem(key);
840
853
  this.temporaryCacheStorage.removeItem(key);
841
854
  if (this.cacheConfig.storeAuthStateInCookie) {
842
855
  this.logger.trace("BrowserCacheManager.removeItem: storeAuthStateInCookie is true, clearing item cookie");
843
856
  this.clearItemCookie(key);
844
857
  }
845
- };
858
+ }
846
859
  /**
847
860
  * Checks whether key is in cache.
848
861
  * @param key
849
862
  */
850
- BrowserCacheManager.prototype.containsKey = function (key) {
851
- return this.browserStorage.containsKey(key) || this.temporaryCacheStorage.containsKey(key);
852
- };
863
+ containsKey(key) {
864
+ return (this.browserStorage.containsKey(key) ||
865
+ this.temporaryCacheStorage.containsKey(key));
866
+ }
853
867
  /**
854
868
  * Gets all keys in window.
855
869
  */
856
- BrowserCacheManager.prototype.getKeys = function () {
857
- return __spread(this.browserStorage.getKeys(), this.temporaryCacheStorage.getKeys());
858
- };
870
+ getKeys() {
871
+ return [
872
+ ...this.browserStorage.getKeys(),
873
+ ...this.temporaryCacheStorage.getKeys(),
874
+ ];
875
+ }
859
876
  /**
860
877
  * Clears all cache entries created by MSAL.
861
878
  */
862
- BrowserCacheManager.prototype.clear = function () {
863
- return __awaiter(this, void 0, void 0, function () {
864
- var _this = this;
865
- return __generator(this, function (_a) {
866
- switch (_a.label) {
867
- case 0:
868
- // Removes all accounts and their credentials
869
- return [4 /*yield*/, this.removeAllAccounts()];
870
- case 1:
871
- // Removes all accounts and their credentials
872
- _a.sent();
873
- this.removeAppMetadata();
874
- // Removes all remaining MSAL cache items
875
- this.getKeys().forEach(function (cacheKey) {
876
- // Check if key contains msal prefix; For now, we are clearing all the cache items created by MSAL.js
877
- if ((_this.browserStorage.containsKey(cacheKey) || _this.temporaryCacheStorage.containsKey(cacheKey)) && ((cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1) || (cacheKey.indexOf(_this.clientId) !== -1))) {
878
- _this.removeItem(cacheKey);
879
- }
880
- });
881
- this.internalStorage.clear();
882
- return [2 /*return*/];
883
- }
884
- });
879
+ async clear() {
880
+ // Removes all accounts and their credentials
881
+ await this.removeAllAccounts();
882
+ this.removeAppMetadata();
883
+ // Removes all remaining MSAL cache items
884
+ this.getKeys().forEach((cacheKey) => {
885
+ // Check if key contains msal prefix; For now, we are clearing all the cache items created by MSAL.js
886
+ if ((this.browserStorage.containsKey(cacheKey) ||
887
+ this.temporaryCacheStorage.containsKey(cacheKey)) &&
888
+ (cacheKey.indexOf(Constants.CACHE_PREFIX) !== -1 ||
889
+ cacheKey.indexOf(this.clientId) !== -1)) {
890
+ this.removeItem(cacheKey);
891
+ }
885
892
  });
886
- };
893
+ this.internalStorage.clear();
894
+ }
887
895
  /**
888
896
  * Add value to cookies
889
897
  * @param cookieName
890
898
  * @param cookieValue
891
899
  * @param expires
892
900
  */
893
- BrowserCacheManager.prototype.setItemCookie = function (cookieName, cookieValue, expires) {
894
- var cookieStr = encodeURIComponent(cookieName) + "=" + encodeURIComponent(cookieValue) + ";path=/;SameSite=Lax;";
901
+ setItemCookie(cookieName, cookieValue, expires) {
902
+ let cookieStr = `${encodeURIComponent(cookieName)}=${encodeURIComponent(cookieValue)};path=/;SameSite=Lax;`;
895
903
  if (expires) {
896
- var expireTime = this.getCookieExpirationTime(expires);
897
- cookieStr += "expires=" + expireTime + ";";
904
+ const expireTime = this.getCookieExpirationTime(expires);
905
+ cookieStr += `expires=${expireTime};`;
898
906
  }
899
907
  if (this.cacheConfig.secureCookies) {
900
908
  cookieStr += "Secure;";
901
909
  }
902
910
  document.cookie = cookieStr;
903
- };
911
+ }
904
912
  /**
905
913
  * Get one item by key from cookies
906
914
  * @param cookieName
907
915
  */
908
- BrowserCacheManager.prototype.getItemCookie = function (cookieName) {
909
- var name = encodeURIComponent(cookieName) + "=";
910
- var cookieList = document.cookie.split(";");
911
- for (var i = 0; i < cookieList.length; i++) {
912
- var cookie = cookieList[i];
916
+ getItemCookie(cookieName) {
917
+ const name = `${encodeURIComponent(cookieName)}=`;
918
+ const cookieList = document.cookie.split(";");
919
+ for (let i = 0; i < cookieList.length; i++) {
920
+ let cookie = cookieList[i];
913
921
  while (cookie.charAt(0) === " ") {
914
922
  cookie = cookie.substring(1);
915
923
  }
@@ -918,148 +926,147 @@ var BrowserCacheManager = /** @class */ (function (_super) {
918
926
  }
919
927
  }
920
928
  return Constants.EMPTY_STRING;
921
- };
929
+ }
922
930
  /**
923
931
  * Clear all msal-related cookies currently set in the browser. Should only be used to clear temporary cache items.
924
932
  */
925
- BrowserCacheManager.prototype.clearMsalCookies = function () {
926
- var _this = this;
927
- var cookiePrefix = Constants.CACHE_PREFIX + "." + this.clientId;
928
- var cookieList = document.cookie.split(";");
929
- cookieList.forEach(function (cookie) {
933
+ clearMsalCookies() {
934
+ const cookiePrefix = `${Constants.CACHE_PREFIX}.${this.clientId}`;
935
+ const cookieList = document.cookie.split(";");
936
+ cookieList.forEach((cookie) => {
930
937
  while (cookie.charAt(0) === " ") {
931
938
  // eslint-disable-next-line no-param-reassign
932
939
  cookie = cookie.substring(1);
933
940
  }
934
941
  if (cookie.indexOf(cookiePrefix) === 0) {
935
- var cookieKey = cookie.split("=")[0];
936
- _this.clearItemCookie(cookieKey);
942
+ const cookieKey = cookie.split("=")[0];
943
+ this.clearItemCookie(cookieKey);
937
944
  }
938
945
  });
939
- };
946
+ }
940
947
  /**
941
948
  * Clear an item in the cookies by key
942
949
  * @param cookieName
943
950
  */
944
- BrowserCacheManager.prototype.clearItemCookie = function (cookieName) {
951
+ clearItemCookie(cookieName) {
945
952
  this.setItemCookie(cookieName, Constants.EMPTY_STRING, -1);
946
- };
953
+ }
947
954
  /**
948
955
  * Get cookie expiration time
949
956
  * @param cookieLifeDays
950
957
  */
951
- BrowserCacheManager.prototype.getCookieExpirationTime = function (cookieLifeDays) {
952
- var today = new Date();
953
- var expr = new Date(today.getTime() + cookieLifeDays * this.COOKIE_LIFE_MULTIPLIER);
958
+ getCookieExpirationTime(cookieLifeDays) {
959
+ const today = new Date();
960
+ const expr = new Date(today.getTime() + cookieLifeDays * this.COOKIE_LIFE_MULTIPLIER);
954
961
  return expr.toUTCString();
955
- };
962
+ }
956
963
  /**
957
964
  * Gets the cache object referenced by the browser
958
965
  */
959
- BrowserCacheManager.prototype.getCache = function () {
966
+ getCache() {
960
967
  return this.browserStorage;
961
- };
968
+ }
962
969
  /**
963
970
  * interface compat, we cannot overwrite browser cache; Functionality is supported by individual entities in browser
964
971
  */
965
- BrowserCacheManager.prototype.setCache = function () {
972
+ setCache() {
966
973
  // sets nothing
967
- };
974
+ }
968
975
  /**
969
976
  * Prepend msal.<client-id> to each key; Skip for any JSON object as Key (defined schemas do not need the key appended: AccessToken Keys or the upcoming schema)
970
977
  * @param key
971
978
  * @param addInstanceId
972
979
  */
973
- BrowserCacheManager.prototype.generateCacheKey = function (key) {
974
- var generatedKey = this.validateAndParseJson(key);
980
+ generateCacheKey(key) {
981
+ const generatedKey = this.validateAndParseJson(key);
975
982
  if (!generatedKey) {
976
- if (StringUtils.startsWith(key, Constants.CACHE_PREFIX) || StringUtils.startsWith(key, PersistentCacheKeys.ADAL_ID_TOKEN)) {
983
+ if (StringUtils.startsWith(key, Constants.CACHE_PREFIX) ||
984
+ StringUtils.startsWith(key, PersistentCacheKeys.ADAL_ID_TOKEN)) {
977
985
  return key;
978
986
  }
979
- return Constants.CACHE_PREFIX + "." + this.clientId + "." + key;
987
+ return `${Constants.CACHE_PREFIX}.${this.clientId}.${key}`;
980
988
  }
981
989
  return JSON.stringify(key);
982
- };
990
+ }
983
991
  /**
984
992
  * Create authorityKey to cache authority
985
993
  * @param state
986
994
  */
987
- BrowserCacheManager.prototype.generateAuthorityKey = function (stateString) {
988
- var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
989
- return this.generateCacheKey(TemporaryCacheKeys.AUTHORITY + "." + stateId);
990
- };
995
+ generateAuthorityKey(stateString) {
996
+ const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);
997
+ return this.generateCacheKey(`${TemporaryCacheKeys.AUTHORITY}.${stateId}`);
998
+ }
991
999
  /**
992
1000
  * Create Nonce key to cache nonce
993
1001
  * @param state
994
1002
  */
995
- BrowserCacheManager.prototype.generateNonceKey = function (stateString) {
996
- var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
997
- return this.generateCacheKey(TemporaryCacheKeys.NONCE_IDTOKEN + "." + stateId);
998
- };
1003
+ generateNonceKey(stateString) {
1004
+ const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);
1005
+ return this.generateCacheKey(`${TemporaryCacheKeys.NONCE_IDTOKEN}.${stateId}`);
1006
+ }
999
1007
  /**
1000
1008
  * Creates full cache key for the request state
1001
1009
  * @param stateString State string for the request
1002
1010
  */
1003
- BrowserCacheManager.prototype.generateStateKey = function (stateString) {
1011
+ generateStateKey(stateString) {
1004
1012
  // Use the library state id to key temp storage for uniqueness for multiple concurrent requests
1005
- var stateId = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString).libraryState.id;
1006
- return this.generateCacheKey(TemporaryCacheKeys.REQUEST_STATE + "." + stateId);
1007
- };
1013
+ const { libraryState: { id: stateId }, } = ProtocolUtils.parseRequestState(this.cryptoImpl, stateString);
1014
+ return this.generateCacheKey(`${TemporaryCacheKeys.REQUEST_STATE}.${stateId}`);
1015
+ }
1008
1016
  /**
1009
1017
  * Gets the cached authority based on the cached state. Returns empty if no cached state found.
1010
1018
  */
1011
- BrowserCacheManager.prototype.getCachedAuthority = function (cachedState) {
1012
- var stateCacheKey = this.generateStateKey(cachedState);
1013
- var state = this.getTemporaryCache(stateCacheKey);
1019
+ getCachedAuthority(cachedState) {
1020
+ const stateCacheKey = this.generateStateKey(cachedState);
1021
+ const state = this.getTemporaryCache(stateCacheKey);
1014
1022
  if (!state) {
1015
1023
  return null;
1016
1024
  }
1017
- var authorityCacheKey = this.generateAuthorityKey(state);
1025
+ const authorityCacheKey = this.generateAuthorityKey(state);
1018
1026
  return this.getTemporaryCache(authorityCacheKey);
1019
- };
1027
+ }
1020
1028
  /**
1021
1029
  * Updates account, authority, and state in cache
1022
1030
  * @param serverAuthenticationRequest
1023
1031
  * @param account
1024
1032
  */
1025
- BrowserCacheManager.prototype.updateCacheEntries = function (state, nonce, authorityInstance, loginHint, account) {
1033
+ updateCacheEntries(state, nonce, authorityInstance, loginHint, account) {
1026
1034
  this.logger.trace("BrowserCacheManager.updateCacheEntries called");
1027
1035
  // Cache the request state
1028
- var stateCacheKey = this.generateStateKey(state);
1036
+ const stateCacheKey = this.generateStateKey(state);
1029
1037
  this.setTemporaryCache(stateCacheKey, state, false);
1030
1038
  // Cache the nonce
1031
- var nonceCacheKey = this.generateNonceKey(state);
1039
+ const nonceCacheKey = this.generateNonceKey(state);
1032
1040
  this.setTemporaryCache(nonceCacheKey, nonce, false);
1033
1041
  // Cache authorityKey
1034
- var authorityCacheKey = this.generateAuthorityKey(state);
1042
+ const authorityCacheKey = this.generateAuthorityKey(state);
1035
1043
  this.setTemporaryCache(authorityCacheKey, authorityInstance, false);
1036
1044
  if (account) {
1037
- var ccsCredential = {
1045
+ const ccsCredential = {
1038
1046
  credential: account.homeAccountId,
1039
- type: CcsCredentialType.HOME_ACCOUNT_ID
1047
+ type: CcsCredentialType.HOME_ACCOUNT_ID,
1040
1048
  };
1041
1049
  this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
1042
1050
  }
1043
1051
  else if (!StringUtils.isEmpty(loginHint)) {
1044
- var ccsCredential = {
1052
+ const ccsCredential = {
1045
1053
  credential: loginHint,
1046
- type: CcsCredentialType.UPN
1054
+ type: CcsCredentialType.UPN,
1047
1055
  };
1048
1056
  this.setTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, JSON.stringify(ccsCredential), true);
1049
1057
  }
1050
- };
1058
+ }
1051
1059
  /**
1052
1060
  * Reset all temporary cache items
1053
1061
  * @param state
1054
1062
  */
1055
- BrowserCacheManager.prototype.resetRequestCache = function (state) {
1056
- var _this = this;
1063
+ resetRequestCache(state) {
1057
1064
  this.logger.trace("BrowserCacheManager.resetRequestCache called");
1058
1065
  // check state and remove associated cache items
1059
1066
  if (!StringUtils.isEmpty(state)) {
1060
- this.getKeys().forEach(function (key) {
1067
+ this.getKeys().forEach((key) => {
1061
1068
  if (key.indexOf(state) !== -1) {
1062
- _this.removeItem(key);
1069
+ this.removeItem(key);
1063
1070
  }
1064
1071
  });
1065
1072
  }
@@ -1076,115 +1083,115 @@ var BrowserCacheManager = /** @class */ (function (_super) {
1076
1083
  this.removeItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));
1077
1084
  this.removeItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
1078
1085
  this.setInteractionInProgress(false);
1079
- };
1086
+ }
1080
1087
  /**
1081
1088
  * Removes temporary cache for the provided state
1082
1089
  * @param stateString
1083
1090
  */
1084
- BrowserCacheManager.prototype.cleanRequestByState = function (stateString) {
1091
+ cleanRequestByState(stateString) {
1085
1092
  this.logger.trace("BrowserCacheManager.cleanRequestByState called");
1086
1093
  // Interaction is completed - remove interaction status.
1087
1094
  if (stateString) {
1088
- var stateKey = this.generateStateKey(stateString);
1089
- var cachedState = this.temporaryCacheStorage.getItem(stateKey);
1090
- this.logger.infoPii("BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: " + cachedState);
1095
+ const stateKey = this.generateStateKey(stateString);
1096
+ const cachedState = this.temporaryCacheStorage.getItem(stateKey);
1097
+ this.logger.infoPii(`BrowserCacheManager.cleanRequestByState: Removing temporary cache items for state: ${cachedState}`);
1091
1098
  this.resetRequestCache(cachedState || Constants.EMPTY_STRING);
1092
1099
  }
1093
1100
  this.clearMsalCookies();
1094
- };
1101
+ }
1095
1102
  /**
1096
1103
  * Looks in temporary cache for any state values with the provided interactionType and removes all temporary cache items for that state
1097
1104
  * Used in scenarios where temp cache needs to be cleaned but state is not known, such as clicking browser back button.
1098
1105
  * @param interactionType
1099
1106
  */
1100
- BrowserCacheManager.prototype.cleanRequestByInteractionType = function (interactionType) {
1101
- var _this = this;
1107
+ cleanRequestByInteractionType(interactionType) {
1102
1108
  this.logger.trace("BrowserCacheManager.cleanRequestByInteractionType called");
1103
1109
  // Loop through all keys to find state key
1104
- this.getKeys().forEach(function (key) {
1110
+ this.getKeys().forEach((key) => {
1105
1111
  // If this key is not the state key, move on
1106
1112
  if (key.indexOf(TemporaryCacheKeys.REQUEST_STATE) === -1) {
1107
1113
  return;
1108
1114
  }
1109
1115
  // Retrieve state value, return if not a valid value
1110
- var stateValue = _this.temporaryCacheStorage.getItem(key);
1116
+ const stateValue = this.temporaryCacheStorage.getItem(key);
1111
1117
  if (!stateValue) {
1112
1118
  return;
1113
1119
  }
1114
1120
  // Extract state and ensure it matches given InteractionType, then clean request cache
1115
- var parsedState = BrowserProtocolUtils.extractBrowserRequestState(_this.cryptoImpl, stateValue);
1116
- if (parsedState && parsedState.interactionType === interactionType) {
1117
- _this.logger.infoPii("BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: " + stateValue);
1118
- _this.resetRequestCache(stateValue);
1121
+ const parsedState = BrowserProtocolUtils.extractBrowserRequestState(this.cryptoImpl, stateValue);
1122
+ if (parsedState &&
1123
+ parsedState.interactionType === interactionType) {
1124
+ this.logger.infoPii(`BrowserCacheManager.cleanRequestByInteractionType: Removing temporary cache items for state: ${stateValue}`);
1125
+ this.resetRequestCache(stateValue);
1119
1126
  }
1120
1127
  });
1121
1128
  this.clearMsalCookies();
1122
1129
  this.setInteractionInProgress(false);
1123
- };
1124
- BrowserCacheManager.prototype.cacheCodeRequest = function (authCodeRequest, browserCrypto) {
1130
+ }
1131
+ cacheCodeRequest(authCodeRequest, browserCrypto) {
1125
1132
  this.logger.trace("BrowserCacheManager.cacheCodeRequest called");
1126
- var encodedValue = browserCrypto.base64Encode(JSON.stringify(authCodeRequest));
1133
+ const encodedValue = browserCrypto.base64Encode(JSON.stringify(authCodeRequest));
1127
1134
  this.setTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, encodedValue, true);
1128
- };
1135
+ }
1129
1136
  /**
1130
1137
  * Gets the token exchange parameters from the cache. Throws an error if nothing is found.
1131
1138
  */
1132
- BrowserCacheManager.prototype.getCachedRequest = function (state, browserCrypto) {
1139
+ getCachedRequest(state, browserCrypto) {
1133
1140
  this.logger.trace("BrowserCacheManager.getCachedRequest called");
1134
1141
  // Get token request from cache and parse as TokenExchangeParameters.
1135
- var encodedTokenRequest = this.getTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, true);
1142
+ const encodedTokenRequest = this.getTemporaryCache(TemporaryCacheKeys.REQUEST_PARAMS, true);
1136
1143
  if (!encodedTokenRequest) {
1137
1144
  throw BrowserAuthError.createNoTokenRequestCacheError();
1138
1145
  }
1139
- var parsedRequest = this.validateAndParseJson(browserCrypto.base64Decode(encodedTokenRequest));
1146
+ const parsedRequest = this.validateAndParseJson(browserCrypto.base64Decode(encodedTokenRequest));
1140
1147
  if (!parsedRequest) {
1141
1148
  throw BrowserAuthError.createUnableToParseTokenRequestCacheError();
1142
1149
  }
1143
1150
  this.removeItem(this.generateCacheKey(TemporaryCacheKeys.REQUEST_PARAMS));
1144
1151
  // Get cached authority and use if no authority is cached with request.
1145
1152
  if (StringUtils.isEmpty(parsedRequest.authority)) {
1146
- var authorityCacheKey = this.generateAuthorityKey(state);
1147
- var cachedAuthority = this.getTemporaryCache(authorityCacheKey);
1153
+ const authorityCacheKey = this.generateAuthorityKey(state);
1154
+ const cachedAuthority = this.getTemporaryCache(authorityCacheKey);
1148
1155
  if (!cachedAuthority) {
1149
1156
  throw BrowserAuthError.createNoCachedAuthorityError();
1150
1157
  }
1151
1158
  parsedRequest.authority = cachedAuthority;
1152
1159
  }
1153
1160
  return parsedRequest;
1154
- };
1161
+ }
1155
1162
  /**
1156
1163
  * Gets cached native request for redirect flows
1157
1164
  */
1158
- BrowserCacheManager.prototype.getCachedNativeRequest = function () {
1165
+ getCachedNativeRequest() {
1159
1166
  this.logger.trace("BrowserCacheManager.getCachedNativeRequest called");
1160
- var cachedRequest = this.getTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, true);
1167
+ const cachedRequest = this.getTemporaryCache(TemporaryCacheKeys.NATIVE_REQUEST, true);
1161
1168
  if (!cachedRequest) {
1162
1169
  this.logger.trace("BrowserCacheManager.getCachedNativeRequest: No cached native request found");
1163
1170
  return null;
1164
1171
  }
1165
- var parsedRequest = this.validateAndParseJson(cachedRequest);
1172
+ const parsedRequest = this.validateAndParseJson(cachedRequest);
1166
1173
  if (!parsedRequest) {
1167
1174
  this.logger.error("BrowserCacheManager.getCachedNativeRequest: Unable to parse native request");
1168
1175
  return null;
1169
1176
  }
1170
1177
  return parsedRequest;
1171
- };
1172
- BrowserCacheManager.prototype.isInteractionInProgress = function (matchClientId) {
1173
- var clientId = this.getInteractionInProgress();
1178
+ }
1179
+ isInteractionInProgress(matchClientId) {
1180
+ const clientId = this.getInteractionInProgress();
1174
1181
  if (matchClientId) {
1175
1182
  return clientId === this.clientId;
1176
1183
  }
1177
1184
  else {
1178
1185
  return !!clientId;
1179
1186
  }
1180
- };
1181
- BrowserCacheManager.prototype.getInteractionInProgress = function () {
1182
- var key = Constants.CACHE_PREFIX + "." + TemporaryCacheKeys.INTERACTION_STATUS_KEY;
1187
+ }
1188
+ getInteractionInProgress() {
1189
+ const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;
1183
1190
  return this.getTemporaryCache(key, false);
1184
- };
1185
- BrowserCacheManager.prototype.setInteractionInProgress = function (inProgress) {
1191
+ }
1192
+ setInteractionInProgress(inProgress) {
1186
1193
  // Ensure we don't overwrite interaction in progress for a different clientId
1187
- var key = Constants.CACHE_PREFIX + "." + TemporaryCacheKeys.INTERACTION_STATUS_KEY;
1194
+ const key = `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.INTERACTION_STATUS_KEY}`;
1188
1195
  if (inProgress) {
1189
1196
  if (this.getInteractionInProgress()) {
1190
1197
  throw BrowserAuthError.createInteractionInProgressError();
@@ -1194,30 +1201,32 @@ var BrowserCacheManager = /** @class */ (function (_super) {
1194
1201
  this.setTemporaryCache(key, this.clientId, false);
1195
1202
  }
1196
1203
  }
1197
- else if (!inProgress && this.getInteractionInProgress() === this.clientId) {
1204
+ else if (!inProgress &&
1205
+ this.getInteractionInProgress() === this.clientId) {
1198
1206
  this.removeItem(key);
1199
1207
  }
1200
- };
1208
+ }
1201
1209
  /**
1202
1210
  * Returns username retrieved from ADAL or MSAL v1 idToken
1203
1211
  */
1204
- BrowserCacheManager.prototype.getLegacyLoginHint = function () {
1212
+ getLegacyLoginHint() {
1205
1213
  // Only check for adal/msal token if no SSO params are being used
1206
- var adalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ADAL_ID_TOKEN);
1214
+ const adalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ADAL_ID_TOKEN);
1207
1215
  if (adalIdTokenString) {
1208
1216
  this.browserStorage.removeItem(PersistentCacheKeys.ADAL_ID_TOKEN);
1209
1217
  this.logger.verbose("Cached ADAL id token retrieved.");
1210
1218
  }
1211
1219
  // Check for cached MSAL v1 id token
1212
- var msalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ID_TOKEN, true);
1220
+ const msalIdTokenString = this.getTemporaryCache(PersistentCacheKeys.ID_TOKEN, true);
1213
1221
  if (msalIdTokenString) {
1214
1222
  this.removeItem(this.generateCacheKey(PersistentCacheKeys.ID_TOKEN));
1215
1223
  this.logger.verbose("Cached MSAL.js v1 id token retrieved");
1216
1224
  }
1217
- var cachedIdTokenString = msalIdTokenString || adalIdTokenString;
1225
+ const cachedIdTokenString = msalIdTokenString || adalIdTokenString;
1218
1226
  if (cachedIdTokenString) {
1219
- var cachedIdToken = new IdToken(cachedIdTokenString, this.cryptoImpl);
1220
- if (cachedIdToken.claims && cachedIdToken.claims.preferred_username) {
1227
+ const cachedIdToken = new IdToken(cachedIdTokenString, this.cryptoImpl);
1228
+ if (cachedIdToken.claims &&
1229
+ cachedIdToken.claims.preferred_username) {
1221
1230
  this.logger.verbose("No SSO params used and ADAL/MSAL v1 token retrieved, setting ADAL/MSAL v1 preferred_username as loginHint");
1222
1231
  return cachedIdToken.claims.preferred_username;
1223
1232
  }
@@ -1230,48 +1239,47 @@ var BrowserCacheManager = /** @class */ (function (_super) {
1230
1239
  }
1231
1240
  }
1232
1241
  return null;
1233
- };
1242
+ }
1234
1243
  /**
1235
1244
  * Updates a credential's cache key if the current cache key is outdated
1236
1245
  */
1237
- BrowserCacheManager.prototype.updateCredentialCacheKey = function (currentCacheKey, credential) {
1238
- var updatedCacheKey = credential.generateCredentialKey();
1246
+ updateCredentialCacheKey(currentCacheKey, credential) {
1247
+ const updatedCacheKey = credential.generateCredentialKey();
1239
1248
  if (currentCacheKey !== updatedCacheKey) {
1240
- var cacheItem = this.getItem(currentCacheKey);
1249
+ const cacheItem = this.getItem(currentCacheKey);
1241
1250
  if (cacheItem) {
1242
1251
  this.removeItem(currentCacheKey);
1243
1252
  this.setItem(updatedCacheKey, cacheItem);
1244
- this.logger.verbose("Updated an outdated " + credential.credentialType + " cache key");
1253
+ this.logger.verbose(`Updated an outdated ${credential.credentialType} cache key`);
1245
1254
  return updatedCacheKey;
1246
1255
  }
1247
1256
  else {
1248
- this.logger.error("Attempted to update an outdated " + credential.credentialType + " cache key but no item matching the outdated key was found in storage");
1257
+ this.logger.error(`Attempted to update an outdated ${credential.credentialType} cache key but no item matching the outdated key was found in storage`);
1249
1258
  }
1250
1259
  }
1251
1260
  return currentCacheKey;
1252
- };
1261
+ }
1253
1262
  /**
1254
1263
  * Returns application id as redirect context during AcquireTokenRedirect flow.
1255
1264
  */
1256
- BrowserCacheManager.prototype.getRedirectRequestContext = function () {
1265
+ getRedirectRequestContext() {
1257
1266
  return this.getTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, true);
1258
- };
1267
+ }
1259
1268
  /**
1260
1269
  * Sets application id as the redirect context during AcquireTokenRedirect flow.
1261
1270
  * @param value
1262
1271
  */
1263
- BrowserCacheManager.prototype.setRedirectRequestContext = function (value) {
1272
+ setRedirectRequestContext(value) {
1264
1273
  this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_CONTEXT, value, true);
1265
- };
1266
- return BrowserCacheManager;
1267
- }(CacheManager));
1268
- var DEFAULT_BROWSER_CACHE_MANAGER = function (clientId, logger) {
1269
- var cacheOptions = {
1274
+ }
1275
+ }
1276
+ const DEFAULT_BROWSER_CACHE_MANAGER = (clientId, logger) => {
1277
+ const cacheOptions = {
1270
1278
  cacheLocation: BrowserCacheLocation.MemoryStorage,
1271
1279
  temporaryCacheLocation: BrowserCacheLocation.MemoryStorage,
1272
1280
  storeAuthStateInCookie: false,
1273
1281
  secureCookies: false,
1274
- cacheMigrationEnabled: false
1282
+ cacheMigrationEnabled: false,
1275
1283
  };
1276
1284
  return new BrowserCacheManager(clientId, cacheOptions, DEFAULT_CRYPTO_IMPLEMENTATION, logger);
1277
1285
  };