@azure/msal-browser 2.22.1 → 2.24.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 (170) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_tslib.js +1 -1
  3. package/dist/app/ClientApplication.d.ts +82 -2
  4. package/dist/app/ClientApplication.d.ts.map +1 -1
  5. package/dist/app/ClientApplication.js +388 -72
  6. package/dist/app/ClientApplication.js.map +1 -1
  7. package/dist/app/IPublicClientApplication.d.ts +4 -1
  8. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  9. package/dist/app/IPublicClientApplication.js +10 -1
  10. package/dist/app/IPublicClientApplication.js.map +1 -1
  11. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  12. package/dist/app/PublicClientApplication.js +80 -38
  13. package/dist/app/PublicClientApplication.js.map +1 -1
  14. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +49 -0
  15. package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -0
  16. package/dist/broker/nativeBroker/NativeMessageHandler.js +246 -0
  17. package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -0
  18. package/dist/broker/nativeBroker/NativeRequest.d.ts +44 -0
  19. package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -0
  20. package/dist/broker/nativeBroker/NativeResponse.d.ts +24 -0
  21. package/dist/broker/nativeBroker/NativeResponse.d.ts.map +1 -0
  22. package/dist/cache/AsyncMemoryStorage.d.ts +3 -2
  23. package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
  24. package/dist/cache/AsyncMemoryStorage.js +17 -6
  25. package/dist/cache/AsyncMemoryStorage.js.map +1 -1
  26. package/dist/cache/BrowserCacheManager.d.ts +11 -0
  27. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  28. package/dist/cache/BrowserCacheManager.js +49 -7
  29. package/dist/cache/BrowserCacheManager.js.map +1 -1
  30. package/dist/cache/BrowserStorage.js +1 -1
  31. package/dist/cache/DatabaseStorage.d.ts +5 -0
  32. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  33. package/dist/cache/DatabaseStorage.js +65 -13
  34. package/dist/cache/DatabaseStorage.js.map +1 -1
  35. package/dist/cache/MemoryStorage.js +1 -1
  36. package/dist/cache/TokenCache.js +1 -1
  37. package/dist/config/Configuration.d.ts +109 -36
  38. package/dist/config/Configuration.d.ts.map +1 -1
  39. package/dist/config/Configuration.js +19 -11
  40. package/dist/config/Configuration.js.map +1 -1
  41. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  42. package/dist/crypto/BrowserCrypto.js +7 -6
  43. package/dist/crypto/BrowserCrypto.js.map +1 -1
  44. package/dist/crypto/CryptoOps.d.ts +12 -3
  45. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  46. package/dist/crypto/CryptoOps.js +71 -36
  47. package/dist/crypto/CryptoOps.js.map +1 -1
  48. package/dist/crypto/GuidGenerator.d.ts +3 -2
  49. package/dist/crypto/GuidGenerator.d.ts.map +1 -1
  50. package/dist/crypto/GuidGenerator.js +4 -3
  51. package/dist/crypto/GuidGenerator.js.map +1 -1
  52. package/dist/crypto/PkceGenerator.js +1 -1
  53. package/dist/crypto/SignedHttpRequest.js +1 -1
  54. package/dist/encode/Base64Decode.d.ts.map +1 -1
  55. package/dist/encode/Base64Decode.js +3 -2
  56. package/dist/encode/Base64Decode.js.map +1 -1
  57. package/dist/encode/Base64Encode.d.ts.map +1 -1
  58. package/dist/encode/Base64Encode.js +5 -4
  59. package/dist/encode/Base64Encode.js.map +1 -1
  60. package/dist/error/BrowserAuthError.d.ts +58 -0
  61. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  62. package/dist/error/BrowserAuthError.js +73 -1
  63. package/dist/error/BrowserAuthError.js.map +1 -1
  64. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  65. package/dist/error/NativeAuthError.d.ts +46 -0
  66. package/dist/error/NativeAuthError.d.ts.map +1 -0
  67. package/dist/error/NativeAuthError.js +82 -0
  68. package/dist/error/NativeAuthError.js.map +1 -0
  69. package/dist/event/EventHandler.js +1 -1
  70. package/dist/event/EventMessage.js +1 -1
  71. package/dist/event/EventType.d.ts +2 -0
  72. package/dist/event/EventType.d.ts.map +1 -1
  73. package/dist/event/EventType.js +3 -1
  74. package/dist/event/EventType.js.map +1 -1
  75. package/dist/index.cjs.js +5899 -3880
  76. package/dist/index.cjs.js.map +1 -1
  77. package/dist/index.d.ts +7 -13
  78. package/dist/index.d.ts.map +1 -1
  79. package/dist/index.js +5 -13
  80. package/dist/index.js.map +1 -1
  81. package/dist/interaction_client/BaseInteractionClient.d.ts +13 -2
  82. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
  83. package/dist/interaction_client/BaseInteractionClient.js +37 -4
  84. package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
  85. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  86. package/dist/interaction_client/NativeInteractionClient.d.ts +57 -0
  87. package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -0
  88. package/dist/interaction_client/NativeInteractionClient.js +334 -0
  89. package/dist/interaction_client/NativeInteractionClient.js.map +1 -0
  90. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  91. package/dist/interaction_client/PopupClient.js +37 -8
  92. package/dist/interaction_client/PopupClient.js.map +1 -1
  93. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  94. package/dist/interaction_client/RedirectClient.js +40 -11
  95. package/dist/interaction_client/RedirectClient.js.map +1 -1
  96. package/dist/interaction_client/SilentAuthCodeClient.d.ts +3 -2
  97. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -1
  98. package/dist/interaction_client/SilentAuthCodeClient.js +5 -5
  99. package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
  100. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
  101. package/dist/interaction_client/SilentCacheClient.js +12 -6
  102. package/dist/interaction_client/SilentCacheClient.js.map +1 -1
  103. package/dist/interaction_client/SilentIframeClient.d.ts +5 -3
  104. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  105. package/dist/interaction_client/SilentIframeClient.js +51 -24
  106. package/dist/interaction_client/SilentIframeClient.js.map +1 -1
  107. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
  108. package/dist/interaction_client/SilentRefreshClient.js +16 -4
  109. package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
  110. package/dist/interaction_client/StandardInteractionClient.d.ts +2 -8
  111. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
  112. package/dist/interaction_client/StandardInteractionClient.js +32 -22
  113. package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
  114. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  115. package/dist/interaction_handler/InteractionHandler.js +15 -4
  116. package/dist/interaction_handler/InteractionHandler.js.map +1 -1
  117. package/dist/interaction_handler/PopupHandler.js +1 -1
  118. package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
  119. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  120. package/dist/interaction_handler/RedirectHandler.js +16 -9
  121. package/dist/interaction_handler/RedirectHandler.js.map +1 -1
  122. package/dist/interaction_handler/SilentHandler.js +1 -1
  123. package/dist/internals.d.ts +18 -0
  124. package/dist/internals.d.ts.map +1 -0
  125. package/dist/internals.js +20 -0
  126. package/dist/internals.js.map +1 -0
  127. package/dist/navigation/NavigationClient.js +1 -1
  128. package/dist/network/FetchClient.d.ts.map +1 -1
  129. package/dist/network/FetchClient.js +3 -2
  130. package/dist/network/FetchClient.js.map +1 -1
  131. package/dist/network/XhrClient.js +1 -1
  132. package/dist/packageMetadata.d.ts +1 -1
  133. package/dist/packageMetadata.js +2 -2
  134. package/dist/packageMetadata.js.map +1 -1
  135. package/dist/request/AuthorizationCodeRequest.d.ts +2 -1
  136. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
  137. package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
  138. package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
  139. package/dist/request/PopupRequest.d.ts +1 -1
  140. package/dist/request/PopupRequest.d.ts.map +1 -1
  141. package/dist/request/RedirectRequest.d.ts +1 -1
  142. package/dist/request/RedirectRequest.d.ts.map +1 -1
  143. package/dist/request/SsoSilentRequest.d.ts +1 -1
  144. package/dist/request/SsoSilentRequest.d.ts.map +1 -1
  145. package/dist/telemetry/BrowserPerformanceClient.d.ts +19 -0
  146. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -0
  147. package/dist/telemetry/BrowserPerformanceClient.js +52 -0
  148. package/dist/telemetry/BrowserPerformanceClient.js.map +1 -0
  149. package/dist/telemetry/BrowserPerformanceMeasurement.d.ts +13 -0
  150. package/dist/telemetry/BrowserPerformanceMeasurement.d.ts.map +1 -0
  151. package/dist/telemetry/BrowserPerformanceMeasurement.js +66 -0
  152. package/dist/telemetry/BrowserPerformanceMeasurement.js.map +1 -0
  153. package/dist/utils/BrowserConstants.d.ts +12 -1
  154. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  155. package/dist/utils/BrowserConstants.js +14 -2
  156. package/dist/utils/BrowserConstants.js.map +1 -1
  157. package/dist/utils/BrowserProtocolUtils.js +1 -1
  158. package/dist/utils/BrowserStringUtils.d.ts.map +1 -1
  159. package/dist/utils/BrowserStringUtils.js +4 -2
  160. package/dist/utils/BrowserStringUtils.js.map +1 -1
  161. package/dist/utils/BrowserUtils.d.ts +6 -0
  162. package/dist/utils/BrowserUtils.d.ts.map +1 -1
  163. package/dist/utils/BrowserUtils.js +12 -2
  164. package/dist/utils/BrowserUtils.js.map +1 -1
  165. package/dist/utils/MathUtils.js +1 -1
  166. package/dist/utils/PopupUtils.js +1 -1
  167. package/lib/msal-browser.js +5899 -3880
  168. package/lib/msal-browser.js.map +1 -1
  169. package/lib/msal-browser.min.js +41 -36
  170. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"ClientApplication.js","sources":["../../src/app/ClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CryptoOps } from \"../crypto/CryptoOps\";\nimport { StringUtils, ServerError, InteractionRequiredAuthError, AccountInfo, Constants, INetworkModule, AuthenticationResult, Logger, CommonSilentFlowRequest, ICrypto, DEFAULT_CRYPTO_IMPLEMENTATION } from \"@azure/msal-common\";\nimport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from \"../cache/BrowserCacheManager\";\nimport { BrowserConfiguration, buildConfiguration, Configuration } from \"../config/Configuration\";\nimport { InteractionType, ApiId, BrowserConstants, BrowserCacheLocation, WrapperSKU, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { version, name } from \"../packageMetadata\";\nimport { EventCallbackFunction } from \"../event/EventMessage\";\nimport { EventType } from \"../event/EventType\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserConfigurationAuthError } from \"../error/BrowserConfigurationAuthError\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { PopupClient } from \"../interaction_client/PopupClient\";\nimport { RedirectClient } from \"../interaction_client/RedirectClient\";\nimport { SilentIframeClient } from \"../interaction_client/SilentIframeClient\";\nimport { SilentRefreshClient } from \"../interaction_client/SilentRefreshClient\";\nimport { TokenCache } from \"../cache/TokenCache\";\nimport { ITokenCache } from \"../cache/ITokenCache\";\nimport { SilentAuthCodeClient } from \"../interaction_client/SilentAuthCodeClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\n\nexport abstract class ClientApplication {\n\n // Crypto interface implementation\n protected readonly browserCrypto: ICrypto;\n\n // Storage interface implementation\n protected readonly browserStorage: BrowserCacheManager;\n\n // Network interface implementation\n protected readonly networkClient: INetworkModule;\n\n // Navigation interface implementation\n protected navigationClient: INavigationClient;\n\n // Input configuration by developer/user\n protected config: BrowserConfiguration;\n\n // Token cache implementation\n private tokenCache: TokenCache;\n\n // Logger\n protected logger: Logger;\n\n // Flag to indicate if in browser environment\n protected isBrowserEnvironment: boolean;\n\n protected eventHandler: EventHandler;\n\n // Redirect Response Object\n protected redirectResponse: Map<string, Promise<AuthenticationResult | null>>;\n\n // Hybrid auth code responses\n private hybridAuthCodeResponses: Map<string, Promise<AuthenticationResult>>;\n\n /**\n * @constructor\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\n *\n * Important attributes in the Configuration object for auth are:\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\n * - authority: the authority URL for your application.\n * - redirect_uri: the uri of your application registered in the portal.\n *\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\n *\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\n * Full B2C functionality will be available in this library in future versions.\n *\n * @param configuration Object for the MSAL PublicClientApplication instance\n */\n constructor(configuration: Configuration) {\n /*\n * If loaded in an environment where window is not available,\n * set internal flag to false so that further requests fail.\n * This is to support server-side rendering environments.\n */\n this.isBrowserEnvironment = typeof window !== \"undefined\";\n // Set the configuration.\n this.config = buildConfiguration(configuration, this.isBrowserEnvironment);\n\n // Initialize logger\n this.logger = new Logger(this.config.system.loggerOptions, name, version);\n \n // Initialize the network module class.\n this.networkClient = this.config.system.networkClient;\n \n // Initialize the navigation client class.\n this.navigationClient = this.config.system.navigationClient;\n \n // Initialize redirectResponse Map\n this.redirectResponse = new Map();\n\n // Initial hybrid spa map\n this.hybridAuthCodeResponses = new Map();\n \n // Initialize the crypto class.\n this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger) : DEFAULT_CRYPTO_IMPLEMENTATION;\n\n this.eventHandler = new EventHandler(this.logger, this.browserCrypto);\n\n // Initialize the browser storage class.\n this.browserStorage = this.isBrowserEnvironment ? \n new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger) : \n DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);\n\n // Initialize the token cache\n this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);\n }\n\n // #region Redirect Flow\n\n /**\n * Event handler function which allows users to fire events after the PublicClientApplication object\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\n * auth flows.\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\n */\n async handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null> {\n this.logger.verbose(\"handleRedirectPromise called\");\n const loggedInAccounts = this.getAllAccounts();\n if (this.isBrowserEnvironment) {\n /**\n * Store the promise on the PublicClientApplication instance if this is the first invocation of handleRedirectPromise,\n * otherwise return the promise from the first invocation. Prevents race conditions when handleRedirectPromise is called\n * several times concurrently.\n */\n const redirectResponseKey = hash || Constants.EMPTY_STRING;\n let response = this.redirectResponse.get(redirectResponseKey);\n if (typeof response === \"undefined\") {\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, InteractionType.Redirect);\n this.logger.verbose(\"handleRedirectPromise has been called for the first time, storing the promise\");\n const correlationId = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || \"\";\n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, correlationId);\n response = redirectClient.handleRedirectPromise(hash)\n .then((result: AuthenticationResult | null) => {\n if (result) {\n // Emit login event if number of accounts change\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, login success\");\n } else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, acquire token success\");\n }\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n\n return result;\n })\n .catch((e) => {\n // Emit login event if there is an account\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n\n throw e;\n });\n this.redirectResponse.set(redirectResponseKey, response);\n } else {\n this.logger.verbose(\"handleRedirectPromise has been called previously, returning the result from the first call\");\n }\n \n return response;\n }\n this.logger.verbose(\"handleRedirectPromise returns null, not browser environment\");\n return null;\n }\n\n /**\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\n * the page, so any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n async acquireTokenRedirect(request: RedirectRequest): Promise<void> {\n // Preflight request\n this.logger.verbose(\"acquireTokenRedirect called\");\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n\n // If logged in, emit acquire token events\n const isLoggedIn = this.getAllAccounts().length > 0;\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Redirect, request);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Redirect, request);\n }\n \n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n return redirectClient.acquireToken(request).catch((e) => {\n // If logged in, emit acquire token events\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n throw e;\n });\n }\n\n // #endregion\n\n // #region Popup Flow\n\n /**\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult> {\n try {\n this.logger.verbose(\"acquireTokenPopup called\", request.correlationId);\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n } catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n\n // If logged in, emit acquire token events\n const loggedInAccounts = this.getAllAccounts();\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, request);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Popup, request);\n }\n\n const popupClient = new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n\n return popupClient.acquireToken(request).then((result) => {\n // If logged in, emit acquire token events\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Popup, result);\n } else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);\n }\n\n return result;\n }).catch((e) => {\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Popup, null, e);\n }\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n });\n }\n\n // #endregion\n\n // #region Silent Flow\n\n /**\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\n * - Any browser using a form of Intelligent Tracking Prevention\n * - If there is not an established session with the service\n *\n * In these cases, the request must be done inside a popup or full frame redirect.\n *\n * For the cases where interaction is required, you cannot send a request with prompt=none.\n *\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\n * you session on the server still exists.\n * @param request {@link SsoSilentRequest}\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult> {\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.verbose(\"ssoSilent called\", request.correlationId);\n this.eventHandler.emitEvent(EventType.SSO_SILENT_START, InteractionType.Silent, request);\n\n try {\n const silentIframeClient = new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, request.correlationId);\n const silentTokenResult = await silentIframeClient.acquireToken(request);\n this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, silentTokenResult);\n return silentTokenResult;\n } catch (e) {\n this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, InteractionType.Silent, null, e);\n throw e;\n }\n }\n\n /**\n * This function redeems an authorization code (passed as code) from the eSTS token endpoint.\n * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.\n * This API is not indended for normal authorization code acquisition and redemption.\n * \n * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.\n * \n * @param request {@link AuthorizationCodeRequest}\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.trace(\"acquireTokenByCode called\", request.correlationId);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);\n\n try {\n if (!request.code) {\n throw BrowserAuthError.createAuthCodeRequiredError();\n }\n\n let response = this.hybridAuthCodeResponses.get(request.code);\n if (!response) {\n this.logger.verbose(\"Initiating new acquireTokenByCode request\", request.correlationId);\n response = this.acquireTokenByCodeAsync(request)\n .then((result: AuthenticationResult) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, InteractionType.Silent, result);\n this.hybridAuthCodeResponses.delete(request.code);\n return result;\n })\n .catch((error: Error) => {\n this.hybridAuthCodeResponses.delete(request.code);\n throw error;\n });\n\n this.hybridAuthCodeResponses.set(request.code, response);\n } else {\n this.logger.verbose(\"Existing acquireTokenByCode request found\", request.correlationId);\n }\n \n return response;\n } catch (e) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, e);\n throw e;\n }\n }\n\n /**\n * Creates a SilentAuthCodeClient to redeem an authorization code.\n * @param request \n * @returns Result of the operation to redeem the authorization code\n */\n private async acquireTokenByCodeAsync(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n this.logger.trace(\"acquireTokenByCodeAsync called\", request.correlationId);\n const silentAuthCodeClient = new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, request.correlationId);\n const silentTokenResult = await silentAuthCodeClient.acquireToken(request);\n return silentTokenResult;\n }\n\n /**\n * Use this function to obtain a token before every call to the API / resource provider\n *\n * MSAL return's a cached token when available\n * Or it send's a request to the STS to obtain a new token using a refresh token.\n *\n * @param {@link SilentRequest}\n *\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n protected async acquireTokenByRefreshToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, request);\n // block the reload if it occurred inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n const silentRefreshClient = new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);\n\n return silentRefreshClient.acquireToken(request).catch(e => {\n const isServerError = e instanceof ServerError;\n const isInteractionRequiredError = e instanceof InteractionRequiredAuthError;\n const isInvalidGrantError = (e.errorCode === BrowserConstants.INVALID_GRANT_ERROR);\n if (isServerError && isInvalidGrantError && !isInteractionRequiredError) {\n this.logger.verbose(\"Refresh token expired or invalid, attempting acquire token by iframe\", request.correlationId);\n\n const silentIframeClient = new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenSilent_authCode, request.correlationId);\n return silentIframeClient.acquireToken(request);\n }\n throw e;\n });\n }\n\n // #endregion\n\n // #region Logout\n\n /**\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\n * @param logoutRequest \n * @deprecated\n */\n async logout(logoutRequest?: EndSessionRequest): Promise<void> {\n this.logger.warning(\"logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.\");\n return this.logoutRedirect(logoutRequest);\n }\n\n /**\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param logoutRequest\n */\n async logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void> {\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n const redirectClient = new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, logoutRequest?.correlationId);\n return redirectClient.logout(logoutRequest);\n }\n\n /**\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\n * @param logoutRequest \n */\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void> {\n try{\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n const popupClient = new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, logoutRequest?.correlationId);\n return popupClient.logout(logoutRequest);\n } catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n }\n\n // #endregion\n\n // #region Account APIs\n\n /**\n * Returns all accounts that MSAL currently has data for.\n * (the account object is created at the time of successful login)\n * or empty array when no accounts are found\n * @returns Array of account objects in cache\n */\n getAllAccounts(): AccountInfo[] {\n this.logger.verbose(\"getAllAccounts called\");\n return this.isBrowserEnvironment ? this.browserStorage.getAllAccounts() : [];\n }\n\n /**\n * Returns the signed in account matching username.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found.\n * This API is provided for convenience but getAccountById should be used for best reliability\n * @param userName\n * @returns The account object stored in MSAL\n */\n getAccountByUsername(userName: string): AccountInfo|null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(userName) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching username found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching username: ${userName}`);\n return allAccounts.filter(accountObj => accountObj.username.toLowerCase() === userName.toLowerCase())[0] || null;\n } else {\n this.logger.verbose(\"getAccountByUsername: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Returns the signed in account matching homeAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param homeAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByHomeId(homeAccountId: string): AccountInfo|null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(homeAccountId) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching homeAccountId found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching homeAccountId: ${homeAccountId}`);\n return allAccounts.filter(accountObj => accountObj.homeAccountId === homeAccountId)[0] || null;\n } else {\n this.logger.verbose(\"getAccountByHomeId: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Returns the signed in account matching localAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param localAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByLocalId(localAccountId: string): AccountInfo | null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(localAccountId) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching localAccountId found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching localAccountId: ${localAccountId}`);\n return allAccounts.filter(accountObj => accountObj.localAccountId === localAccountId)[0] || null;\n } else {\n this.logger.verbose(\"getAccountByLocalId: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\n * @param account\n */\n setActiveAccount(account: AccountInfo | null): void {\n this.browserStorage.setActiveAccount(account);\n }\n\n /**\n * Gets the currently active account\n */\n getActiveAccount(): AccountInfo | null {\n return this.browserStorage.getActiveAccount();\n }\n\n // #endregion\n\n // #region Helpers\n\n /**\n * Helper to validate app environment before making an auth request\n * * @param interactionType\n */\n protected preflightBrowserEnvironmentCheck(interactionType: InteractionType): void {\n this.logger.verbose(\"preflightBrowserEnvironmentCheck started\");\n // Block request if not in browser environment\n BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);\n\n // Block redirects if in an iframe\n BrowserUtils.blockRedirectInIframe(interactionType, this.config.system.allowRedirectInIframe);\n\n // Block auth requests inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n // Block redirectUri opened in a popup from calling MSAL APIs\n BrowserUtils.blockAcquireTokenInPopups();\n\n // Block redirects if memory storage is enabled but storeAuthStateInCookie is not\n if (interactionType === InteractionType.Redirect &&\n this.config.cache.cacheLocation === BrowserCacheLocation.MemoryStorage &&\n !this.config.cache.storeAuthStateInCookie) {\n throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();\n }\n\n if (interactionType === InteractionType.Redirect || interactionType === InteractionType.Popup) {\n this.preflightInteractiveRequest();\n }\n }\n\n /**\n * Helper to validate app environment before making a request.\n * @param request\n * @param interactionType\n */\n protected preflightInteractiveRequest(): void {\n this.logger.verbose(\"preflightInteractiveRequest called, validating app environment\");\n // block the reload if it occurred inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n // Set interaction in progress temporary cache or throw if alread set.\n this.browserStorage.setInteractionInProgress(true);\n }\n\n /**\n * Adds event callbacks to array\n * @param callback\n */\n addEventCallback(callback: EventCallbackFunction): string | null {\n return this.eventHandler.addEventCallback(callback);\n }\n\n /**\n * Removes callback with provided id from callback array\n * @param callbackId\n */\n removeEventCallback(callbackId: string): void {\n this.eventHandler.removeEventCallback(callbackId);\n }\n\n /**\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n enableAccountStorageEvents(): void {\n this.eventHandler.enableAccountStorageEvents();\n }\n\n /**\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n disableAccountStorageEvents(): void {\n this.eventHandler.disableAccountStorageEvents();\n }\n\n /**\n * Gets the token cache for the application.\n */\n getTokenCache(): ITokenCache {\n return this.tokenCache;\n }\n\n /**\n * Returns the logger instance\n */\n getLogger(): Logger {\n return this.logger;\n }\n\n /**\n * Replaces the default logger set in configurations with new Logger with new configurations\n * @param logger Logger instance\n */\n setLogger(logger: Logger): void {\n this.logger = logger;\n }\n\n /**\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\n * @param sku\n * @param version\n */\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void {\n // Validate the SKU passed in is one we expect\n this.browserStorage.setWrapperMetadata(sku, version);\n }\n\n /**\n * Sets navigation client\n * @param navigationClient\n */\n setNavigationClient(navigationClient: INavigationClient): void {\n this.navigationClient = navigationClient;\n }\n\n /**\n * Returns the configuration object\n */\n getConfiguration(): BrowserConfiguration {\n return this.config;\n }\n\n // #endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;IAuFI,2BAAY,aAA4B;;;;;;QAMpC,IAAI,CAAC,oBAAoB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;;QAE1D,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,aAAa,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;;QAG3E,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;;QAG1E,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC;;QAGtD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;;QAG5D,IAAI,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC;;QAGlC,IAAI,CAAC,uBAAuB,GAAG,IAAI,GAAG,EAAE,CAAC;;QAGzC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,oBAAoB,GAAG,IAAI,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,6BAA6B,CAAC;QAE5G,IAAI,CAAC,YAAY,GAAG,IAAI,YAAY,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;;QAGtE,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,oBAAoB;YAC3C,IAAI,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC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GAAe,EAAE,OAAe;;QAErD,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACxD;;;;;IAMD,+CAAmB,GAAnB,UAAoB,gBAAmC;QACnD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;KAC5C;;;;IAKD,4CAAgB,GAAhB;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;KACtB;IAGL,wBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"ClientApplication.js","sources":["../../src/app/ClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CryptoOps } from \"../crypto/CryptoOps\";\nimport { StringUtils, ServerError, InteractionRequiredAuthError, AccountInfo, Constants, INetworkModule, AuthenticationResult, Logger, CommonSilentFlowRequest, ICrypto, DEFAULT_CRYPTO_IMPLEMENTATION, AuthError, PerformanceEvents, PerformanceCallbackFunction, StubPerformanceClient, IPerformanceClient, BaseAuthRequest, PromptValue } from \"@azure/msal-common\";\nimport { BrowserCacheManager, DEFAULT_BROWSER_CACHE_MANAGER } from \"../cache/BrowserCacheManager\";\nimport { BrowserConfiguration, buildConfiguration, Configuration } from \"../config/Configuration\";\nimport { InteractionType, ApiId, BrowserConstants, BrowserCacheLocation, WrapperSKU, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { version, name } from \"../packageMetadata\";\nimport { EventCallbackFunction } from \"../event/EventMessage\";\nimport { EventType } from \"../event/EventType\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserConfigurationAuthError } from \"../error/BrowserConfigurationAuthError\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { PopupClient } from \"../interaction_client/PopupClient\";\nimport { RedirectClient } from \"../interaction_client/RedirectClient\";\nimport { SilentIframeClient } from \"../interaction_client/SilentIframeClient\";\nimport { SilentRefreshClient } from \"../interaction_client/SilentRefreshClient\";\nimport { TokenCache } from \"../cache/TokenCache\";\nimport { ITokenCache } from \"../cache/ITokenCache\";\nimport { NativeInteractionClient } from \"../interaction_client/NativeInteractionClient\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { NativeAuthError } from \"../error/NativeAuthError\";\nimport { SilentCacheClient } from \"../interaction_client/SilentCacheClient\";\nimport { SilentAuthCodeClient } from \"../interaction_client/SilentAuthCodeClient\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\nimport { NativeTokenRequest } from \"../broker/nativeBroker/NativeRequest\";\nimport { BrowserPerformanceClient } from \"../telemetry/BrowserPerformanceClient\";\n\nexport abstract class ClientApplication {\n\n // Crypto interface implementation\n protected readonly browserCrypto: ICrypto;\n\n // Storage interface implementation\n protected readonly browserStorage: BrowserCacheManager;\n\n // Network interface implementation\n protected readonly networkClient: INetworkModule;\n\n // Navigation interface implementation\n protected navigationClient: INavigationClient;\n\n // Input configuration by developer/user\n protected config: BrowserConfiguration;\n\n // Token cache implementation\n private tokenCache: TokenCache;\n\n // Logger\n protected logger: Logger;\n\n // Flag to indicate if in browser environment\n protected isBrowserEnvironment: boolean;\n\n protected eventHandler: EventHandler;\n\n // Redirect Response Object\n protected redirectResponse: Map<string, Promise<AuthenticationResult | null>>;\n\n // Native Extension Provider\n protected nativeExtensionProvider: NativeMessageHandler | undefined;\n\n // Hybrid auth code responses\n private hybridAuthCodeResponses: Map<string, Promise<AuthenticationResult>>;\n\n // Performance telemetry client\n protected performanceClient: IPerformanceClient;\n\n // Flag representing whether or not the initialize API has been called and completed\n protected initialized: boolean;\n\n /**\n * @constructor\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\n *\n * Important attributes in the Configuration object for auth are:\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\n * - authority: the authority URL for your application.\n * - redirect_uri: the uri of your application registered in the portal.\n *\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\n *\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\n * Full B2C functionality will be available in this library in future versions.\n *\n * @param configuration Object for the MSAL PublicClientApplication instance\n */\n constructor(configuration: Configuration) {\n /*\n * If loaded in an environment where window is not available,\n * set internal flag to false so that further requests fail.\n * This is to support server-side rendering environments.\n */\n this.isBrowserEnvironment = typeof window !== \"undefined\";\n // Set the configuration.\n this.config = buildConfiguration(configuration, this.isBrowserEnvironment);\n this.initialized = false;\n\n // Initialize logger\n this.logger = new Logger(this.config.system.loggerOptions, name, version);\n\n // Initialize the network module class.\n this.networkClient = this.config.system.networkClient;\n\n // Initialize the navigation client class.\n this.navigationClient = this.config.system.navigationClient;\n\n // Initialize redirectResponse Map\n this.redirectResponse = new Map();\n\n // Initial hybrid spa map\n this.hybridAuthCodeResponses = new Map();\n\n // Initialize performance client\n this.performanceClient = this.isBrowserEnvironment ?\n new BrowserPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application) :\n new StubPerformanceClient(this.config.auth.clientId, this.config.auth.authority, this.logger, name, version, this.config.telemetry.application);\n\n // Initialize the crypto class.\n this.browserCrypto = this.isBrowserEnvironment ? new CryptoOps(this.logger, this.performanceClient) : DEFAULT_CRYPTO_IMPLEMENTATION;\n\n this.eventHandler = new EventHandler(this.logger, this.browserCrypto);\n\n // Initialize the browser storage class.\n this.browserStorage = this.isBrowserEnvironment ?\n new BrowserCacheManager(this.config.auth.clientId, this.config.cache, this.browserCrypto, this.logger) :\n DEFAULT_BROWSER_CACHE_MANAGER(this.config.auth.clientId, this.logger);\n\n // Initialize the token cache\n this.tokenCache = new TokenCache(this.config, this.browserStorage, this.logger, this.browserCrypto);\n }\n\n /**\n * Initializer function to perform async startup tasks such as connecting to WAM extension\n */\n async initialize(): Promise<void> {\n this.logger.trace(\"initialize called\");\n if (this.initialized) {\n this.logger.warning(\"initialize has already been called. This function only needs to be run once.\");\n return;\n }\n this.eventHandler.emitEvent(EventType.INITIALIZE_START);\n if (this.config.system.allowNativeBroker) {\n try {\n this.nativeExtensionProvider = await NativeMessageHandler.createProvider(this.logger, this.config.system.nativeBrokerHandshakeTimeout);\n } catch (e) {\n this.logger.verbose(e);\n }\n }\n this.initialized = true;\n this.eventHandler.emitEvent(EventType.INITIALIZE_END);\n }\n\n // #region Redirect Flow\n\n /**\n * Event handler function which allows users to fire events after the PublicClientApplication object\n * has loaded during redirect flows. This should be invoked on all page loads involved in redirect\n * auth flows.\n * @param hash Hash to process. Defaults to the current value of window.location.hash. Only needs to be provided explicitly if the response to be handled is not contained in the current value.\n * @returns Token response or null. If the return value is null, then no auth redirect was detected.\n */\n async handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null> {\n this.logger.verbose(\"handleRedirectPromise called\");\n // Block token acquisition before initialize has been called if native brokering is enabled\n BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);\n\n const loggedInAccounts = this.getAllAccounts();\n if (this.isBrowserEnvironment) {\n /**\n * Store the promise on the PublicClientApplication instance if this is the first invocation of handleRedirectPromise,\n * otherwise return the promise from the first invocation. Prevents race conditions when handleRedirectPromise is called\n * several times concurrently.\n */\n const redirectResponseKey = hash || Constants.EMPTY_STRING;\n let response = this.redirectResponse.get(redirectResponseKey);\n if (typeof response === \"undefined\") {\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_START, InteractionType.Redirect);\n this.logger.verbose(\"handleRedirectPromise has been called for the first time, storing the promise\");\n\n const request: NativeTokenRequest | null = this.browserStorage.getCachedNativeRequest();\n let redirectResponse: Promise<AuthenticationResult | null>;\n if (request && NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider) && this.nativeExtensionProvider && !hash) {\n this.logger.trace(\"handleRedirectPromise - acquiring token from native platform\");\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.handleRedirectPromise, this.performanceClient, this.nativeExtensionProvider, request.accountId, request.correlationId);\n redirectResponse = nativeClient.handleRedirectPromise();\n } else {\n this.logger.trace(\"handleRedirectPromise - acquiring token from web flow\");\n const correlationId = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, true) || Constants.EMPTY_STRING;\n const redirectClient = this.createRedirectClient(correlationId);\n redirectResponse = redirectClient.handleRedirectPromise(hash);\n }\n\n response = redirectResponse.then((result: AuthenticationResult | null) => {\n if (result) {\n // Emit login event if number of accounts change\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, login success\");\n } else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Redirect, result);\n this.logger.verbose(\"handleRedirectResponse returned result, acquire token success\");\n }\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n\n return result;\n }).catch((e) => {\n // Emit login event if there is an account\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n this.eventHandler.emitEvent(EventType.HANDLE_REDIRECT_END, InteractionType.Redirect);\n\n throw e;\n });\n this.redirectResponse.set(redirectResponseKey, response);\n } else {\n this.logger.verbose(\"handleRedirectPromise has been called previously, returning the result from the first call\");\n }\n\n return response;\n }\n this.logger.verbose(\"handleRedirectPromise returns null, not browser environment\");\n return null;\n }\n\n /**\n * Use when you want to obtain an access_token for your API by redirecting the user's browser window to the authorization endpoint. This function redirects\n * the page, so any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n async acquireTokenRedirect(request: RedirectRequest): Promise<void> {\n // Preflight request\n const correlationId = this.getRequestCorrelationId(request);\n this.logger.verbose(\"acquireTokenRedirect called\", correlationId);\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n\n // If logged in, emit acquire token events\n const isLoggedIn = this.getAllAccounts().length > 0;\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Redirect, request);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Redirect, request);\n }\n\n let result: Promise<void>;\n\n if (this.nativeExtensionProvider && this.canUseNative(request)) {\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenRedirect, this.performanceClient, this.nativeExtensionProvider, this.getNativeAccountId(request), request.correlationId);\n result = nativeClient.acquireTokenRedirect(request).catch((e: AuthError) => {\n if (e instanceof NativeAuthError && e.isFatal()) {\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\n const redirectClient = this.createRedirectClient(request.correlationId);\n return redirectClient.acquireToken(request);\n }\n throw e;\n });\n } else {\n const redirectClient = this.createRedirectClient(request.correlationId);\n result = redirectClient.acquireToken(request);\n }\n\n return result.catch((e) => {\n // If logged in, emit acquire token events\n if (isLoggedIn) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Redirect, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Redirect, null, e);\n }\n throw e;\n });\n }\n\n // #endregion\n\n // #region Popup Flow\n\n /**\n * Use when you want to obtain an access_token for your API via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult> {\n const correlationId = this.getRequestCorrelationId(request);\n const atPopupMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenPopup, correlationId);\n\n try {\n this.logger.verbose(\"acquireTokenPopup called\", correlationId);\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n } catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n\n // If logged in, emit acquire token events\n const loggedInAccounts = this.getAllAccounts();\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Popup, request);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_START, InteractionType.Popup, request);\n }\n\n let result: Promise<AuthenticationResult>;\n\n if (this.canUseNative(request)) {\n result = this.acquireTokenNative(request, ApiId.acquireTokenPopup).then((response) => {\n this.browserStorage.setInteractionInProgress(false);\n atPopupMeasurement.endMeasurement({\n success: true,\n isNativeBroker: true\n });\n atPopupMeasurement.flushMeasurement();\n return response;\n }).catch((e: AuthError) => {\n if (e instanceof NativeAuthError && e.isFatal()) {\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\n const popupClient = this.createPopupClient(request.correlationId);\n return popupClient.acquireToken(request);\n }\n throw e;\n });\n } else {\n const popupClient = this.createPopupClient(request.correlationId);\n result = popupClient.acquireToken(request);\n }\n\n return result.then((result) => {\n // If logged in, emit acquire token events\n const isLoggingIn = loggedInAccounts.length < this.getAllAccounts().length;\n if (isLoggingIn) {\n this.eventHandler.emitEvent(EventType.LOGIN_SUCCESS, InteractionType.Popup, result);\n } else {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Popup, result);\n }\n\n atPopupMeasurement.endMeasurement({\n success: true\n });\n atPopupMeasurement.flushMeasurement();\n return result;\n }).catch((e) => {\n if (loggedInAccounts.length > 0) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Popup, null, e);\n } else {\n this.eventHandler.emitEvent(EventType.LOGIN_FAILURE, InteractionType.Popup, null, e);\n }\n\n atPopupMeasurement.endMeasurement({\n success: false\n });\n atPopupMeasurement.flushMeasurement();\n\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n });\n }\n\n // #endregion\n\n // #region Silent Flow\n\n /**\n * This function uses a hidden iframe to fetch an authorization code from the eSTS. There are cases where this may not work:\n * - Any browser using a form of Intelligent Tracking Prevention\n * - If there is not an established session with the service\n *\n * In these cases, the request must be done inside a popup or full frame redirect.\n *\n * For the cases where interaction is required, you cannot send a request with prompt=none.\n *\n * If your refresh token has expired, you can use this function to fetch a new set of tokens silently as long as\n * you session on the server still exists.\n * @param request {@link SsoSilentRequest}\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult> {\n const correlationId = this.getRequestCorrelationId(request);\n const validRequest = {\n ...request,\n prompt: PromptValue.NONE,\n correlationId: correlationId\n };\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n const ssoSilentMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.SsoSilent, correlationId);\n this.logger.verbose(\"ssoSilent called\", correlationId);\n this.eventHandler.emitEvent(EventType.SSO_SILENT_START, InteractionType.Silent, validRequest);\n\n let result: Promise<AuthenticationResult>;\n\n if (this.canUseNative(validRequest)) {\n result = this.acquireTokenNative(validRequest, ApiId.ssoSilent).catch((e: AuthError) => {\n // If native token acquisition fails for availability reasons fallback to standard flow\n if (e instanceof NativeAuthError && e.isFatal()) {\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\n const silentIframeClient = this.createSilentIframeClient(validRequest.correlationId);\n return silentIframeClient.acquireToken(validRequest);\n }\n throw e;\n });\n } else {\n const silentIframeClient = this.createSilentIframeClient(validRequest.correlationId);\n result = silentIframeClient.acquireToken(validRequest);\n }\n\n return result.then((response) => {\n this.eventHandler.emitEvent(EventType.SSO_SILENT_SUCCESS, InteractionType.Silent, response);\n ssoSilentMeasurement.endMeasurement({\n success: true\n });\n ssoSilentMeasurement.flushMeasurement();\n return response;\n }).catch ((e) => {\n this.eventHandler.emitEvent(EventType.SSO_SILENT_FAILURE, InteractionType.Silent, null, e);\n ssoSilentMeasurement.endMeasurement({\n success: false\n });\n ssoSilentMeasurement.flushMeasurement();\n throw e;\n });\n }\n\n /**\n * This function redeems an authorization code (passed as code) from the eSTS token endpoint.\n * This authorization code should be acquired server-side using a confidential client to acquire a spa_code.\n * This API is not indended for normal authorization code acquisition and redemption.\n *\n * Redemption of this authorization code will not require PKCE, as it was acquired by a confidential client.\n *\n * @param request {@link AuthorizationCodeRequest}\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n async acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n const correlationId = this.getRequestCorrelationId(request);\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.trace(\"acquireTokenByCode called\", correlationId);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_START, InteractionType.Silent, request);\n const atbcMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByCode, request.correlationId);\n\n try {\n if (request.code) {\n const hybridAuthCode = request.code;\n let response = this.hybridAuthCodeResponses.get(hybridAuthCode);\n if (!response) {\n this.logger.verbose(\"Initiating new acquireTokenByCode request\", correlationId);\n response = this.acquireTokenByCodeAsync({\n ...request,\n correlationId\n })\n .then((result: AuthenticationResult) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_SUCCESS, InteractionType.Silent, result);\n this.hybridAuthCodeResponses.delete(hybridAuthCode);\n atbcMeasurement.endMeasurement({\n success: true\n });\n atbcMeasurement.flushMeasurement();\n return result;\n })\n .catch((error: Error) => {\n this.hybridAuthCodeResponses.delete(hybridAuthCode);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, error);\n atbcMeasurement.endMeasurement({\n success: false\n });\n atbcMeasurement.flushMeasurement();\n throw error;\n });\n this.hybridAuthCodeResponses.set(hybridAuthCode, response);\n } else {\n this.logger.verbose(\"Existing acquireTokenByCode request found\", request.correlationId);\n atbcMeasurement.endMeasurement({\n success: true\n });\n atbcMeasurement.discardMeasurement();\n }\n return response;\n } else if (request.nativeAccountId) {\n if (this.canUseNative(request, request.nativeAccountId)) {\n return this.acquireTokenNative(request, ApiId.acquireTokenByCode, request.nativeAccountId).catch((e: AuthError) => {\n // If native token acquisition fails for availability reasons fallback to standard flow\n if (e instanceof NativeAuthError && e.isFatal()) {\n this.nativeExtensionProvider = undefined; // If extension gets uninstalled during session prevent future requests from continuing to attempt\n }\n throw e;\n });\n } else {\n throw BrowserAuthError.createUnableToAcquireTokenFromNativePlatformError();\n }\n } else {\n throw BrowserAuthError.createAuthCodeOrNativeAccountIdRequiredError();\n }\n\n } catch (e) {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_BY_CODE_FAILURE, InteractionType.Silent, null, e);\n atbcMeasurement.endMeasurement({\n success: false\n });\n throw e;\n }\n }\n\n /**\n * Creates a SilentAuthCodeClient to redeem an authorization code.\n * @param request\n * @returns Result of the operation to redeem the authorization code\n */\n private async acquireTokenByCodeAsync(request: AuthorizationCodeRequest): Promise<AuthenticationResult> {\n this.logger.trace(\"acquireTokenByCodeAsync called\", request.correlationId);\n const silentAuthCodeClient = this.createSilentAuthCodeClient(request.correlationId);\n const silentTokenResult = await silentAuthCodeClient.acquireToken(request);\n return silentTokenResult;\n }\n\n /**\n * Use this function to obtain a token before every call to the API / resource provider\n *\n * MSAL return's a cached token when available\n * Or it send's a request to the STS to obtain a new token using a refresh token.\n *\n * @param {@link SilentRequest}\n *\n * To renew idToken, please pass clientId as the only scope in the Authentication Parameters\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n protected async acquireTokenByRefreshToken(request: CommonSilentFlowRequest): Promise<AuthenticationResult> {\n // block the reload if it occurred inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n const atbrtMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenByRefreshToken, request.correlationId);\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_NETWORK_START, InteractionType.Silent, request);\n\n const silentRefreshClient = this.createSilentRefreshClient(request.correlationId);\n\n return silentRefreshClient.acquireToken(request)\n .then((result: AuthenticationResult) => {\n atbrtMeasurement.endMeasurement({\n success: true,\n fromCache: result.fromCache\n });\n return result;\n })\n .catch(e => {\n const isServerError = e instanceof ServerError;\n const isInteractionRequiredError = e instanceof InteractionRequiredAuthError;\n const isInvalidGrantError = (e.errorCode === BrowserConstants.INVALID_GRANT_ERROR);\n if (isServerError && isInvalidGrantError && !isInteractionRequiredError) {\n this.logger.verbose(\"Refresh token expired or invalid, attempting acquire token by iframe\", request.correlationId);\n\n const silentIframeClient = this.createSilentIframeClient(request.correlationId);\n return silentIframeClient.acquireToken(request)\n .then((result: AuthenticationResult) => {\n atbrtMeasurement.endMeasurement({\n success: true,\n fromCache: result.fromCache\n });\n\n return result;\n })\n .catch((error) => {\n atbrtMeasurement.endMeasurement({\n success: false\n });\n throw error;\n });\n }\n atbrtMeasurement.endMeasurement({\n success: false\n });\n throw e;\n });\n }\n\n // #endregion\n\n // #region Logout\n\n /**\n * Deprecated logout function. Use logoutRedirect or logoutPopup instead\n * @param logoutRequest\n * @deprecated\n */\n async logout(logoutRequest?: EndSessionRequest): Promise<void> {\n const correlationId = this.getRequestCorrelationId(logoutRequest);\n this.logger.warning(\"logout API is deprecated and will be removed in msal-browser v3.0.0. Use logoutRedirect instead.\", correlationId);\n return this.logoutRedirect({\n correlationId,\n ...logoutRequest\n });\n }\n\n /**\n * Use to log out the current user, and redirect the user to the postLogoutRedirectUri.\n * Default behaviour is to redirect the user to `window.location.href`.\n * @param logoutRequest\n */\n async logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void> {\n const correlationId = this.getRequestCorrelationId(logoutRequest);\n this.preflightBrowserEnvironmentCheck(InteractionType.Redirect);\n\n const redirectClient = this.createRedirectClient(correlationId);\n return redirectClient.logout(logoutRequest);\n }\n\n /**\n * Clears local cache for the current user then opens a popup window prompting the user to sign-out of the server\n * @param logoutRequest\n */\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void> {\n try{\n const correlationId = this.getRequestCorrelationId(logoutRequest);\n this.preflightBrowserEnvironmentCheck(InteractionType.Popup);\n const popupClient = this.createPopupClient(correlationId);\n return popupClient.logout(logoutRequest);\n } catch (e) {\n // Since this function is syncronous we need to reject\n return Promise.reject(e);\n }\n }\n\n // #endregion\n\n // #region Account APIs\n\n /**\n * Returns all accounts that MSAL currently has data for.\n * (the account object is created at the time of successful login)\n * or empty array when no accounts are found\n * @returns Array of account objects in cache\n */\n getAllAccounts(): AccountInfo[] {\n this.logger.verbose(\"getAllAccounts called\");\n return this.isBrowserEnvironment ? this.browserStorage.getAllAccounts() : [];\n }\n\n /**\n * Returns the signed in account matching username.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found.\n * This API is provided for convenience but getAccountById should be used for best reliability\n * @param userName\n * @returns The account object stored in MSAL\n */\n getAccountByUsername(userName: string): AccountInfo|null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(userName) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching username found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching username: ${userName}`);\n return allAccounts.filter(accountObj => accountObj.username.toLowerCase() === userName.toLowerCase())[0] || null;\n } else {\n this.logger.verbose(\"getAccountByUsername: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Returns the signed in account matching homeAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param homeAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByHomeId(homeAccountId: string): AccountInfo|null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(homeAccountId) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching homeAccountId found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching homeAccountId: ${homeAccountId}`);\n return allAccounts.filter(accountObj => accountObj.homeAccountId === homeAccountId)[0] || null;\n } else {\n this.logger.verbose(\"getAccountByHomeId: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Returns the signed in account matching localAccountId.\n * (the account object is created at the time of successful login)\n * or null when no matching account is found\n * @param localAccountId\n * @returns The account object stored in MSAL\n */\n getAccountByLocalId(localAccountId: string): AccountInfo | null {\n const allAccounts = this.getAllAccounts();\n if (!StringUtils.isEmpty(localAccountId) && allAccounts && allAccounts.length) {\n this.logger.verbose(\"Account matching localAccountId found, returning\");\n this.logger.verbosePii(`Returning signed-in accounts matching localAccountId: ${localAccountId}`);\n return allAccounts.filter(accountObj => accountObj.localAccountId === localAccountId)[0] || null;\n } else {\n this.logger.verbose(\"getAccountByLocalId: No matching account found, returning null\");\n return null;\n }\n }\n\n /**\n * Sets the account to use as the active account. If no account is passed to the acquireToken APIs, then MSAL will use this active account.\n * @param account\n */\n setActiveAccount(account: AccountInfo | null): void {\n this.browserStorage.setActiveAccount(account);\n }\n\n /**\n * Gets the currently active account\n */\n getActiveAccount(): AccountInfo | null {\n return this.browserStorage.getActiveAccount();\n }\n\n // #endregion\n\n // #region Helpers\n\n /**\n * Helper to validate app environment before making an auth request\n * * @param interactionType\n */\n protected preflightBrowserEnvironmentCheck(interactionType: InteractionType): void {\n this.logger.verbose(\"preflightBrowserEnvironmentCheck started\");\n // Block request if not in browser environment\n BrowserUtils.blockNonBrowserEnvironment(this.isBrowserEnvironment);\n\n // Block redirects if in an iframe\n BrowserUtils.blockRedirectInIframe(interactionType, this.config.system.allowRedirectInIframe);\n\n // Block auth requests inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n // Block redirectUri opened in a popup from calling MSAL APIs\n BrowserUtils.blockAcquireTokenInPopups();\n\n // Block token acquisition before initialize has been called if native brokering is enabled\n BrowserUtils.blockNativeBrokerCalledBeforeInitialized(this.config.system.allowNativeBroker, this.initialized);\n\n // Block redirects if memory storage is enabled but storeAuthStateInCookie is not\n if (interactionType === InteractionType.Redirect &&\n this.config.cache.cacheLocation === BrowserCacheLocation.MemoryStorage &&\n !this.config.cache.storeAuthStateInCookie) {\n throw BrowserConfigurationAuthError.createInMemoryRedirectUnavailableError();\n }\n\n if (interactionType === InteractionType.Redirect || interactionType === InteractionType.Popup) {\n this.preflightInteractiveRequest();\n }\n }\n\n /**\n * Helper to validate app environment before making a request.\n * @param request\n * @param interactionType\n */\n protected preflightInteractiveRequest(): void {\n this.logger.verbose(\"preflightInteractiveRequest called, validating app environment\");\n // block the reload if it occurred inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n\n // Set interaction in progress temporary cache or throw if alread set.\n this.browserStorage.setInteractionInProgress(true);\n }\n\n /**\n * Acquire a token from native device (e.g. WAM)\n * @param request\n */\n protected async acquireTokenNative(request: PopupRequest|SilentRequest|SsoSilentRequest, apiId: ApiId, accountId?: string): Promise<AuthenticationResult> {\n this.logger.trace(\"acquireTokenNative called\");\n if (!this.nativeExtensionProvider) {\n throw BrowserAuthError.createNativeConnectionNotEstablishedError();\n }\n\n const nativeClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, apiId, this.performanceClient, this.nativeExtensionProvider, accountId || this.getNativeAccountId(request), request.correlationId);\n\n return nativeClient.acquireToken(request);\n }\n\n /**\n * Returns boolean indicating if this request can use the native broker\n * @param request\n */\n protected canUseNative(request: RedirectRequest|PopupRequest|SsoSilentRequest, accountId?: string): boolean {\n this.logger.trace(\"canUseNative called\");\n if (!NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme)) {\n this.logger.trace(\"canUseNative: isNativeAvailable returned false, returning false\");\n return false;\n }\n\n if (request.prompt) {\n switch (request.prompt) {\n case PromptValue.NONE:\n case PromptValue.CONSENT:\n this.logger.trace(\"canUseNative: prompt is compatible with native flow\");\n break;\n default:\n this.logger.trace(`canUseNative: prompt = ${request.prompt} is not compatible with native flow, returning false`);\n return false;\n }\n }\n\n if (!accountId && !this.getNativeAccountId(request)) {\n this.logger.trace(\"canUseNative: nativeAccountId is not available, returning false\");\n return false;\n }\n\n return true;\n }\n\n /**\n * Get the native accountId from the account\n * @param request\n * @returns\n */\n protected getNativeAccountId(request: RedirectRequest|PopupRequest|SsoSilentRequest): string {\n const account = request.account || this.browserStorage.getAccountInfoByHints(request.loginHint, request.sid) || this.getActiveAccount();\n\n return account && account.nativeAccountId || \"\";\n }\n\n /**\n * Returns new instance of the Popup Interaction Client\n * @param correlationId\n */\n protected createPopupClient(correlationId?: string): PopupClient {\n return new PopupClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n\n /**\n * Returns new instance of the Popup Interaction Client\n * @param correlationId\n */\n protected createRedirectClient(correlationId?: string): RedirectClient {\n return new RedirectClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n\n /**\n * Returns new instance of the Silent Iframe Interaction Client\n * @param correlationId\n */\n protected createSilentIframeClient(correlationId?: string): SilentIframeClient {\n return new SilentIframeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.ssoSilent, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n\n /**\n * Returns new instance of the Silent Cache Interaction Client\n */\n protected createSilentCacheClient(correlationId?: string): SilentCacheClient {\n return new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n\n /**\n * Returns new instance of the Silent Refresh Interaction Client\n */\n protected createSilentRefreshClient(correlationId?: string): SilentRefreshClient {\n return new SilentRefreshClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n\n /**\n * Returns new instance of the Silent AuthCode Interaction Client\n */\n protected createSilentAuthCodeClient(correlationId?: string): SilentAuthCodeClient {\n return new SilentAuthCodeClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenByCode, this.performanceClient, this.nativeExtensionProvider, correlationId);\n }\n\n /**\n * Adds event callbacks to array\n * @param callback\n */\n addEventCallback(callback: EventCallbackFunction): string | null {\n return this.eventHandler.addEventCallback(callback);\n }\n\n /**\n * Removes callback with provided id from callback array\n * @param callbackId\n */\n removeEventCallback(callbackId: string): void {\n this.eventHandler.removeEventCallback(callbackId);\n }\n\n /**\n * Registers a callback to receive performance events.\n *\n * @param {PerformanceCallbackFunction} callback\n * @returns {string}\n */\n addPerformanceCallback(callback: PerformanceCallbackFunction): string {\n return this.performanceClient.addPerformanceCallback(callback);\n }\n\n /**\n * Removes a callback registered with addPerformanceCallback.\n *\n * @param {string} callbackId\n * @returns {boolean}\n */\n removePerformanceCallback(callbackId: string): boolean {\n return this.performanceClient.removePerformanceCallback(callbackId);\n }\n\n /**\n * Adds event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n enableAccountStorageEvents(): void {\n this.eventHandler.enableAccountStorageEvents();\n }\n\n /**\n * Removes event listener that emits an event when a user account is added or removed from localstorage in a different browser tab or window\n */\n disableAccountStorageEvents(): void {\n this.eventHandler.disableAccountStorageEvents();\n }\n\n /**\n * Gets the token cache for the application.\n */\n getTokenCache(): ITokenCache {\n return this.tokenCache;\n }\n\n /**\n * Returns the logger instance\n */\n getLogger(): Logger {\n return this.logger;\n }\n\n /**\n * Replaces the default logger set in configurations with new Logger with new configurations\n * @param logger Logger instance\n */\n setLogger(logger: Logger): void {\n this.logger = logger;\n }\n\n /**\n * Called by wrapper libraries (Angular & React) to set SKU and Version passed down to telemetry, logger, etc.\n * @param sku\n * @param version\n */\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void {\n // Validate the SKU passed in is one we expect\n this.browserStorage.setWrapperMetadata(sku, version);\n }\n\n /**\n * Sets navigation client\n * @param navigationClient\n */\n setNavigationClient(navigationClient: INavigationClient): void {\n this.navigationClient = navigationClient;\n }\n\n /**\n * Returns the configuration object\n */\n getConfiguration(): BrowserConfiguration {\n return this.config;\n }\n\n /**\n * Generates a correlation id for a request if none is provided.\n *\n * @protected\n * @param {?Partial<BaseAuthRequest>} [request]\n * @returns {string}\n */\n protected getRequestCorrelationId(request?: Partial<BaseAuthRequest>): string {\n if (request?.correlationId) {\n return request.correlationId;\n }\n\n if (this.isBrowserEnvironment) {\n return this.browserCrypto.createNewGuid();\n }\n\n /*\n * Included for fallback for non-browser environments,\n * and to ensure this method always returns a string.\n */\n return Constants.EMPTY_STRING;\n }\n\n // #endregion\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;IAuGI,2BAAY,aAA4B;;;;;;QAMpC,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c;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACxB;;;;;;IAOD,oDAAwB,GAAxB,UAAyB,GAAe,EAAE,OAAe;;QAErD,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;KACxD;;;;;IAMD,+CAAmB,GAAnB,UAAoB,gBAAmC;QACnD,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;KAC5C;;;;IAKD,4CAAgB,GAAhB;QACI,OAAO,IAAI,CAAC,MAAM,CAAC;KACtB;;;;;;;;IASS,mDAAuB,GAAjC,UAAkC,OAAkC;QAChE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,EAAE;YACxB,OAAO,OAAO,CAAC,aAAa,CAAC;SAChC;QAED,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC3B,OAAO,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;SAC7C;;;;;QAMD,OAAO,SAAS,CAAC,YAAY,CAAC;KACjC;IAGL,wBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- import { AuthenticationResult, AccountInfo, Logger } from "@azure/msal-common";
