@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":"InteractionHandler.js","sources":["../../src/interaction_handler/InteractionHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorizationCodePayload , StringUtils, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, AuthorityFactory, Authority, INetworkModule, ClientAuthError, CcsCredential, Logger } from \"@azure/msal-common\";\n\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { TemporaryCacheKeys } from \"../utils/BrowserConstants\";\n\nexport type InteractionParams = {};\n\n/**\n * Abstract class which defines operations for a browser interaction handling class.\n */\nexport abstract class InteractionHandler {\n\n protected authModule: AuthorizationCodeClient;\n protected browserStorage: BrowserCacheManager;\n protected authCodeRequest: CommonAuthorizationCodeRequest;\n protected browserRequestLogger: Logger;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, browserRequestLogger: Logger) {\n this.authModule = authCodeModule;\n this.browserStorage = storageImpl;\n this.authCodeRequest = authCodeRequest;\n this.browserRequestLogger = browserRequestLogger;\n }\n\n /**\n * Function to enable user interaction.\n * @param requestUrl\n */\n abstract initiateAuthRequest(requestUrl: string, params: InteractionParams): Window | Promise<HTMLIFrameElement> | Promise<void>;\n\n /**\n * Function to handle response parameters from hash.\n * @param locationHash\n */\n async handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult> {\n this.browserRequestLogger.verbose(\"InteractionHandler.handleCodeResponse called\");\n // Check that location hash isn't empty.\n if (StringUtils.isEmpty(locationHash)) {\n throw BrowserAuthError.createEmptyHashError(locationHash);\n }\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n const authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\n\n return this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule);\n }\n\n /**\n * Process auth code response from AAD\n * @param authCodeResponse \n * @param state \n * @param authority \n * @param networkModule \n * @returns \n */\n async handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, state: string, authority: Authority, networkModule: INetworkModule, validateNonce: boolean = true): Promise<AuthenticationResult> {\n this.browserRequestLogger.trace(\"InteractionHandler.handleCodeResponseFromServer called\");\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n \n // Get cached items\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\n\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);\n }\n\n // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)\n if (validateNonce) {\n authCodeResponse.nonce = cachedNonce || undefined;\n }\n \n authCodeResponse.state = requestState;\n\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n } else {\n const cachedCcsCred = this.checkCcsCredentials();\n if (cachedCcsCred) {\n this.authCodeRequest.ccsCredential = cachedCcsCred;\n }\n }\n\n // Acquire token with retrieved code.\n const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);\n this.browserStorage.cleanRequestByState(state);\n return tokenResponse;\n }\n\n /**\n * Updates authority based on cloudInstanceHostname\n * @param cloudInstanceHostname \n * @param authority \n * @param networkModule \n */\n protected async updateTokenEndpointAuthority(cloudInstanceHostname: string, authority: Authority, networkModule: INetworkModule): Promise<void> {\n const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${authority.tenant}/`;\n const cloudInstanceAuthority = await AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options);\n this.authModule.updateAuthority(cloudInstanceAuthority);\n }\n\n /**\n * Looks up ccs creds in the cache\n */\n protected checkCcsCredentials(): CcsCredential | null {\n // Look up ccs credential in temp cache\n const cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);\n if (cachedCcsCred) {\n try {\n return JSON.parse(cachedCcsCred) as CcsCredential;\n } catch (e) {\n this.authModule.logger.error(\"Cache credential could not be parsed\");\n this.authModule.logger.errorPii(`Cache credential could not be parsed: ${cachedCcsCred}`);\n }\n }\n return null;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;AAaA;;;;IAUI,4BAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B;QAChK,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;KACpD;;;;;IAYK,uDAA0B,GAAhC,UAAiC,YAAoB,EAAE,KAAa,EAAE,SAAoB,EAAE,aAA6B;;;;gBACrH,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAC;;gBAElF,IAAI,WAAW,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;oBACnC,MAAM,gBAAgB,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;iBAC7D;gBAGK,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBACvD,YAAY,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;gBACrE,IAAI,CAAC,YAAY,EAAE;oBACf,MAAM,eAAe,CAAC,wBAAwB,CAAC,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Q,CAAC,2CAAyC,aAAe,CAAC,CAAC;aAC7F;SACJ;QACD,OAAO,IAAI,CAAC;KACf;IACL,yBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"InteractionHandler.js","sources":["../../src/interaction_handler/InteractionHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorizationCodePayload , StringUtils, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, AuthorityFactory, Authority, INetworkModule, ClientAuthError, CcsCredential, Logger, ServerError } from \"@azure/msal-common\";\n\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\nimport { TemporaryCacheKeys } from \"../utils/BrowserConstants\";\n\nexport type InteractionParams = {};\n\n/**\n * Abstract class which defines operations for a browser interaction handling class.\n */\nexport abstract class InteractionHandler {\n\n protected authModule: AuthorizationCodeClient;\n protected browserStorage: BrowserCacheManager;\n protected authCodeRequest: CommonAuthorizationCodeRequest;\n protected browserRequestLogger: Logger;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, browserRequestLogger: Logger) {\n this.authModule = authCodeModule;\n this.browserStorage = storageImpl;\n this.authCodeRequest = authCodeRequest;\n this.browserRequestLogger = browserRequestLogger;\n }\n\n /**\n * Function to enable user interaction.\n * @param requestUrl\n */\n abstract initiateAuthRequest(requestUrl: string, params: InteractionParams): Window | Promise<HTMLIFrameElement> | Promise<void>;\n\n /**\n * Function to handle response parameters from hash.\n * @param locationHash\n */\n async handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult> {\n this.browserRequestLogger.verbose(\"InteractionHandler.handleCodeResponse called\");\n // Check that location hash isn't empty.\n if (StringUtils.isEmpty(locationHash)) {\n throw BrowserAuthError.createEmptyHashError(locationHash);\n }\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n\n let authCodeResponse;\n try {\n authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\n } catch (e) {\n if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\n throw BrowserAuthError.createUserCancelledError();\n } else {\n throw e;\n }\n }\n\n return this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule);\n }\n\n /**\n * Process auth code response from AAD\n * @param authCodeResponse \n * @param state \n * @param authority \n * @param networkModule \n * @returns \n */\n async handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, state: string, authority: Authority, networkModule: INetworkModule, validateNonce: boolean = true): Promise<AuthenticationResult> {\n this.browserRequestLogger.trace(\"InteractionHandler.handleCodeResponseFromServer called\");\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n \n // Get cached items\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\n\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);\n }\n\n // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)\n if (validateNonce) {\n authCodeResponse.nonce = cachedNonce || undefined;\n }\n \n authCodeResponse.state = requestState;\n\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n } else {\n const cachedCcsCred = this.checkCcsCredentials();\n if (cachedCcsCred) {\n this.authCodeRequest.ccsCredential = cachedCcsCred;\n }\n }\n\n // Acquire token with retrieved code.\n const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);\n this.browserStorage.cleanRequestByState(state);\n return tokenResponse;\n }\n\n /**\n * Updates authority based on cloudInstanceHostname\n * @param cloudInstanceHostname \n * @param authority \n * @param networkModule \n */\n protected async updateTokenEndpointAuthority(cloudInstanceHostname: string, authority: Authority, networkModule: INetworkModule): Promise<void> {\n const cloudInstanceAuthorityUri = `https://${cloudInstanceHostname}/${authority.tenant}/`;\n const cloudInstanceAuthority = await AuthorityFactory.createDiscoveredInstance(cloudInstanceAuthorityUri, networkModule, this.browserStorage, authority.options);\n this.authModule.updateAuthority(cloudInstanceAuthority);\n }\n\n /**\n * Looks up ccs creds in the cache\n */\n protected checkCcsCredentials(): CcsCredential | null {\n // Look up ccs credential in temp cache\n const cachedCcsCred = this.browserStorage.getTemporaryCache(TemporaryCacheKeys.CCS_CREDENTIAL, true);\n if (cachedCcsCred) {\n try {\n return JSON.parse(cachedCcsCred) as CcsCredential;\n } catch (e) {\n this.authModule.logger.error(\"Cache credential could not be parsed\");\n this.authModule.logger.errorPii(`Cache credential could not be parsed: ${cachedCcsCred}`);\n }\n }\n return null;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;AAaA;;;;IAUI,4BAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B;QAChK,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,WAAW,CAAC;QAClC,IAAI,CAAC,eAAe,GAAG,eAAe,CAAC;QACvC,IAAI,CAAC,oBAAoB,GAAG,oBAAoB,CAAC;KACpD;;;;;IAYK,uDAA0B,GAAhC,UAAiC,YAAoB,EAAE,KAAa,EAAE,SAAoB,EAAE,aAA6B;;;;gBACrH,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAC;;gBAElF,IAAI,WAAW,CAA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wB,CAAC,yBAAyB,EAAE,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,OAAO,CAAC,EAAA;;wBAA1J,sBAAsB,GAAG,SAAiI;wBAChK,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,sBAAsB,CAAC,CAAC;;;;;KAC3D;;;;IAKS,gDAAmB,GAA7B;;QAEI,IAAM,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;QACrG,IAAI,aAAa,EAAE;YACf,IAAI;gBACA,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAkB,CAAC;aACrD;YAAC,OAAO,CAAC,EAAE;gBACR,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,sCAAsC,CAAC,CAAC;gBACrE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,2CAAyC,aAAe,CAAC,CAAC;aAC7F;SACJ;QACD,OAAO,IAAI,CAAC;KACf;IACL,yBAAC;AAAD,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 { __extends } from '../_virtual/_tslib.js';
4
4
  import { StringUtils, UrlString } from '@azure/msal-common';