1
+ import { AuthenticationResult, AccountInfo, Logger, PerformanceCallbackFunction } from "@azure/msal-common";
2
2
  import { RedirectRequest } from "../request/RedirectRequest";
3
3
  import { PopupRequest } from "../request/PopupRequest";
4
4
  import { SilentRequest } from "../request/SilentRequest";
@@ -11,12 +11,15 @@ import { ITokenCache } from "../cache/ITokenCache";
11
11
  import { AuthorizationCodeRequest } from "../request/AuthorizationCodeRequest";
12
12
  import { BrowserConfiguration } from "../config/Configuration";
13
13
  export interface IPublicClientApplication {
14
+ initialize(): Promise<void>;
14
15
  acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;
15
16
  acquireTokenRedirect(request: RedirectRequest): Promise<void>;
16
17
  acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;
17
18
  acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;
18
19
  addEventCallback(callback: Function): string | null;
19
20
  removeEventCallback(callbackId: string): void;
21
+ addPerformanceCallback(callback: PerformanceCallbackFunction): string;
22
+ removePerformanceCallback(callbackId: string): boolean;
20
23
  enableAccountStorageEvents(): void;
21
24
  disableAccountStorageEvents(): void;
22
25
  getAccountByHomeId(homeAccountId: string): AccountInfo | null;
@@ -1 +1 @@
1
- {"version":3,"file":"IPublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/IPublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE/D,MAAM,WAAW,wBAAwB;IACrC,iBAAiB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACxE,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,kBAAkB,CAAC,aAAa,EAAE,aAAa,GAAG,OA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AAC;IACjE,WAAW,CAAC,aAAa,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnE,SAAS,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACpE,aAAa,IAAI,WAAW,CAAC;IAC7B,SAAS,IAAI,MAAM,CAAC;IACpB,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,IAAI,CAAC;IACpD,gBAAgB,IAAI,WAAW,GAAG,IAAI,CAAC;IACvC,wBAAwB,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACjE,mBAAmB,CAAC,gBAAgB,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAC/D,gBAAgB,IAAI,oBAAoB,CAAC;CAC5C;AAED,eAAO,MAAM,8BAA8B,EAAE,wBA2F5C,CAAC"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.22.1 2022-03-07 */
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
2
  'use strict';
3
3
  import { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';
4
4
 
@@ -7,6 +7,9 @@ import { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuth
7
7
  * Licensed under the MIT License.
8
8
  */
9
9
  var stubbedPublicClientApplication = {
10
+ initialize: function () {
11
+ return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
12
+ },
10
13
  acquireTokenPopup: function () {
11
14
  return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());
12
15
  },
@@ -58,6 +61,12 @@ var stubbedPublicClientApplication = {
58
61
  removeEventCallback: function () {
59
62
  return;
60
63
  },
64
+ addPerformanceCallback: function () {
65
+ return "";
66
+ },
67
+ removePerformanceCallback: function () {
68
+ return false;
69
+ },
61
70
  enableAccountStorageEvents: function () {
62
71
  return;
63
72
  },
@@ -1 +1 @@
1
- {"version":3,"file":"IPublicClientApplication.js","sources":["../../src/app/IPublicClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, AccountInfo, Logger } from \"@azure/msal-common\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserConfigurationAuthError } from \"../error/BrowserConfigurationAuthError\";\nimport { WrapperSKU } from \"../utils/BrowserConstants\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { ITokenCache } from \"../cache/ITokenCache\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\n\nexport interface IPublicClientApplication {\n acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;\n acquireTokenRedirect(request: RedirectRequest): Promise<void>;\n acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;\n acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;\n addEventCallback(callback: Function): string | null;\n removeEventCallback(callbackId: string): void;\n enableAccountStorageEvents(): void;\n disableAccountStorageEvents(): void;\n getAccountByHomeId(homeAccountId: string): AccountInfo | null;\n getAccountByLocalId(localId: string): AccountInfo | null;\n getAccountByUsername(userName: string): AccountInfo | null;\n getAllAccounts(): AccountInfo[];\n handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;\n loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;\n loginRedirect(request?: RedirectRequest): Promise<void>;\n logout(logoutRequest?: EndSessionRequest): Promise<void>;\n logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;\n ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;\n getTokenCache(): ITokenCache;\n getLogger(): Logger;\n setLogger(logger: Logger): void;\n setActiveAccount(account: AccountInfo | null): void;\n getActiveAccount(): AccountInfo | null;\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void;\n setNavigationClient(navigationClient: INavigationClient): void;\n getConfiguration(): BrowserConfiguration;\n}\n\nexport const stubbedPublicClientApplication: IPublicClientApplication = {\n acquireTokenPopup: () => {\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\n },\n acquireTokenRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n acquireTokenSilent: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n acquireTokenByCode: () => {\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\n },\n getAllAccounts: () => {\n return [];\t\n },\t\n getAccountByHomeId: () => {\n return null;\n },\n getAccountByUsername: () => {\t\n return null;\t\n },\t\n getAccountByLocalId: () => {\n return null;\n },\n handleRedirectPromise: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n loginPopup: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n loginRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n logout: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n logoutRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n logoutPopup: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n ssoSilent: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n addEventCallback: () => {\n return null;\n },\n removeEventCallback: () => {\n return;\n },\n enableAccountStorageEvents: () => {\n return;\n },\n disableAccountStorageEvents: () => {\n return;\n },\n getTokenCache: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n },\n getLogger: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n },\n setLogger: () => {\n return;\n },\n setActiveAccount: () => {\n return;\n },\n getActiveAccount: () => {\n return null;\n },\n initializeWrapperLibrary: () => {\n return;\n },\n setNavigationClient: () => {\n return;\n },\n getConfiguration: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n }\n};\n"],"names":[],"mappings":";;;;AAAA;;;;IAiDa,8BAA8B,GAA6B;IACpE,iBAAiB,EAAE;QACf,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,oBAAoB,EAAE;QAClB,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,kBAAkB,EAAE;QAChB,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,kBAAkB,EAAE;QAChB,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,cAAc,EAAE;QACZ,OAAO,EAAE,CAAC;KACb;IACD,kBAAkB,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,oBAAoB,EAAE;QAClB,OAAO,IAAI,CAAC;KACf;IACD,mBAAmB,EAAE;QACjB,OAAO,IAAI,CAAC;KACf;IACD,qBAAqB,EAAE;QACnB,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,UAAU,EAAE;QACR,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,aAAa,EAAE;QACX,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,MAAM,EAAE;QACJ,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,cAAc,EAAE;QACZ,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,WAAW,EAAE;QACT,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,SAAS,EAAE;QACP,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,gBAAgB,EAAE;QACd,OAAO,IAAI,CAAC;KACf;IACD,mBAAmB,EAAE;QACjB,OAAO;KACV;IACD,0BAA0B,EAAE;QACxB,OAAO;KACV;IACD,2BAA2B,EAAE;QACzB,OAAO;KACV;IACD,aAAa,EAAE;QACX,MAAM,6BAA6B,CAAC,gCAAgC,EAAE,CAAC;KAC1E;IACD,SAAS,EAAE;QACP,MAAM,6BAA6B,CAAC,gCAAgC,EAAE,CAAC;KAC1E;IACD,SAAS,EAAE;QACP,OAAO;KACV;IACD,gBAAgB,EAAE;QACd,OAAO;KACV;IACD,gBAAgB,EAAE;QACd,OAAO,IAAI,CAAC;KACf;IACD,wBAAwB,EAAE;QACtB,OAAO;KACV;IACD,mBAAmB,EAAE;QACjB,OAAO;KACV;IACD,gBAAgB,EAAE;QACd,MAAM,6BAA6B,CAAC,gCAAgC,EAAE,CAAC;KAC1E;;;;;"}
1
+ {"version":3,"file":"IPublicClientApplication.js","sources":["../../src/app/IPublicClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthenticationResult, AccountInfo, Logger, PerformanceCallbackFunction } from \"@azure/msal-common\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserConfigurationAuthError } from \"../error/BrowserConfigurationAuthError\";\nimport { WrapperSKU } from \"../utils/BrowserConstants\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { EndSessionPopupRequest } from \"../request/EndSessionPopupRequest\";\nimport { ITokenCache } from \"../cache/ITokenCache\";\nimport { AuthorizationCodeRequest } from \"../request/AuthorizationCodeRequest\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\n\nexport interface IPublicClientApplication {\n initialize(): Promise<void>;\n acquireTokenPopup(request: PopupRequest): Promise<AuthenticationResult>;\n acquireTokenRedirect(request: RedirectRequest): Promise<void>;\n acquireTokenSilent(silentRequest: SilentRequest): Promise<AuthenticationResult>;\n acquireTokenByCode(request: AuthorizationCodeRequest): Promise<AuthenticationResult>;\n addEventCallback(callback: Function): string | null;\n removeEventCallback(callbackId: string): void;\n addPerformanceCallback(callback: PerformanceCallbackFunction): string;\n removePerformanceCallback(callbackId: string): boolean;\n enableAccountStorageEvents(): void;\n disableAccountStorageEvents(): void;\n getAccountByHomeId(homeAccountId: string): AccountInfo | null;\n getAccountByLocalId(localId: string): AccountInfo | null;\n getAccountByUsername(userName: string): AccountInfo | null;\n getAllAccounts(): AccountInfo[];\n handleRedirectPromise(hash?: string): Promise<AuthenticationResult | null>;\n loginPopup(request?: PopupRequest): Promise<AuthenticationResult>;\n loginRedirect(request?: RedirectRequest): Promise<void>;\n logout(logoutRequest?: EndSessionRequest): Promise<void>;\n logoutRedirect(logoutRequest?: EndSessionRequest): Promise<void>;\n logoutPopup(logoutRequest?: EndSessionPopupRequest): Promise<void>;\n ssoSilent(request: SsoSilentRequest): Promise<AuthenticationResult>;\n getTokenCache(): ITokenCache;\n getLogger(): Logger;\n setLogger(logger: Logger): void;\n setActiveAccount(account: AccountInfo | null): void;\n getActiveAccount(): AccountInfo | null;\n initializeWrapperLibrary(sku: WrapperSKU, version: string): void;\n setNavigationClient(navigationClient: INavigationClient): void;\n getConfiguration(): BrowserConfiguration;\n}\n\nexport const stubbedPublicClientApplication: IPublicClientApplication = {\n initialize: () => {\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\n },\n acquireTokenPopup: () => {\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\n },\n acquireTokenRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n acquireTokenSilent: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n acquireTokenByCode: () => {\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\n },\n getAllAccounts: () => {\n return [];\t\n },\t\n getAccountByHomeId: () => {\n return null;\n },\n getAccountByUsername: () => {\t\n return null;\t\n },\t\n getAccountByLocalId: () => {\n return null;\n },\n handleRedirectPromise: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n loginPopup: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n loginRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n logout: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\t\n logoutRedirect: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n logoutPopup: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n ssoSilent: () => {\t\n return Promise.reject(BrowserConfigurationAuthError.createStubPcaInstanceCalledError());\t\n },\n addEventCallback: () => {\n return null;\n },\n removeEventCallback: () => {\n return;\n },\n addPerformanceCallback: () => {\n return \"\";\n },\n removePerformanceCallback: () => {\n return false;\n },\n enableAccountStorageEvents: () => {\n return;\n },\n disableAccountStorageEvents: () => {\n return;\n },\n getTokenCache: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n },\n getLogger: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n },\n setLogger: () => {\n return;\n },\n setActiveAccount: () => {\n return;\n },\n getActiveAccount: () => {\n return null;\n },\n initializeWrapperLibrary: () => {\n return;\n },\n setNavigationClient: () => {\n return;\n },\n getConfiguration: () => {\n throw BrowserConfigurationAuthError.createStubPcaInstanceCalledError();\n }\n};\n"],"names":[],"mappings":";;;;AAAA;;;;IAoDa,8BAA8B,GAA6B;IACpE,UAAU,EAAE;QACR,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,iBAAiB,EAAE;QACf,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,oBAAoB,EAAE;QAClB,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,kBAAkB,EAAE;QAChB,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,kBAAkB,EAAE;QAChB,OAAO,OAAO,CAAC,MAAM,CAAC,6BAA6B,CAAC,gCAAgC,EAAE,CAAC,CAAC;KAC3F;IACD,cAAc,EAAE;QACZ,OAAO,EAAE,CAAC;KACb;IACD,kBAAkB,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,oBAAoB,EAAE;QAClB,OAAO,IAAI,CAAC;KACf;IACD,mBAAmB,EAAE;QACjB,OAAO,IAAI,CAAC;KACf;IACD,qBAA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;KACV;IACD,mBAAmB,EAAE;QACjB,OAAO;KACV;IACD,gBAAgB,EAAE;QACd,MAAM,6BAA6B,CAAC,gCAAgC,EAAE,CAAC;KAC1E;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/PublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAqB,MAAM,oBAAoB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,wBAAwB;IAG9F,OAAO,CAAC,yBAAyB,CAA6C;IAE9E;;;;;;;;;;;;;;;;;;;;OAoBG;gBACS,aAAa,EAAE,aAAa;IAMxC;;;;;;;;OAQG;IACG,aAAa,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7D;;;;;;OAMG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAKjE;;;;;OAKG;IACG,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAwC/E;;;;;OAKG;cACa,uBAAuB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAgBvH"}
1
+ {"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/PublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAA8D,MAAM,oBAAoB,CAAC;AACnI,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAMzD;;;GAGG;AACH,qBAAa,uBAAwB,SAAQ,iBAAkB,YAAW,wBAAwB;IAG9F,OAAO,CAAC,yBAAyB,CAA6C;IAE9E;;;;;;;;;;;;;;;;;;;;OAoBG;gBACS,aAAa,EAAE,aAAa;IAMxC;;;;;;;;OAQG;IACG,aAAa,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAS7D;;;;;;OAMG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC;IASjE;;;;;OAKG;IACG,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA2D/E;;;;;OAKG;cACa,uBAAuB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA+CvH"}
@@ -1,11 +1,13 @@
1
- /*! @azure/msal-browser v2.22.1 2022-03-07 */
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
2
  'use strict';
3
- import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
- import { DEFAULT_REQUEST, InteractionType } from '../utils/BrowserConstants.js';
3
+ import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
+ import { PerformanceEvents, Constants } from '@azure/msal-common';
5
+ import { DEFAULT_REQUEST, InteractionType, ApiId } from '../utils/BrowserConstants.js';
5
6
  import { ClientApplication } from './ClientApplication.js';
6
7
  import { EventType } from '../event/EventType.js';
7
8
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
8
- import { SilentCacheClient } from '../interaction_client/SilentCacheClient.js';
9
+ import { NativeAuthError } from '../error/NativeAuthError.js';
10
+ import { NativeMessageHandler } from '../broker/nativeBroker/NativeMessageHandler.js';
9
11
 
10
12
  /*
11
13
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -54,9 +56,11 @@ var PublicClientApplication = /** @class */ (function (_super) {
54
56
  */
55
57
  PublicClientApplication.prototype.loginRedirect = function (request) {
56
58
  return __awaiter(this, void 0, void 0, function () {
59
+ var correlationId;
57
60
  return __generator(this, function (_a) {
58
- this.logger.verbose("loginRedirect called");
59
- return [2 /*return*/, this.acquireTokenRedirect(request || DEFAULT_REQUEST)];
61
+ correlationId = this.getRequestCorrelationId(request);
62
+ this.logger.verbose("loginRedirect called", correlationId);
63
+ return [2 /*return*/, this.acquireTokenRedirect(__assign({ correlationId: correlationId }, (request || DEFAULT_REQUEST)))];
60
64
  });
61
65
  });
62
66
  };
@@ -68,8 +72,9 @@ var PublicClientApplication = /** @class */ (function (_super) {
68
72
  * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
69
73
  */
70
74
  PublicClientApplication.prototype.loginPopup = function (request) {
71
- this.logger.verbose("loginPopup called");
72
- return this.acquireTokenPopup(request || DEFAULT_REQUEST);
75
+ var correlationId = this.getRequestCorrelationId(request);
76
+ this.logger.verbose("loginPopup called", correlationId);
77
+ return this.acquireTokenPopup(__assign({ correlationId: correlationId }, (request || DEFAULT_REQUEST)));
73
78
  };
74
79
  /**
75
80
  * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.
@@ -79,18 +84,20 @@ var PublicClientApplication = /** @class */ (function (_super) {
79
84
  */
80
85
  PublicClientApplication.prototype.acquireTokenSilent = function (request) {
81
86
  return __awaiter(this, void 0, void 0, function () {
82
- var account, thumbprint, silentRequestKey, cachedResponse, response;
87
+ var correlationId, atsMeasurement, account, thumbprint, silentRequestKey, cachedResponse, response;
83
88
  var _this = this;
84
89
  return __generator(this, function (_a) {
90
+ correlationId = this.getRequestCorrelationId(request);
91
+ atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);
85
92
  this.preflightBrowserEnvironmentCheck(InteractionType.Silent);
86
- this.logger.verbose("acquireTokenSilent called", request.correlationId);
93
+ this.logger.verbose("acquireTokenSilent called", correlationId);
87
94
  account = request.account || this.getActiveAccount();
88
95
  if (!account) {
89
96
  throw BrowserAuthError.createNoAccountError();
90
97
  }
91
98
  thumbprint = {
92
99
  clientId: this.config.auth.clientId,
93
- authority: request.authority || "",
100
+ authority: request.authority || Constants.EMPTY_STRING,
94
101
  scopes: request.scopes,
95
102
  homeAccountIdentifier: account.homeAccountId,
96
103
  claims: request.claims,
@@ -103,21 +110,35 @@ var PublicClientApplication = /** @class */ (function (_super) {
103
110
  silentRequestKey = JSON.stringify(thumbprint);
104
111
  cachedResponse = this.activeSilentTokenRequests.get(silentRequestKey);
105
112
  if (typeof cachedResponse === "undefined") {
106
- this.logger.verbose("acquireTokenSilent called for the first time, storing active request", request.correlationId);
107
- response = this.acquireTokenSilentAsync(request, account)
113
+ this.logger.verbose("acquireTokenSilent called for the first time, storing active request", correlationId);
114
+ response = this.acquireTokenSilentAsync(__assign(__assign({}, request), { correlationId: correlationId }), account)
108
115
  .then(function (result) {
109
116
  _this.activeSilentTokenRequests.delete(silentRequestKey);
117
+ atsMeasurement.endMeasurement({
118
+ success: true,
119
+ fromCache: result.fromCache
120
+ });
121
+ atsMeasurement.flushMeasurement();
110
122
  return result;
111
123
  })
112
124
  .catch(function (error) {
113
125
  _this.activeSilentTokenRequests.delete(silentRequestKey);
126
+ atsMeasurement.endMeasurement({
127
+ success: false
128
+ });
129
+ atsMeasurement.flushMeasurement();
114
130
  throw error;
115
131
  });
116
132
  this.activeSilentTokenRequests.set(silentRequestKey, response);
117
133
  return [2 /*return*/, response];
118
134
  }
119
135
  else {
120
- this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call", request.correlationId);
136
+ this.logger.verbose("acquireTokenSilent has been called previously, returning the result from the first call", correlationId);
137
+ atsMeasurement.endMeasurement({
138
+ success: true
139
+ });
140
+ // Discard measurements for memoized calls, as they are usually only a couple of ms and will artificially deflate metrics
141
+ atsMeasurement.discardMeasurement();
121
142
  return [2 /*return*/, cachedResponse];
122
143
  }
123
144
  });
@@ -131,35 +152,56 @@ var PublicClientApplication = /** @class */ (function (_super) {
131
152
  */
132
153
  PublicClientApplication.prototype.acquireTokenSilentAsync = function (request, account) {
133
154
  return __awaiter(this, void 0, void 0, function () {
134
- var silentCacheClient, silentRequest;
155
+ var astsAsyncMeasurement, result, silentRequest, silentCacheClient, silentRequest_1;
135
156
  var _this = this;
136
157
  return __generator(this, function (_a) {
137
158
  switch (_a.label) {
138
159
  case 0:
139
- silentCacheClient = new SilentCacheClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, request.correlationId);
140
- return [4 /*yield*/, silentCacheClient.initializeSilentRequest(request, account)];
141
- case 1:
142
- silentRequest = _a.sent();
143
160
  this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);
144
- return [2 /*return*/, silentCacheClient.acquireToken(silentRequest).catch(function () { return __awaiter(_this, void 0, void 0, function () {
145
- var tokenRenewalResult, tokenRenewalError_1;
146
- return __generator(this, function (_a) {
147
- switch (_a.label) {
148
- case 0:
149
- _a.trys.push([0, 2, , 3]);
150
- return [4 /*yield*/, this.acquireTokenByRefreshToken(silentRequest)];
151
- case 1:
152
- tokenRenewalResult = _a.sent();
153
- this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, tokenRenewalResult);
154
- return [2 /*return*/, tokenRenewalResult];
155
- case 2:
156
- tokenRenewalError_1 = _a.sent();
157
- this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError_1);
158
- throw tokenRenewalError_1;
159
- case 3: return [2 /*return*/];
160
- }
161
- });
162
- }); })];
161
+ astsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);
162
+ if (!(NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) && account.nativeAccountId)) return [3 /*break*/, 1];
163
+ this.logger.verbose("acquireTokenSilent - attempting to acquire token from native platform");
164
+ silentRequest = __assign(__assign({}, request), { account: account });
165
+ result = this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(function (e) { return __awaiter(_this, void 0, void 0, function () {
166
+ var silentIframeClient;
167
+ return __generator(this, function (_a) {
168
+ // If native token acquisition fails for availability reasons fallback to web flow
169
+ if (e instanceof NativeAuthError && e.isFatal()) {
170
+ this.logger.verbose("acquireTokenSilent - native platform unavailable, falling back to web flow");
171
+ this.nativeExtensionProvider = undefined; // Prevent future requests from continuing to attempt
172
+ silentIframeClient = this.createSilentIframeClient(request.correlationId);
173
+ return [2 /*return*/, silentIframeClient.acquireToken(request)];
174
+ }
175
+ throw e;
176
+ });
177
+ }); });
178
+ return [3 /*break*/, 3];
179
+ case 1:
180
+ this.logger.verbose("acquireTokenSilent - attempting to acquire token from web flow");
181
+ silentCacheClient = this.createSilentCacheClient(request.correlationId);
182
+ return [4 /*yield*/, silentCacheClient.initializeSilentRequest(request, account)];
183
+ case 2:
184
+ silentRequest_1 = _a.sent();
185
+ result = silentCacheClient.acquireToken(silentRequest_1).catch(function () { return __awaiter(_this, void 0, void 0, function () {
186
+ return __generator(this, function (_a) {
187
+ return [2 /*return*/, this.acquireTokenByRefreshToken(silentRequest_1)];
188
+ });
189
+ }); });
190
+ _a.label = 3;
191
+ case 3: return [2 /*return*/, result.then(function (response) {
192
+ _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, response);
193
+ astsAsyncMeasurement.endMeasurement({
194
+ success: true,
195
+ fromCache: response.fromCache
196
+ });
197
+ return response;
198
+ }).catch(function (tokenRenewalError) {
199
+ _this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError);
200
+ astsAsyncMeasurement.endMeasurement({
201
+ success: false
202
+ });
203
+ throw tokenRenewalError;
204
+ })];
163
205
  }
164
206
  });
165
207
  });