@@ -20,6 +20,6 @@ export declare class RedirectHandler extends InteractionHandler {
20
20
  * Handle authorization code response in the window.
21
21
  * @param hash
22
22
  */
23
- handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule, clientId?: string): Promise<AuthenticationResult>;
23
+ handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult>;
24
24
  }
25
25
  //# sourceMappingURL=RedirectHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RedirectHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/RedirectHand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SAAS,EAAE,cAAc,EAAmB,MAAM,EAAe,MAAM,oBAAoB,CAAC;AAG1M,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,oBAAY,cAAc,GAAG,iBAAiB,GAAG;IAC7C,gBAAgB,EAAE,iBAAiB,CAAC;IACpC,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC;CACxD,CAAC;AAEF,qBAAa,eAAgB,SAAQ,kBAAkB;IAEnD,OAAO,CAAC,aAAa,CAAU;gBAEnB,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,8BAA8B,EAAE,oBAAoB,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO;IAK5L;;;OAGG;IACG,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA+CpF;;;OAGG;IACG,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA6D5J"}
@@ -1,8 +1,8 @@
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 { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
- import { StringUtils, ThrottlingUtils, ClientAuthError } from '@azure/msal-common';
5
- import { BrowserAuthError } from '../error/BrowserAuthError.js';
4
+ import { StringUtils, ClientAuthError, ServerError } from '@azure/msal-common';
5
+ import { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';
6
6
  import { TemporaryCacheKeys, ApiId } from '../utils/BrowserConstants.js';
7
7
  import { InteractionHandler } from './InteractionHandler.js';
8
8
 
@@ -77,7 +77,7 @@ var RedirectHandler = /** @class */ (function (_super) {
77
77
  * Handle authorization code response in the window.
78
78
  * @param hash
79
79
  */
80
- RedirectHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule, clientId) {
80
+ RedirectHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule) {
81
81
  return __awaiter(this, void 0, void 0, function () {
82
82
  var stateKey, requestState, authCodeResponse, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
83
83
  return __generator(this, function (_a) {
@@ -95,7 +95,18 @@ var RedirectHandler = /** @class */ (function (_super) {
95
95
  if (!requestState) {
96
96
  throw ClientAuthError.createStateNotFoundError("Cached State");
97
97
  }
98
- authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
98
+ try {
99
+ authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
100
+ }
101
+ catch (e) {
102
+ if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {
103
+ // Translate server error caused by user closing native prompt to corresponding first class MSAL error
104
+ throw BrowserAuthError.createUserCancelledError();
105
+ }
106
+ else {
107
+ throw e;
108
+ }
109
+ }
99
110
  nonceKey = this.browserStorage.generateNonceKey(requestState);
100
111
  cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);
101
112
  // Assign code to request
@@ -118,10 +129,6 @@ var RedirectHandler = /** @class */ (function (_super) {
118
129
  this.authCodeRequest.ccsCredential = cachedCcsCred;
119
130
  }
120
131
  }
121
- // Remove throttle if it exists
122
- if (clientId) {
123
- ThrottlingUtils.removeThrottle(this.browserStorage, clientId, this.authCodeRequest);
124
- }
125
132
  return [4 /*yield*/, this.authModule.acquireToken(this.authCodeRequest, authCodeResponse)];
126
133
  case 3:
127
134
  tokenResponse = _a.sent();
@@ -1 +1 @@
1
- {"version":3,"file":"RedirectHandler.js","sources":["../../src/interaction_handler/RedirectHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorizationCodeClient, StringUtils, CommonAuthorizationCodeRequest, ICrypto, AuthenticationResult, ThrottlingUtils, Authority, INetworkModule, ClientAuthError, Logger } from \"@azure/msal-common\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { ApiId, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { InteractionHandler, InteractionParams } from \"./InteractionHandler\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\n\nexport type RedirectParams = InteractionParams & {\n navigationClient: INavigationClient;\n redirectTimeout: number;\n redirectStartPage: string;\n onRedirectNavigate?: (url: string) => void | boolean;\n};\n\nexport class RedirectHandler extends InteractionHandler {\n\n private browserCrypto: ICrypto;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, browserRequestLogger: Logger, browserCrypto: ICrypto) {\n super(authCodeModule, storageImpl, authCodeRequest, browserRequestLogger);\n this.browserCrypto = browserCrypto;\n }\n\n /**\n * Redirects window to given URL.\n * @param urlNavigate\n */\n async initiateAuthRequest(requestUrl: string, params: RedirectParams): Promise<void> {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest called\");\n // Navigate if valid URL\n if (!StringUtils.isEmpty(requestUrl)) {\n // Cache start page, returns to this page after redirectUri if navigateToLoginRequestUrl is true\n if (params.redirectStartPage) {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page\");\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);\n }\n\n // Set interaction status in the library.\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);\n this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);\n this.browserRequestLogger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${requestUrl}`);\n const navigationOptions: NavigationOptions = {\n apiId: ApiId.acquireTokenRedirect,\n timeout: params.redirectTimeout,\n noHistory: false\n };\n \n // If onRedirectNavigate is implemented, invoke it and provide requestUrl\n if (typeof params.onRedirectNavigate === \"function\") {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback\");\n const navigate = params.onRedirectNavigate(requestUrl);\n\n // Returning false from onRedirectNavigate will stop navigation\n if (navigate !== false) {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating\");\n await params.navigationClient.navigateExternal(requestUrl, navigationOptions);\n return;\n } else {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation\");\n return;\n }\n } else {\n // Navigate window to request URL\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: Navigating window to navigate url\");\n await params.navigationClient.navigateExternal(requestUrl, navigationOptions);\n return;\n }\n } else {\n // Throw error if request URL is empty.\n this.browserRequestLogger.info(\"RedirectHandler.initiateAuthRequest: Navigate url is empty\");\n throw BrowserAuthError.createEmptyNavigationUriError();\n }\n }\n\n /**\n * Handle authorization code response in the window.\n * @param hash\n */\n async handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule, clientId?: string): Promise<AuthenticationResult> {\n this.browserRequestLogger.verbose(\"RedirectHandler.handleCodeResponse called\");\n\n // Check that location hash isn't empty.\n if (StringUtils.isEmpty(locationHash)) {\n throw BrowserAuthError.createEmptyHashError(locationHash);\n }\n\n // Interaction is completed - remove interaction status.\n this.browserStorage.setInteractionInProgress(false);\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n const authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\n\n // Get cached items\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\n\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);\n }\n\n authCodeResponse.nonce = cachedNonce || undefined;\n authCodeResponse.state = requestState;\n\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n } else {\n const cachedCcsCred = this.checkCcsCredentials();\n if (cachedCcsCred) {\n this.authCodeRequest.ccsCredential = cachedCcsCred;\n }\n }\n\n // Remove throttle if it exists\n if (clientId) {\n ThrottlingUtils.removeThrottle(this.browserStorage, clientId, this.authCodeRequest);\n }\n\n // Acquire token with retrieved code.\n const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);\n\n this.browserStorage.cleanRequestByState(state);\n return tokenResponse;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAoBqC,mCAAkB;IAInD,yBAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B,EAAE,aAAsB;QAA5L,YACI,kBAAM,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,CAAC,SAE5E;QADG,KAAI,CAAC,aAAa,GAAG,aAAa,CAAC;;KACtC;;;;;IAMK,6CAAmB,GAAzB,UAA0B,UAAkB,EAAE,MAAsB;;;;;;wBAChE,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;6BAE5E,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,EAAhC,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G9C,gBAAgB,CAAC,wBAAwB,EAAzC,wBAAyC;wBACzC,qBAAM,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,SAAS,EAAE,aAAa,CAAC,EAAA;;wBAA5G,SAA4G,CAAC;;;wBAGjH,gBAAgB,CAAC,KAAK,GAAG,WAAW,IAAI,SAAS,CAAC;wBAClD,gBAAgB,CAAC,KAAK,GAAG,YAAY,CAAC;;wBAGtC,IAAI,gBAAgB,CAAC,WAAW,EAAE;4BAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,gBAAgB,CAAC,WAAW,CAAC;yBAClE;6BAAM;4BACG,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;4BACjD,IAAI,aAAa,EAAE;gCACf,IAAI,CAAC,eAAe,CAAC,aAAa,GAAG,aAAa,CAAC;6BACtD;yBACJ;;wBAGD,IAAI,QAAQ,EAAE;4BACV,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;yBACvF;wBAGqB,qBAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAA;;wBAA1F,aAAa,GAAG,SAA0E;wBAEhG,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;wBAC/C,sBAAO,aAAa,EAAC;;;;KACxB;IACL,sBAAC;AAAD,CAvHA,CAAqC,kBAAkB;;;;"}
1
+ {"version":3,"file":"RedirectHandler.js","sources":["../../src/interaction_handler/RedirectHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthorizationCodeClient, StringUtils, CommonAuthorizationCodeRequest, ICrypto, AuthenticationResult, Authority, INetworkModule, ClientAuthError, Logger, ServerError } from \"@azure/msal-common\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\nimport { ApiId, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { InteractionHandler, InteractionParams } from \"./InteractionHandler\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { NavigationOptions } from \"../navigation/NavigationOptions\";\n\nexport type RedirectParams = InteractionParams & {\n navigationClient: INavigationClient;\n redirectTimeout: number;\n redirectStartPage: string;\n onRedirectNavigate?: (url: string) => void | boolean;\n};\n\nexport class RedirectHandler extends InteractionHandler {\n\n private browserCrypto: ICrypto;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, browserRequestLogger: Logger, browserCrypto: ICrypto) {\n super(authCodeModule, storageImpl, authCodeRequest, browserRequestLogger);\n this.browserCrypto = browserCrypto;\n }\n\n /**\n * Redirects window to given URL.\n * @param urlNavigate\n */\n async initiateAuthRequest(requestUrl: string, params: RedirectParams): Promise<void> {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest called\");\n // Navigate if valid URL\n if (!StringUtils.isEmpty(requestUrl)) {\n // Cache start page, returns to this page after redirectUri if navigateToLoginRequestUrl is true\n if (params.redirectStartPage) {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: redirectStartPage set, caching start page\");\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);\n }\n\n // Set interaction status in the library.\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);\n this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);\n this.browserRequestLogger.infoPii(`RedirectHandler.initiateAuthRequest: Navigate to: ${requestUrl}`);\n const navigationOptions: NavigationOptions = {\n apiId: ApiId.acquireTokenRedirect,\n timeout: params.redirectTimeout,\n noHistory: false\n };\n \n // If onRedirectNavigate is implemented, invoke it and provide requestUrl\n if (typeof params.onRedirectNavigate === \"function\") {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: Invoking onRedirectNavigate callback\");\n const navigate = params.onRedirectNavigate(requestUrl);\n\n // Returning false from onRedirectNavigate will stop navigation\n if (navigate !== false) {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate did not return false, navigating\");\n await params.navigationClient.navigateExternal(requestUrl, navigationOptions);\n return;\n } else {\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: onRedirectNavigate returned false, stopping navigation\");\n return;\n }\n } else {\n // Navigate window to request URL\n this.browserRequestLogger.verbose(\"RedirectHandler.initiateAuthRequest: Navigating window to navigate url\");\n await params.navigationClient.navigateExternal(requestUrl, navigationOptions);\n return;\n }\n } else {\n // Throw error if request URL is empty.\n this.browserRequestLogger.info(\"RedirectHandler.initiateAuthRequest: Navigate url is empty\");\n throw BrowserAuthError.createEmptyNavigationUriError();\n }\n }\n\n /**\n * Handle authorization code response in the window.\n * @param hash\n */\n async handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult> {\n this.browserRequestLogger.verbose(\"RedirectHandler.handleCodeResponse called\");\n\n // Check that location hash isn't empty.\n if (StringUtils.isEmpty(locationHash)) {\n throw BrowserAuthError.createEmptyHashError(locationHash);\n }\n\n // Interaction is completed - remove interaction status.\n this.browserStorage.setInteractionInProgress(false);\n\n // Handle code response.\n const stateKey = this.browserStorage.generateStateKey(state);\n const requestState = this.browserStorage.getTemporaryCache(stateKey);\n if (!requestState) {\n throw ClientAuthError.createStateNotFoundError(\"Cached State\");\n }\n\n let authCodeResponse;\n try {\n authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);\n } catch (e) {\n if (e instanceof ServerError && e.subError === BrowserAuthErrorMessage.userCancelledError.code) {\n // Translate server error caused by user closing native prompt to corresponding first class MSAL error\n throw BrowserAuthError.createUserCancelledError();\n } else {\n throw e;\n }\n }\n\n // Get cached items\n const nonceKey = this.browserStorage.generateNonceKey(requestState);\n const cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);\n\n // Assign code to request\n this.authCodeRequest.code = authCodeResponse.code;\n\n // Check for new cloud instance\n if (authCodeResponse.cloud_instance_host_name) {\n await this.updateTokenEndpointAuthority(authCodeResponse.cloud_instance_host_name, authority, networkModule);\n }\n\n authCodeResponse.nonce = cachedNonce || undefined;\n authCodeResponse.state = requestState;\n\n // Add CCS parameters if available\n if (authCodeResponse.client_info) {\n this.authCodeRequest.clientInfo = authCodeResponse.client_info;\n } else {\n const cachedCcsCred = this.checkCcsCredentials();\n if (cachedCcsCred) {\n this.authCodeRequest.ccsCredential = cachedCcsCred;\n }\n }\n\n // Acquire token with retrieved code.\n const tokenResponse = await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse);\n\n this.browserStorage.cleanRequestByState(state);\n return tokenResponse;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAoBqC,mCAAkB;IAInD,yBAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B,EAAE,aAAsB;QAA5L,YACI,kBAAM,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,CAAC,SAE5E;QADG,KAAI,CAAC,aAAa,GAAG,aAAa,CAAC;;KACtC;;;;;IAMK,6CAAmB,GAAzB,UAA0B,UAAkB,EAAE,MAAsB;;;;;;wBAChE,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,4CAA4C,CAAC,CAAC;6BAE5E,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,EAAhC,wBAAgC;;wBAEhC,IAAI,MAAM,CAAC,iBAAiB,EAAE;4BAC1B,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,gFAAgF,CAAC,CAAC;4BACpH,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,UAAU,EAAE,MAAM,CAAC,iBAAiB,EAAE,IAA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IAAI,CAAC;6BAG9C,gBAAgB,CAAC,wBAAwB,EAAzC,wBAAyC;wBACzC,qBAAM,IAAI,CAAC,4BAA4B,CAAC,gBAAgB,CAAC,wBAAwB,EAAE,SAAS,EAAE,aAAa,CAAC,EAAA;;wBAA5G,SAA4G,CAAC;;;wBAGjH,gBAAgB,CAAC,KAAK,GAAG,WAAW,IAAI,SAAS,CAAC;wBAClD,gBAAgB,CAAC,KAAK,GAAG,YAAY,CAAC;;wBAGtC,IAAI,gBAAgB,CAAC,WAAW,EAAE;4BAC9B,IAAI,CAAC,eAAe,CAAC,UAAU,GAAG,gBAAgB,CAAC,WAAW,CAAC;yBAClE;6BAAM;4BACG,aAAa,GAAG,IAAI,CAAC,mBAAmB,EAAE,CAAC;4BACjD,IAAI,aAAa,EAAE;gCACf,IAAI,CAAC,eAAe,CAAC,aAAa,GAAG,aAAa,CAAC;6BACtD;yBACJ;wBAGqB,qBAAM,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,CAAC,eAAe,EAAE,gBAAgB,CAAC,EAAA;;wBAA1F,aAAa,GAAG,SAA0E;wBAEhG,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;wBAC/C,sBAAO,aAAa,EAAC;;;;KACxB;IACL,sBAAC;AAAD,CA7HA,CAAqC,kBAAkB;;;;"}
@@ -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 { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { StringUtils, Constants, UrlString } from '@azure/msal-common';
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.
3
+ * Breaking changes to these APIs will be shipped under a minor version, instead of a major version.
4
+ */
5
+ export { BrowserCacheManager } from "./cache/BrowserCacheManager";
6
+ export { StandardInteractionClient } from "./interaction_client/StandardInteractionClient";
7
+ export { RedirectClient } from "./interaction_client/RedirectClient";
8
+ export { PopupClient } from "./interaction_client/PopupClient";
9
+ export { SilentIframeClient } from "./interaction_client/SilentIframeClient";
10
+ export { SilentCacheClient } from "./interaction_client/SilentCacheClient";
11
+ export { SilentRefreshClient } from "./interaction_client/SilentRefreshClient";
12
+ export { RedirectHandler } from "./interaction_handler/RedirectHandler";
13
+ export { EventHandler } from "./event/EventHandler";
14
+ export { NativeMessageHandler } from "./broker/nativeBroker/NativeMessageHandler";
15
+ export { BrowserStateObject } from "./utils/BrowserProtocolUtils";
16
+ export { BrowserConstants, TemporaryCacheKeys } from "./utils/BrowserConstants";
17
+ export { PopupUtils } from "./utils/PopupUtils";
18
+ //# sourceMappingURL=internals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internals.d.ts","sourceRoot":"","sources":["../src/internals.ts"],"names":[],"mappings":"AAKA;;;GAGG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAGlE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAG/E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC;AAGlF,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
+ 'use strict';
3
+ export { BrowserCacheManager } from './cache/BrowserCacheManager.js';
4
+ export { StandardInteractionClient } from './interaction_client/StandardInteractionClient.js';
5
+ export { RedirectClient } from './interaction_client/RedirectClient.js';
6
+ export { PopupClient } from './interaction_client/PopupClient.js';
7
+ export { SilentIframeClient } from './interaction_client/SilentIframeClient.js';
8
+ export { SilentCacheClient } from './interaction_client/SilentCacheClient.js';
9
+ export { SilentRefreshClient } from './interaction_client/SilentRefreshClient.js';
10
+ export { RedirectHandler } from './interaction_handler/RedirectHandler.js';
11
+ export { EventHandler } from './event/EventHandler.js';
12
+ export { NativeMessageHandler } from './broker/nativeBroker/NativeMessageHandler.js';
13
+ export { BrowserConstants, TemporaryCacheKeys } from './utils/BrowserConstants.js';
14
+ export { PopupUtils } from './utils/PopupUtils.js';
15
+
16
+ /*
17
+ * Copyright (c) Microsoft Corporation. All rights reserved.
18
+ * Licensed under the MIT License.
19
+ */
20
+ //# sourceMappingURL=internals.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internals.js","sources":["../src/internals.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n/**\n * Warning: This set of exports is purely intended to be used by other MSAL libraries, and should be considered potentially unstable. We strongly discourage using them directly, you do so at your own risk.\n * Breaking changes to these APIs will be shipped under a minor version, instead of a major version.\n */\n\n// Cache Manager\nexport { BrowserCacheManager } from \"./cache/BrowserCacheManager\";\n\n// Clients\nexport { StandardInteractionClient } from \"./interaction_client/StandardInteractionClient\";\nexport { RedirectClient } from \"./interaction_client/RedirectClient\";\nexport { PopupClient } from \"./interaction_client/PopupClient\";\nexport { SilentIframeClient } from \"./interaction_client/SilentIframeClient\";\nexport { SilentCacheClient } from \"./interaction_client/SilentCacheClient\";\nexport { SilentRefreshClient } from \"./interaction_client/SilentRefreshClient\";\n\n// Handlers\nexport { RedirectHandler } from \"./interaction_handler/RedirectHandler\";\nexport { EventHandler } from \"./event/EventHandler\";\nexport { NativeMessageHandler } from \"./broker/nativeBroker/NativeMessageHandler\";\n\n// Utilities\nexport { BrowserStateObject } from \"./utils/BrowserProtocolUtils\";\nexport { BrowserConstants, TemporaryCacheKeys } from \"./utils/BrowserConstants\";\nexport { PopupUtils } from \"./utils/PopupUtils\";\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA;;;"}
@@ -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
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1 +1 @@
1
- {"version":3,"file":"FetchClient.d.ts","sourceRoot":"","sources":["../../src/network/FetchClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAI5F;;GAEG;AACH,qBAAa,WAAY,YAAW,cAAc;IAE9C;;;;;OAKG;IACG,mBAAmB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IA0BvG;;;;;OAKG;IACG,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IA6BxG;;;OAGG;IACH,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,aAAa;CAOxB"}
1
+ {"version":3,"file":"FetchClient.d.ts","sourceRoot":"","sources":["../../src/network/FetchClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAa,cAAc,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIvG;;GAEG;AACH,qBAAa,WAAY,YAAW,cAAc;IAE9C;;;;;OAKG;IACG,mBAAmB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IA0BvG;;;;;OAKG;IACG,oBAAoB,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;IA6BxG;;;OAGG;IACH,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,aAAa;CAOxB"}
@@ -1,6 +1,7 @@
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 { __awaiter, __generator } from '../_virtual/_tslib.js';
4
+ import { Constants } from '@azure/msal-common';
4
5
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
5
6
  import { HTTP_REQUEST_TYPE } from '../utils/BrowserConstants.js';
6
7
 
@@ -71,7 +72,7 @@ var FetchClient = /** @class */ (function () {
71
72
  return __generator(this, function (_b) {
72
73
  switch (_b.label) {
73
74
  case 0:
74
- reqBody = (options && options.body) || "";
75
+ reqBody = (options && options.body) || Constants.EMPTY_STRING;
75
76
  _b.label = 1;
76
77
  case 1:
77
78
  _b.trys.push([1, 3, , 4]);
@@ -1 +1 @@
1
- {"version":3,"file":"FetchClient.js","sources":["../../src/network/FetchClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { INetworkModule, NetworkRequestOptions, NetworkResponse } from \"@azure/msal-common\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { HTTP_REQUEST_TYPE } from \"../utils/BrowserConstants\";\n\n/**\n * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\n */\nexport class FetchClient implements INetworkModule {\n\n /**\n * Fetch Client for REST endpoints - Get request\n * @param url \n * @param headers \n * @param body \n */\n async sendGetRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n let response;\n try {\n response = await fetch(url, {\n method: HTTP_REQUEST_TYPE.GET,\n headers: this.getFetchHeaders(options)\n });\n } catch (e) {\n if (window.navigator.onLine) {\n throw BrowserAuthError.createGetRequestFailedError(e, url);\n } else {\n throw BrowserAuthError.createNoNetworkConnectivityError();\n }\n }\n\n try {\n return {\n headers: this.getHeaderDict(response.headers),\n body: await response.json() as T,\n status: response.status\n };\n } catch (e) {\n throw BrowserAuthError.createFailedToParseNetworkResponseError(url);\n }\n }\n\n /**\n * Fetch Client for REST endpoints - Post request\n * @param url \n * @param headers \n * @param body \n */\n async sendPostRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n const reqBody = (options && options.body) || \"\";\n\n let response;\n try {\n response = await fetch(url, {\n method: HTTP_REQUEST_TYPE.POST,\n headers: this.getFetchHeaders(options),\n body: reqBody\n });\n } catch (e) {\n if (window.navigator.onLine) {\n throw BrowserAuthError.createPostRequestFailedError(e, url);\n } else {\n throw BrowserAuthError.createNoNetworkConnectivityError();\n }\n }\n\n try {\n return {\n headers: this.getHeaderDict(response.headers),\n body: await response.json() as T,\n status: response.status\n };\n } catch (e) {\n throw BrowserAuthError.createFailedToParseNetworkResponseError(url);\n }\n }\n\n /**\n * Get Fetch API Headers object from string map\n * @param inputHeaders \n */\n private getFetchHeaders(options?: NetworkRequestOptions): Headers {\n const headers = new Headers();\n if (!(options && options.headers)) {\n return headers;\n }\n const optionsHeaders = options.headers;\n Object.keys(optionsHeaders).forEach((key) => {\n headers.append(key, optionsHeaders[key]);\n });\n return headers;\n }\n\n private getHeaderDict(headers: Headers): Record<string, string> {\n const headerDict: Record<string, string> = {};\n headers.forEach((value: string, key: string) => {\n header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gBAAgB,CAAC,4BAA4B,CAAC,GAAC,EAAE,GAAG,CAAC,CAAC;yBAC/D;6BAAM;4BACH,MAAM,gBAAgB,CAAC,gCAAgC,EAAE,CAAC;yBAC7D;;;;4BAKG,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC;;wBACvC,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;4BAF/B,uBAEI,OAAI,IAAE,SAA0B,CAAA;4BAChC,SAAM,GAAE,QAAQ,CAAC,MAAM;iCACzB;;;wBAEF,MAAM,gBAAgB,CAAC,uCAAuC,CAAC,GAAG,CAAC,CAAC;;;;;KAE3E;;;;;IAMO,qCAAe,GAAvB,UAAwB,OAA+B;QACnD,IAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;QAC9B,IAAI,EAAE,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE;YAC/B,OAAO,OAAO,CAAC;SAClB;QACD,IAAM,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC;QACvC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,UAAC,GAAG;YACpC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC;SAC5C,CAAC,CAAC;QACH,OAAO,OAAO,CAAC;KAClB;IAEO,mCAAa,GAArB,UAAsB,OAAgB;QAClC,IAAM,UAAU,GAA2B,EAAE,CAAC;QAC9C,OAAO,CAAC,OAAO,CAAC,UAAC,KAAa,EAAE,GAAW;YACvC,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;SAC3B,CAAC,CAAC;QACH,OAAO,UAAU,CAAC;KACrB;IACL,kBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"FetchClient.js","sources":["../../src/network/FetchClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Constants, INetworkModule, NetworkRequestOptions, NetworkResponse } from \"@azure/msal-common\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { HTTP_REQUEST_TYPE } from \"../utils/BrowserConstants\";\n\n/**\n * This class implements the Fetch API for GET and POST requests. See more here: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API\n */\nexport class FetchClient implements INetworkModule {\n\n /**\n * Fetch Client for REST endpoints - Get request\n * @param url \n * @param headers \n * @param body \n */\n async sendGetRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n let response;\n try {\n response = await fetch(url, {\n method: HTTP_REQUEST_TYPE.GET,\n headers: this.getFetchHeaders(options)\n });\n } catch (e) {\n if (window.navigator.onLine) {\n throw BrowserAuthError.createGetRequestFailedError(e, url);\n } else {\n throw BrowserAuthError.createNoNetworkConnectivityError();\n }\n }\n\n try {\n return {\n headers: this.getHeaderDict(response.headers),\n body: await response.json() as T,\n status: response.status\n };\n } catch (e) {\n throw BrowserAuthError.createFailedToParseNetworkResponseError(url);\n }\n }\n\n /**\n * Fetch Client for REST endpoints - Post request\n * @param url \n * @param headers \n * @param body \n */\n async sendPostRequestAsync<T>(url: string, options?: NetworkRequestOptions): Promise<NetworkResponse<T>> {\n const reqBody = (options && options.body) || Constants.EMPTY_STRING;\n\n let response;\n try {\n response = await fetch(url, {\n method: HTTP_REQUEST_TYPE.POST,\n headers: this.getFetchHeaders(options),\n body: reqBody\n });\n } catch (e) {\n if (window.navigator.onLine) {\n throw BrowserAuthError.createPostRequestFailedError(e, url);\n } else {\n throw BrowserAuthError.createNoNetworkConnectivityError();\n }\n }\n\n try {\n return {\n headers: this.getHeaderDict(response.headers),\n body: await response.json() as T,\n status: response.status\n };\n } catch (e) {\n throw BrowserAuthError.createFailedToParseNetworkResponseError(url);\n }\n }\n\n /**\n * Get Fetch API Headers object from string map\n * @param inputHeaders \n */\n private getFetchHeaders(options?: NetworkRequestOptions): Headers {\n const headers = new Headers();\n if (!(options && options.headers)) {\n return headers;\n }\n const optionsHeaders = options.headers;\n Object.keys(optionsHeaders).forEach((key) => {\n headers.append(key, optionsHeaders[key]);\n });\n return headers;\n }\n\n private getHeaderDict(headers: Headers): Record<string, string> {\n const headerDict: Record<string, string> = {};\n headers.forEach((value: string, key: string) => {\n headerDict[key] = value;\n });\n return headerDict;\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;AASA;;;;IAGA;KA4FC;;;;;;;IApFS,yCAAmB,GAAzB,UAA6B,GAAW,EAAE,OAA+B;;;;;;;wBAGtD,qBAAM,KAAK,CAAC,GAAG,EAAE;gCACxB,MAAM,EAAE,iBAAiB,CAAC,GAAG;gCAC7B,OAAO,EAAE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;6BACzC,CAAC,EAAA;;wBAHF,QAAQ,GAAG,SAGT,CAAC;;;;wBAEH,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE;4BACzB,MAAM,gBAAgB,CAAC,2BAA2B,CAAC,GAAC,EAAE,GAAG,CAAC,CAAC;yBAC9D;6BAAM;4BACH,MAAM,gBAAgB,CAAC,gCAAgC,EAAE,CAAC;yBAC7D;;;;4BAKG,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,OAAO,CAAC;;wBACvC,qBAAM,QAAQ,CAAC,IAAI,EAAE,EAAA;4BAF/B,uBAEI,OAAI,IAAE,SAA0B,CAAA;4BAChC,SAAM,GAAE,QAAQ,CAAC,MAAM;iCACzB;;;wBAEF,MAAM,gBAAgB,CAAC,uCAAuC,CAAC,GAAG,CAAC,CAAC;;;;;KAE3E;;;;;;;IAQK,0CAAoB,GAA1B,UAA8B,GAAW,EAAE,OAA+B;;;;;;wBAChE,OAAO,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,CAAC,YAAY,CAAC;;;;wBAIrD,qBAAM,KAAK,CAAC,GAAG,EAAE;gCACxB,MAAM,EAAE,iBAAiB,CAAC,IAAI;gCAC9B,OAAO,E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CAAC;KACrB;IACL,kBAAC;AAAD,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 { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
@@ -1,3 +1,3 @@
1
1
  export declare const name = "@azure/msal-browser";
2
- export declare const version = "2.22.1";
2
+ export declare const version = "2.24.0";
3
3
  //# sourceMappingURL=packageMetadata.d.ts.map
@@ -1,8 +1,8 @@
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
  /* eslint-disable header/header */
4
4
  var name = "@azure/msal-browser";
5
- var version = "2.22.1";
5
+ var version = "2.24.0";
6
6
 
7
7
  export { name, version };
8
8
  //# sourceMappingURL=packageMetadata.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-browser\";\nexport const version = \"2.22.1\";\n"],"names":[],"mappings":";;AAAA;IACa,IAAI,GAAG,sBAAsB;IAC7B,OAAO,GAAG;;;;"}
1
+ {"version":3,"file":"packageMetadata.js","sources":["../src/packageMetadata.ts"],"sourcesContent":["/* eslint-disable header/header */\nexport const name = \"@azure/msal-browser\";\nexport const version = \"2.24.0\";\n"],"names":[],"mappings":";;AAAA;IACa,IAAI,GAAG,sBAAsB;IAC7B,OAAO,GAAG;;;;"}
@@ -1,6 +1,7 @@
1
1
  import { CommonAuthorizationCodeRequest } from "@azure/msal-common";
2
2
  export declare type AuthorizationCodeRequest = Partial<Omit<CommonAuthorizationCodeRequest, "code" | "enableSpaAuthorizationCode" | "requestedClaimsHash">> & {
3
- code: string;
3
+ code?: string;
4
+ nativeAccountId?: string;
4
5
  cloudGraphHostName?: string;
5
6
  msGraphHost?: string;
6
7
  cloudInstanceHostName?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorizationCodeRequest.d.ts","sourceRoot":"","sources":["../../src/request/AuthorizationCodeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE,oBAAY,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,MAAM,GAAC,4BAA4B,GAAC,qBAAqB,CAAC,CAAC,GAAG;IAC9I,IAAI,EAAE,MAAM,CAAC;IACb,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC"}
1
+ {"version":3,"file":"AuthorizationCodeRequest.d.ts","sourceRoot":"","sources":["../../src/request/AuthorizationCodeRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AAEpE,oBAAY,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,8BAA8B,EAAE,MAAM,GAAC,4BAA4B,GAAC,qBAAqB,CAAC,CAAC,GAAG;IAC9I,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC"}
@@ -2,7 +2,7 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
2
2
  /**
3
3
  * This type is deprecated and will be removed on the next major version update
4
4
  */
5
- export declare type AuthorizationUrlRequest = Omit<CommonAuthorizationUrlRequest, "state" | "nonce" | "requestedClaimsHash"> & {
5
+ export declare type AuthorizationUrlRequest = Omit<CommonAuthorizationUrlRequest, "state" | "nonce" | "requestedClaimsHash" | "nativeBroker"> & {
6
6
  state: string;
7
7
  nonce: string;
8
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorizationUrlRequest.d.ts","sourceRoot":"","sources":["../../src/request/AuthorizationUrlRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AACH,oBAAY,uBAAuB,GAAG,IAAI,CAAC,6BAA6B,EAAE,OAAO,GAAC,OAAO,GAAC,qBAAqB,CAAC,GAAG;IAC/G,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC"}
1
+ {"version":3,"file":"AuthorizationUrlRequest.d.ts","sourceRoot":"","sources":["../../src/request/AuthorizationUrlRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;GAEG;AACH,oBAAY,uBAAuB,GAAG,IAAI,CAAC,6BAA6B,EAAE,OAAO,GAAC,OAAO,GAAC,qBAAqB,GAAC,cAAc,CAAC,GAAG;IAC9H,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC"}
@@ -25,7 +25,7 @@ import { PopupWindowAttributes } from "../utils/PopupUtils";
25
25
  * - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
26
26
  * - popupWindowAttributes - Optional popup window attributes. popupSize with height and width, and popupPosition with top and left can be set.
27
27
  */
28
- export declare type PopupRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">> & {
28
+ export declare type PopupRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "nativeBroker">> & {
29
29
  scopes: Array<string>;
30
30
  popupWindowAttributes?: PopupWindowAttributes;
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"PopupRequest.d.ts","sourceRoot":"","sources":["../../src/request/PopupRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oBAAY,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,CAAC,CAAC,GAAG;IAC3J,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CACjD,CAAC"}
1
+ {"version":3,"file":"PopupRequest.d.ts","sourceRoot":"","sources":["../../src/request/PopupRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,oBAAY,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,GAAC,cAAc,CAAC,CAAC,GAAG;IAC1K,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CACjD,CAAC"}
@@ -25,7 +25,7 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
25
25
  * - redirectStartPage - The page that should be returned to after loginRedirect or acquireTokenRedirect. This should only be used if this is different from the redirectUri and will default to the page that initiates the request. When the navigateToLoginRequestUrl config option is set to false this parameter will be ignored.
26
26
  * - onRedirectNavigate - Callback that will be passed the url that MSAL will navigate to. Returning false in the callback will stop navigation.
27
27
  */
28
- export declare type RedirectRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">> & {
28
+ export declare type RedirectRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "nativeBroker">> & {
29
29
  scopes: Array<string>;
30
30
  redirectStartPage?: string;
31
31
  onRedirectNavigate?: (url: string) => boolean | void;
@@ -1 +1 @@
1
- {"version":3,"file":"RedirectRequest.d.ts","sourceRoot":"","sources":["../../src/request/RedirectRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,CAAC,CAAC,GAAG;IAC9J,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;CACxD,CAAC"}
1
+ {"version":3,"file":"RedirectRequest.d.ts","sourceRoot":"","sources":["../../src/request/RedirectRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,GAAC,cAAc,CAAC,CAAC,GAAG;IAC7K,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,kBAAkB,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAAG,IAAI,CAAC;CACxD,CAAC"}
@@ -22,5 +22,5 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
22
22
  * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
23
23
  * - nonce - A value included in the request that is returned in the id token. A randomly generated unique value is typically used to mitigate replay attacks.
24
24
  */
25
- export declare type SsoSilentRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash">>;
25
+ export declare type SsoSilentRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "codeChallenge" | "codeChallengeMethod" | "requestedClaimsHash" | "nativeBroker">>;
26
26
  //# sourceMappingURL=SsoSilentRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SsoSilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SsoSilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,oBAAY,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"SsoSilentRequest.d.ts","sourceRoot":"","sources":["../../src/request/SsoSilentRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,oBAAY,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,eAAe,GAAC,qBAAqB,GAAC,qBAAqB,GAAC,cAAc,CAAC,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { Logger, PerformanceEvents, IPerformanceClient, PerformanceClient, IPerformanceMeasurement, InProgressPerformanceEvent, ApplicationTelemetry } from "@azure/msal-common";
2
+ export declare class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {
3
+ private browserCrypto;
4
+ private guidGenerator;
5
+ constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry);
6
+ startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement;
7
+ generateId(): string;
8
+ private getPageVisibility;
9
+ /**
10
+ * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
11
+ * Also captures browser page visibilityState.
12
+ *
13
+ * @param {PerformanceEvents} measureName
14
+ * @param {?string} [correlationId]
15
+ * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
16
+ */
17
+ startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent;
18
+ }
19
+ //# sourceMappingURL=BrowserPerformanceClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserPerformanceClient.d.ts","sourceRoot":"","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAoB,iBAAiB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAKnM,qBAAa,wBAAyB,SAAQ,iBAAkB,YAAW,kBAAkB;IACzF,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,aAAa,CAAgB;gBAEzB,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,oBAAoB,EAAE,oBAAoB;IAMxJ,4BAA4B,CAAC,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,uBAAuB;IAIjG,UAAU,IAAK,MAAM;IAIrB,OAAO,CAAC,iBAAiB;IAIzB;;;;;;;OAOG;IACH,gBAAgB,CAAC,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,EAAE,MAAM,GAAG,0BAA0B;CAiBvG"}
@@ -0,0 +1,52 @@
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
+ 'use strict';
3
+ import { __extends, __assign } from '../_virtual/_tslib.js';
4
+ import { PerformanceClient } from '@azure/msal-common';
5
+ import { BrowserCrypto } from '../crypto/BrowserCrypto.js';
6
+ import { GuidGenerator } from '../crypto/GuidGenerator.js';
7
+ import { BrowserPerformanceMeasurement } from './BrowserPerformanceMeasurement.js';
8
+
9
+ /*
10
+ * Copyright (c) Microsoft Corporation. All rights reserved.
11
+ * Licensed under the MIT License.
12
+ */
13
+ var BrowserPerformanceClient = /** @class */ (function (_super) {
14
+ __extends(BrowserPerformanceClient, _super);
15
+ function BrowserPerformanceClient(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) {
16
+ var _this = _super.call(this, clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry) || this;
17
+ _this.browserCrypto = new BrowserCrypto(_this.logger);
18
+ _this.guidGenerator = new GuidGenerator(_this.browserCrypto);
19
+ return _this;
20
+ }
21
+ BrowserPerformanceClient.prototype.startPerformanceMeasuremeant = function (measureName, correlationId) {
22
+ return new BrowserPerformanceMeasurement(measureName, correlationId);
23
+ };
24
+ BrowserPerformanceClient.prototype.generateId = function () {
25
+ return this.guidGenerator.generateGuid();
26
+ };
27
+ BrowserPerformanceClient.prototype.getPageVisibility = function () {
28
+ var _a;
29
+ return ((_a = document.visibilityState) === null || _a === void 0 ? void 0 : _a.toString()) || null;
30
+ };
31
+ /**
32
+ * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
33
+ * Also captures browser page visibilityState.
34
+ *
35
+ * @param {PerformanceEvents} measureName
36
+ * @param {?string} [correlationId]
37
+ * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
38
+ */
39
+ BrowserPerformanceClient.prototype.startMeasurement = function (measureName, correlationId) {
40
+ var _this = this;
41
+ // Capture page visibilityState and then invoke start/end measurement
42
+ var startPageVisibility = this.getPageVisibility();
43
+ var inProgressEvent = _super.prototype.startMeasurement.call(this, measureName, correlationId);
44
+ return __assign(__assign({}, inProgressEvent), { endMeasurement: function (event) {
45
+ return inProgressEvent.endMeasurement(__assign({ startPageVisibility: startPageVisibility, endPageVisibility: _this.getPageVisibility() }, event));
46
+ } });
47
+ };
48
+ return BrowserPerformanceClient;
49
+ }(PerformanceClient));
50
+
51
+ export { BrowserPerformanceClient };
52
+ //# sourceMappingURL=BrowserPerformanceClient.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserPerformanceClient.js","sources":["../../src/telemetry/BrowserPerformanceClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Logger, PerformanceEvent, PerformanceEvents, IPerformanceClient, PerformanceClient, IPerformanceMeasurement, InProgressPerformanceEvent, ApplicationTelemetry } from \"@azure/msal-common\";\nimport { BrowserCrypto } from \"../crypto/BrowserCrypto\";\nimport { GuidGenerator } from \"../crypto/GuidGenerator\";\nimport { BrowserPerformanceMeasurement } from \"./BrowserPerformanceMeasurement\";\n\nexport class BrowserPerformanceClient extends PerformanceClient implements IPerformanceClient {\n private browserCrypto: BrowserCrypto;\n private guidGenerator: GuidGenerator;\n \n constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry) {\n super(clientId, authority, logger, libraryName, libraryVersion, applicationTelemetry);\n this.browserCrypto = new BrowserCrypto(this.logger);\n this.guidGenerator = new GuidGenerator(this.browserCrypto);\n }\n \n startPerformanceMeasuremeant(measureName: string, correlationId: string): IPerformanceMeasurement {\n return new BrowserPerformanceMeasurement(measureName, correlationId);\n }\n\n generateId() : string {\n return this.guidGenerator.generateGuid();\n }\n\n private getPageVisibility(): string | null {\n return document.visibilityState?.toString() || null;\n }\n \n /**\n * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.\n * Also captures browser page visibilityState.\n *\n * @param {PerformanceEvents} measureName\n * @param {?string} [correlationId]\n * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}\n */\n startMeasurement(measureName: PerformanceEvents, correlationId?: string): InProgressPerformanceEvent {\n // Capture page visibilityState and then invoke start/end measurement\n const startPageVisibility = this.getPageVisibility();\n \n const inProgressEvent = super.startMeasurement(measureName, correlationId);\n\n return {\n ...inProgressEvent,\n endMeasurement: (event?: Partial<PerformanceEvent>): PerformanceEvent | null => {\n return inProgressEvent.endMeasurement({\n startPageVisibility,\n endPageVisibility: this.getPageVisibility(),\n ...event\n });\n }\n };\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;;IAU8C,4CAAiB;IAI3D,kCAAY,QAAgB,EAAE,SAAiB,EAAE,MAAc,EAAE,WAAmB,EAAE,cAAsB,EAAE,oBAA0C;QAAxJ,YACI,kBAAM,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,cAAc,EAAE,oBAAoB,CAAC,SAGxF;QAFG,KAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,KAAI,CAAC,MAAM,CAAC,CAAC;QACpD,KAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,KAAI,CAAC,aAAa,CAAC,CAAC;;KAC9D;IAED,+DAA4B,GAA5B,UAA6B,WAAmB,EAAE,aAAqB;QACnE,OAAO,IAAI,6BAA6B,CAAC,WAAW,EAAE,aAAa,CAAC,CAAC;KACxE;IAED,6CAAU,GAAV;QACI,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;KAC5C;IAEO,oDAAiB,GAAzB;;QACI,OAAO,OAAA,QAAQ,CAAC,eAAe,0CAAE,QAAQ,OAAM,IAAI,CAAC;KACvD;;;;;;;;;IAUD,mDAAgB,GAAhB,UAAiB,WAA8B,EAAE,aAAsB;QAAvE,iBAgBC;;QAdG,IAAM,mBAAmB,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;QAErD,IAAM,eAAe,GAAG,iBAAM,gBAAgB,YAAC,WAAW,EAAE,aAAa,CAAC,CAAC;QAE3E,6BACO,eAAe,KAClB,cAAc,EAAE,UAAC,KAAiC;gBAC9C,OAAO,eAAe,CAAC,cAAc,YACjC,mBAAmB,qBAAA,EACnB,iBAAiB,EAAE,KAAI,CAAC,iBAAiB,EAAE,IACxC,KAAK,EACV,CAAC;aACN,IACH;KACL;IACL,+BAAC;AAAD,CA/CA,CAA8C,iBAAiB;;;;"}
@@ -0,0 +1,13 @@
1
+ import { IPerformanceMeasurement } from "@azure/msal-common";
2
+ export declare class BrowserPerformanceMeasurement implements IPerformanceMeasurement {
3
+ private measureName;
4
+ private correlationId;
5
+ private startMark;
6
+ private endMark;
7
+ constructor(name: string, correlationId: string);
8
+ static supportsBrowserPerformance(): boolean;
9
+ startMeasurement(): void;
10
+ endMeasurement(): void;
11
+ flushMeasurement(): number | null;
12
+ }
13
+ //# sourceMappingURL=BrowserPerformanceMeasurement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BrowserPerformanceMeasurement.d.ts","sourceRoot":"","sources":["../../src/telemetry/BrowserPerformanceMeasurement.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D,qBAAa,6BAA8B,YAAW,uBAAuB;IACzE,OAAO,CAAC,WAAW,CAAS;IAC5B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;gBAEZ,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;IAO/C,MAAM,CAAC,0BAA0B,IAAI,OAAO;IAU5C,gBAAgB,IAAI,IAAI;IAUxB,cAAc,IAAG,IAAI;IAWrB,gBAAgB,IAAI,MAAM,GAAG,IAAI;CAiBpC"}
@@ -0,0 +1,66 @@
1
+ /*! @azure/msal-browser v2.24.0 2022-05-02 */
2
+ 'use strict';
3
+ /*
4
+ * Copyright (c) Microsoft Corporation. All rights reserved.
5
+ * Licensed under the MIT License.
6
+ */
7
+ var BrowserPerformanceMeasurement = /** @class */ (function () {
8
+ function BrowserPerformanceMeasurement(name, correlationId) {
9
+ this.correlationId = correlationId;
10
+ this.measureName = "msal.measure." + name + "." + this.correlationId;
11
+ this.startMark = "msal.start." + name + "." + this.correlationId;
12
+ this.endMark = "msal.end." + name + "." + this.correlationId;
13
+ }
14
+ BrowserPerformanceMeasurement.supportsBrowserPerformance = function () {
15
+ return typeof window !== "undefined" &&
16
+ typeof window.performance !== "undefined" &&
17
+ typeof window.performance.mark === "function" &&
18
+ typeof window.performance.measure === "function" &&
19
+ typeof window.performance.clearMarks === "function" &&
20
+ typeof window.performance.clearMeasures === "function" &&
21
+ typeof window.performance.getEntriesByName === "function";
22
+ };
23
+ BrowserPerformanceMeasurement.prototype.startMeasurement = function () {
24
+ if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
25
+ try {
26
+ window.performance.mark(this.startMark);
27
+ }
28
+ catch (e) {
29
+ // Silently catch
30
+ }
31
+ }
32
+ };
33
+ BrowserPerformanceMeasurement.prototype.endMeasurement = function () {
34
+ if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
35
+ try {
36
+ window.performance.mark(this.endMark);
37
+ window.performance.measure(this.measureName, this.startMark, this.endMark);
38
+ }
39
+ catch (e) {
40
+ // Silently catch
41
+ }
42
+ }
43
+ };
44
+ BrowserPerformanceMeasurement.prototype.flushMeasurement = function () {
45
+ if (BrowserPerformanceMeasurement.supportsBrowserPerformance()) {
46
+ try {
47
+ var entriesForMeasurement = window.performance.getEntriesByName(this.measureName, "measure");
48
+ if (entriesForMeasurement.length > 0) {
49
+ var durationMs = entriesForMeasurement[0].duration;
50
+ window.performance.clearMeasures(this.measureName);
51
+ window.performance.clearMarks(this.startMark);
52
+ window.performance.clearMarks(this.endMark);
53
+ return durationMs;
54
+ }
55
+ }
56
+ catch (e) {
57
+ // Silently catch and return null
58
+ }
59
+ }
60
+ return null;
61
+ };
62
+ return BrowserPerformanceMeasurement;
63
+ }());
64
+
65
+ export { BrowserPerformanceMeasurement };
66
+ //# sourceMappingURL=BrowserPerformanceMeasurement.js.map