@azure/msal-browser 2.16.1 → 2.20.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 (163) hide show
  1. package/CHANGELOG.json +283 -0
  2. package/{changelog.md → CHANGELOG.md} +73 -1
  3. package/README.md +12 -4
  4. package/dist/_virtual/_tslib.js +1 -1
  5. package/dist/app/ClientApplication.d.ts +35 -137
  6. package/dist/app/ClientApplication.d.ts.map +1 -1
  7. package/dist/app/ClientApplication.js +178 -883
  8. package/dist/app/ClientApplication.js.map +1 -1
  9. package/dist/app/IPublicClientApplication.d.ts +8 -0
  10. package/dist/app/IPublicClientApplication.d.ts.map +1 -1
  11. package/dist/app/IPublicClientApplication.js +16 -1
  12. package/dist/app/IPublicClientApplication.js.map +1 -1
  13. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  14. package/dist/app/PublicClientApplication.js +35 -41
  15. package/dist/app/PublicClientApplication.js.map +1 -1
  16. package/dist/cache/AsyncMemoryStorage.d.ts +46 -0
  17. package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -0
  18. package/dist/cache/AsyncMemoryStorage.js +195 -0
  19. package/dist/cache/AsyncMemoryStorage.js.map +1 -0
  20. package/dist/cache/BrowserCacheManager.d.ts +19 -2
  21. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  22. package/dist/cache/BrowserCacheManager.js +104 -15
  23. package/dist/cache/BrowserCacheManager.js.map +1 -1
  24. package/dist/cache/BrowserStorage.d.ts +1 -1
  25. package/dist/cache/BrowserStorage.d.ts.map +1 -1
  26. package/dist/cache/BrowserStorage.js +1 -1
  27. package/dist/cache/BrowserStorage.js.map +1 -1
  28. package/dist/cache/DatabaseStorage.d.ts +29 -4
  29. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  30. package/dist/cache/DatabaseStorage.js +151 -45
  31. package/dist/cache/DatabaseStorage.js.map +1 -1
  32. package/dist/cache/IAsyncMemoryStorage.d.ts +28 -0
  33. package/dist/cache/IAsyncMemoryStorage.d.ts.map +1 -0
  34. package/dist/cache/ITokenCache.d.ts +8 -0
  35. package/dist/cache/ITokenCache.d.ts.map +1 -0
  36. package/dist/cache/IWindowStorage.d.ts +3 -3
  37. package/dist/cache/IWindowStorage.d.ts.map +1 -1
  38. package/dist/cache/MemoryStorage.d.ts +3 -3
  39. package/dist/cache/MemoryStorage.d.ts.map +1 -1
  40. package/dist/cache/MemoryStorage.js +1 -1
  41. package/dist/cache/MemoryStorage.js.map +1 -1
  42. package/dist/cache/TokenCache.d.ts +48 -0
  43. package/dist/cache/TokenCache.d.ts.map +1 -0
  44. package/dist/cache/TokenCache.js +124 -0
  45. package/dist/cache/TokenCache.js.map +1 -0
  46. package/dist/config/Configuration.js +1 -1
  47. package/dist/crypto/BrowserCrypto.d.ts +3 -1
  48. package/dist/crypto/BrowserCrypto.d.ts.map +1 -1
  49. package/dist/crypto/BrowserCrypto.js +3 -2
  50. package/dist/crypto/BrowserCrypto.js.map +1 -1
  51. package/dist/crypto/CryptoOps.d.ts +21 -6
  52. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  53. package/dist/crypto/CryptoOps.js +67 -15
  54. package/dist/crypto/CryptoOps.js.map +1 -1
  55. package/dist/crypto/GuidGenerator.js +1 -1
  56. package/dist/crypto/PkceGenerator.js +1 -1
  57. package/dist/crypto/SignedHttpRequest.d.ts +31 -0
  58. package/dist/crypto/SignedHttpRequest.d.ts.map +1 -0
  59. package/dist/crypto/SignedHttpRequest.js +70 -0
  60. package/dist/crypto/SignedHttpRequest.js.map +1 -0
  61. package/dist/encode/Base64Decode.js +1 -1
  62. package/dist/encode/Base64Encode.js +1 -1
  63. package/dist/error/BrowserAuthError.d.ts +36 -4
  64. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  65. package/dist/error/BrowserAuthError.js +51 -11
  66. package/dist/error/BrowserAuthError.js.map +1 -1
  67. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  68. package/dist/event/EventHandler.d.ts +13 -0
  69. package/dist/event/EventHandler.d.ts.map +1 -1
  70. package/dist/event/EventHandler.js +66 -1
  71. package/dist/event/EventHandler.js.map +1 -1
  72. package/dist/event/EventMessage.d.ts +4 -3
  73. package/dist/event/EventMessage.d.ts.map +1 -1
  74. package/dist/event/EventMessage.js +24 -5
  75. package/dist/event/EventMessage.js.map +1 -1
  76. package/dist/event/EventType.d.ts +5 -0
  77. package/dist/event/EventType.d.ts.map +1 -1
  78. package/dist/event/EventType.js +6 -1
  79. package/dist/event/EventType.js.map +1 -1
  80. package/dist/index.cjs.js +4678 -2996
  81. package/dist/index.cjs.js.map +1 -1
  82. package/dist/index.d.ts +6 -2
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +4 -2
  85. package/dist/index.js.map +1 -1
  86. package/dist/interaction_client/BaseInteractionClient.d.ts +42 -0
  87. package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -0
  88. package/dist/interaction_client/BaseInteractionClient.js +131 -0
  89. package/dist/interaction_client/BaseInteractionClient.js.map +1 -0
  90. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts +5 -0
  91. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.d.ts.map +1 -0
  92. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +21 -0
  93. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js.map +1 -0
  94. package/dist/interaction_client/PopupClient.d.ts +37 -0
  95. package/dist/interaction_client/PopupClient.d.ts.map +1 -0
  96. package/dist/interaction_client/PopupClient.js +234 -0
  97. package/dist/interaction_client/PopupClient.js.map +1 -0
  98. package/dist/interaction_client/RedirectClient.d.ts +42 -0
  99. package/dist/interaction_client/RedirectClient.d.ts.map +1 -0
  100. package/dist/interaction_client/RedirectClient.js +301 -0
  101. package/dist/interaction_client/RedirectClient.js.map +1 -0
  102. package/dist/interaction_client/SilentAuthCodeClient.d.ts +22 -0
  103. package/dist/interaction_client/SilentAuthCodeClient.d.ts.map +1 -0
  104. package/dist/interaction_client/SilentAuthCodeClient.js +80 -0
  105. package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -0
  106. package/dist/interaction_client/SilentCacheClient.d.ts +22 -0
  107. package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -0
  108. package/dist/interaction_client/SilentCacheClient.js +85 -0
  109. package/dist/interaction_client/SilentCacheClient.js.map +1 -0
  110. package/dist/interaction_client/SilentIframeClient.d.ts +29 -0
  111. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -0
  112. package/dist/interaction_client/SilentIframeClient.js +107 -0
  113. package/dist/interaction_client/SilentIframeClient.js.map +1 -0
  114. package/dist/interaction_client/SilentRefreshClient.d.ts +20 -0
  115. package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -0
  116. package/dist/interaction_client/SilentRefreshClient.js +76 -0
  117. package/dist/interaction_client/SilentRefreshClient.js.map +1 -0
  118. package/dist/interaction_client/StandardInteractionClient.d.ts +66 -0
  119. package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -0
  120. package/dist/interaction_client/StandardInteractionClient.js +249 -0
  121. package/dist/interaction_client/StandardInteractionClient.js.map +1 -0
  122. package/dist/interaction_handler/InteractionHandler.d.ts +11 -2
  123. package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
  124. package/dist/interaction_handler/InteractionHandler.js +36 -10
  125. package/dist/interaction_handler/InteractionHandler.js.map +1 -1
  126. package/dist/interaction_handler/PopupHandler.d.ts +2 -0
  127. package/dist/interaction_handler/PopupHandler.d.ts.map +1 -1
  128. package/dist/interaction_handler/PopupHandler.js +3 -4
  129. package/dist/interaction_handler/PopupHandler.js.map +1 -1
  130. package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
  131. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  132. package/dist/interaction_handler/RedirectHandler.js +7 -6
  133. package/dist/interaction_handler/RedirectHandler.js.map +1 -1
  134. package/dist/interaction_handler/SilentHandler.js +1 -1
  135. package/dist/navigation/NavigationClient.js +1 -1
  136. package/dist/network/FetchClient.js +1 -1
  137. package/dist/network/XhrClient.js +1 -1
  138. package/dist/packageMetadata.d.ts +1 -1
  139. package/dist/packageMetadata.js +2 -2
  140. package/dist/packageMetadata.js.map +1 -1
  141. package/dist/request/AuthorizationCodeRequest.d.ts +8 -0
  142. package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -0
  143. package/dist/request/EndSessionPopupRequest.d.ts +3 -0
  144. package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
  145. package/dist/request/PopupRequest.d.ts +3 -0
  146. package/dist/request/PopupRequest.d.ts.map +1 -1
  147. package/dist/request/RedirectRequest.d.ts.map +1 -1
  148. package/dist/utils/BrowserConstants.d.ts +13 -1
  149. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  150. package/dist/utils/BrowserConstants.js +17 -3
  151. package/dist/utils/BrowserConstants.js.map +1 -1
  152. package/dist/utils/BrowserProtocolUtils.js +1 -1
  153. package/dist/utils/BrowserStringUtils.js +1 -1
  154. package/dist/utils/BrowserUtils.js +1 -1
  155. package/dist/utils/MathUtils.js +1 -1
  156. package/dist/utils/PopupUtils.d.ts +26 -2
  157. package/dist/utils/PopupUtils.d.ts.map +1 -1
  158. package/dist/utils/PopupUtils.js +42 -15
  159. package/dist/utils/PopupUtils.js.map +1 -1
  160. package/lib/msal-browser.js +4678 -2996
  161. package/lib/msal-browser.js.map +1 -1
  162. package/lib/msal-browser.min.js +32 -32
  163. package/package.json +9 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StandardInteractionClient.js","sources":["../../src/interaction_client/StandardInteractionClient.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICrypto, Logger, ServerTelemetryManager, CommonAuthorizationCodeRequest, Constants, AuthorizationCodeClient, ClientConfiguration, AuthorityOptions, Authority, AuthorityFactory, ServerAuthorizationCodeResponse, UrlString, CommonEndSessionRequest, ProtocolUtils, ResponseMode, StringUtils } from \"@azure/msal-common\";\nimport { BaseInteractionClient } from \"./BaseInteractionClient\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { AuthorizationUrlRequest } from \"../request/AuthorizationUrlRequest\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { EventHandler } from \"../event/EventHandler\";\nimport { BrowserConstants, InteractionType } from \"../utils/BrowserConstants\";\nimport { version } from \"../packageMetadata\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { BrowserProtocolUtils, BrowserStateObject } from \"../utils/BrowserProtocolUtils\";\nimport { EndSessionRequest } from \"../request/EndSessionRequest\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { SsoSilentRequest } from \"../request/SsoSilentRequest\";\n\n/**\n * Defines the class structure and helper functions used by the \"standard\", non-brokered auth flows (popup, redirect, silent (RT), silent (iframe))\n */\nexport abstract class StandardInteractionClient extends BaseInteractionClient {\n protected navigationClient: INavigationClient;\n\n constructor(config: BrowserConfiguration, storageImpl: BrowserCacheManager, browserCrypto: ICrypto, logger: Logger, eventHandler: EventHandler, navigationClient: INavigationClient, correlationId?: string) {\n super(config, storageImpl, browserCrypto, logger, eventHandler, correlationId);\n this.navigationClient = navigationClient;\n }\n \n /**\n * Generates an auth code request tied to the url request.\n * @param request\n */\n protected async initializeAuthorizationCodeRequest(request: AuthorizationUrlRequest): Promise<CommonAuthorizationCodeRequest> {\n this.logger.verbose(\"initializeAuthorizationRequest called\", request.correlationId);\n const generatedPkceParams = await this.browserCrypto.generatePkceCodes();\n\n const authCodeRequest: CommonAuthorizationCodeRequest = {\n ...request,\n redirectUri: request.redirectUri,\n code: \"\",\n codeVerifier: generatedPkceParams.verifier\n };\n\n request.codeChallenge = generatedPkceParams.challenge;\n request.codeChallengeMethod = Constants.S256_CODE_CHALLENGE_METHOD;\n\n return authCodeRequest;\n }\n\n /**\n * Initializer for the logout request.\n * @param logoutRequest\n */\n protected initializeLogoutRequest(logoutRequest?: EndSessionRequest): CommonEndSessionRequest {\n this.logger.verbose(\"initializeLogoutRequest called\", logoutRequest?.correlationId);\n\n // Check if interaction is in progress. Throw error if true.\n if (this.browserStorage.isInteractionInProgress()) {\n throw BrowserAuthError.createInteractionInProgressError();\n }\n\n const validLogoutRequest: CommonEndSessionRequest = {\n correlationId: this.browserCrypto.createNewGuid(),\n ...logoutRequest\n };\n\n /*\n * Only set redirect uri if logout request isn't provided or the set uri isn't null.\n * Otherwise, use passed uri, config, or current page.\n */\n if (!logoutRequest || logoutRequest.postLogoutRedirectUri !== null) {\n if (logoutRequest && logoutRequest.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to uri set on logout request\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(logoutRequest.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\n } else if (this.config.auth.postLogoutRedirectUri === null) {\n this.logger.verbose(\"postLogoutRedirectUri configured as null and no uri set on request, not passing post logout redirect\", validLogoutRequest.correlationId);\n } else if (this.config.auth.postLogoutRedirectUri) {\n this.logger.verbose(\"Setting postLogoutRedirectUri to configured uri\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(this.config.auth.postLogoutRedirectUri, BrowserUtils.getCurrentUri());\n } else {\n this.logger.verbose(\"Setting postLogoutRedirectUri to current page\", validLogoutRequest.correlationId);\n validLogoutRequest.postLogoutRedirectUri = UrlString.getAbsoluteUrl(BrowserUtils.getCurrentUri(), BrowserUtils.getCurrentUri());\n }\n } else {\n this.logger.verbose(\"postLogoutRedirectUri passed as null, not setting post logout redirect uri\", validLogoutRequest.correlationId);\n }\n\n return validLogoutRequest;\n }\n\n /**\n * Creates an Authorization Code Client with the given authority, or the default authority.\n * @param serverTelemetryManager\n * @param authorityUrl\n */\n protected async createAuthCodeClient(serverTelemetryManager: ServerTelemetryManager, authorityUrl?: string): Promise<AuthorizationCodeClient> {\n // Create auth module.\n const clientConfig = await this.getClientConfiguration(serverTelemetryManager, authorityUrl);\n return new AuthorizationCodeClient(clientConfig);\n }\n\n /**\n * Creates a Client Configuration object with the given request authority, or the default authority.\n * @param serverTelemetryManager\n * @param requestAuthority\n * @param requestCorrelationId\n */\n protected async getClientConfiguration(serverTelemetryManager: ServerTelemetryManager, requestAuthority?: string): Promise<ClientConfiguration> {\n this.logger.verbose(\"getClientConfiguration called\");\n const discoveredAuthority = await this.getDiscoveredAuthority(requestAuthority);\n\n return {\n authOptions: {\n clientId: this.config.auth.clientId,\n authority: discoveredAuthority,\n clientCapabilities: this.config.auth.clientCapabilities\n },\n systemOptions: {\n tokenRenewalOffsetSeconds: this.config.system.tokenRenewalOffsetSeconds,\n preventCorsPreflight: true\n },\n loggerOptions: {\n loggerCallback: this.config.system.loggerOptions.loggerCallback,\n piiLoggingEnabled: this.config.system.loggerOptions.piiLoggingEnabled,\n logLevel: this.config.system.loggerOptions.logLevel,\n correlationId: this.correlationId\n },\n cryptoInterface: this.browserCrypto,\n networkInterface: this.networkClient,\n storageInterface: this.browserStorage,\n serverTelemetryManager: serverTelemetryManager,\n libraryInfo: {\n sku: BrowserConstants.MSAL_SKU,\n version: version,\n cpu: \"\",\n os: \"\"\n }\n };\n }\n\n /**\n * @param hash\n * @param interactionType\n */\n protected validateAndExtractStateFromHash(hash: string, interactionType: InteractionType, requestCorrelationId?: string): string {\n this.logger.verbose(\"validateAndExtractStateFromHash called\", requestCorrelationId);\n // Deserialize hash fragment response parameters.\n const serverParams: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\n if (!serverParams.state) {\n throw BrowserAuthError.createHashDoesNotContainStateError();\n }\n\n const platformStateObj = BrowserProtocolUtils.extractBrowserRequestState(this.browserCrypto, serverParams.state);\n if (!platformStateObj) {\n throw BrowserAuthError.createUnableToParseStateError();\n }\n\n if (platformStateObj.interactionType !== interactionType) {\n throw BrowserAuthError.createStateInteractionTypeMismatchError();\n }\n\n this.logger.verbose(\"Returning state from hash\", requestCorrelationId);\n return serverParams.state;\n }\n\n /**\n * Used to get a discovered version of the default authority.\n * @param requestAuthority\n * @param requestCorrelationId\n */\n protected async getDiscoveredAuthority(requestAuthority?: string): Promise<Authority> {\n this.logger.verbose(\"getDiscoveredAuthority called\");\n const authorityOptions: AuthorityOptions = {\n protocolMode: this.config.auth.protocolMode,\n knownAuthorities: this.config.auth.knownAuthorities,\n cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,\n authorityMetadata: this.config.auth.authorityMetadata\n };\n\n if (requestAuthority) {\n this.logger.verbose(\"Creating discovered authority with request authority\");\n return await AuthorityFactory.createDiscoveredInstance(requestAuthority, this.config.system.networkClient, this.browserStorage, authorityOptions);\n }\n\n this.logger.verbose(\"Creating discovered authority with configured authority\");\n return await AuthorityFactory.createDiscoveredInstance(this.config.auth.authority, this.config.system.networkClient, this.browserStorage, authorityOptions);\n }\n\n /**\n * Helper to validate app environment before making a request.\n * @param request\n * @param interactionType\n */\n protected preflightInteractiveRequest(request: RedirectRequest|PopupRequest, interactionType: InteractionType): AuthorizationUrlRequest {\n this.logger.verbose(\"preflightInteractiveRequest called, validating app environment\", request?.correlationId);\n // block the reload if it occurred inside a hidden iframe\n BrowserUtils.blockReloadInHiddenIframes();\n \n // Check if interaction is in progress. Throw error if true.\n if (this.browserStorage.isInteractionInProgress(false)) {\n throw BrowserAuthError.createInteractionInProgressError();\n }\n \n return this.initializeAuthorizationRequest(request, interactionType);\n }\n\n /**\n * Helper to initialize required request parameters for interactive APIs and ssoSilent()\n * @param request\n * @param interactionType\n */\n protected initializeAuthorizationRequest(request: RedirectRequest|PopupRequest|SsoSilentRequest, interactionType: InteractionType): AuthorizationUrlRequest {\n this.logger.verbose(\"initializeAuthorizationRequest called\");\n const redirectUri = this.getRedirectUri(request.redirectUri);\n const browserState: BrowserStateObject = {\n interactionType: interactionType\n };\n\n const state = ProtocolUtils.setRequestState(\n this.browserCrypto,\n (request && request.state) || \"\",\n browserState\n );\n\n const validatedRequest: AuthorizationUrlRequest = {\n ...this.initializeBaseRequest(request),\n redirectUri: redirectUri,\n state: state,\n nonce: request.nonce || this.browserCrypto.createNewGuid(),\n responseMode: ResponseMode.FRAGMENT\n };\n\n const account = request.account || this.browserStorage.getActiveAccount();\n if (account) {\n this.logger.verbose(\"Setting validated request account\");\n this.logger.verbosePii(`Setting validated request account: ${account}`);\n validatedRequest.account = account;\n }\n\n // Check for ADAL/MSAL v1 SSO\n if (StringUtils.isEmpty(validatedRequest.loginHint) && !account) {\n const legacyLoginHint = this.browserStorage.getLegacyLoginHint();\n if (legacyLoginHint) {\n validatedRequest.loginHint = legacyLoginHint;\n }\n }\n\n this.browserStorage.updateCacheEntries(validatedRequest.state, validatedRequest.nonce, validatedRequest.authority, validatedRequest.loginHint || \"\", validatedRequest.account || null);\n\n return validatedRequest;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAsBA;;;;IAGwD,6CAAqB;IAGzE,mCAAY,MAA4B,EAAE,WAAgC,EAAE,aAAsB,EAAE,MAAc,EAAE,YAA0B,EAAE,gBAAmC,EAAE,aAAsB;QAA3M,YACI,kBAAM,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,CAAC,SAEjF;QADG,KAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;;KAC5C;;;;;IAMe,sEAAkC,GAAlD,UAAmD,OAAgC;;;;;;wBAC/E,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,uCAAuC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;wBACxD,qBAAM,IAAI,CAAC,aAAa,CAAC,iBAAiB,EAAE,EAAA;;wBAAlE,mBAAmB,GAAG,SAA4C;wBAElE,eAAe,yBACd,OAAO,KACV,WAAW,EAAE,OAAO,CAAC,WAAW,EAChC,IAAI,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ACxE,gBAAgB,CAAC,OAAO,GAAG,OAAO,CAAC;SACtC;;QAGD,IAAI,WAAW,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,EAAE;YAC7D,IAAM,eAAe,GAAG,IAAI,CAAC,cAAc,CAAC,kBAAkB,EAAE,CAAC;YACjE,IAAI,eAAe,EAAE;gBACjB,gBAAgB,CAAC,SAAS,GAAG,eAAe,CAAC;aAChD;SACJ;QAED,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,CAAC,SAAS,IAAI,EAAE,EAAE,gBAAgB,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC;QAEvL,OAAO,gBAAgB,CAAC;KAC3B;IACL,gCAAC;AAAD,CAvOA,CAAwD,qBAAqB;;;;"}
@@ -1,4 +1,4 @@
1
- import { CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule, CcsCredential, Logger } from "@azure/msal-common";
1
+ import { AuthorizationCodePayload, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, Authority, INetworkModule, CcsCredential, Logger } from "@azure/msal-common";
2
2
  import { BrowserCacheManager } from "../cache/BrowserCacheManager";
3
3
  export declare type InteractionParams = {};
4
4
  /**
@@ -19,7 +19,16 @@ export declare abstract class InteractionHandler {
19
19
  * Function to handle response parameters from hash.
20
20
  * @param locationHash
21
21
  */
22
- handleCodeResponse(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult>;
22
+ handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule): Promise<AuthenticationResult>;
23
+ /**
24
+ * Process auth code response from AAD
25
+ * @param authCodeResponse
26
+ * @param state
27
+ * @param authority
28
+ * @param networkModule
29
+ * @returns
30
+ */
31
+ handleCodeResponseFromServer(authCodeResponse: AuthorizationCodePayload, state: string, authority: Authority, networkModule: INetworkModule, validateNonce?: boolean): Promise<AuthenticationResult>;
23
32
  /**
24
33
  * Updates authority based on cloudInstanceHostname
25
34
  * @param cloudInstanceHostname
@@ -1 +1 @@
1
- {"version":3,"file":"InteractionHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/InteractionHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAe,8BAA8B,EAAE,oBAAoB,EAAE,uBAAuB,EAAoB,SAAS,EAAE,cAAc,EAAmB,aAAa,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACrN,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAInE,oBAAY,iBAAiB,GAAG,EAAE,CAAC;AAEnC;;GAEG;AACH,8BAAsB,kBAAkB;IAEpC,SAAS,CAAC,UAAU,EAAE,uBAAuB,CAAC;IAC9C,SAAS,CAAC,cAAc,EAAE,mBAAmB,CAAC;IAC9C,SAAS,CAAC,eAAe,EAAE,8BAA8B,CAAC;IAC1D,SAAS,CAAC,oBAAoB,EAAE,MAAM,CAAC;gBAE3B,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,8BAA8B,EAAE,oBAAoB,EAAE,MAAM;IAOpK;;;OAGG;IACH,QAAQ,CAAC,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,iBAAiB,GAAG,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAEhI;;;OAGG;IACG,kBAAkB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA8CjJ;;;;;OAKG;cACa,4BAA4B,CAAC,qBAAqB,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,GAAG,OAAO,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Ac,GAAG,OAAO,CAAC,oBAAoB,CAAC;IA6ChN;;;;;OAKG;cACa,4BAA4B,CAAC,qBAAqB,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAM/I;;OAEG;IACH,SAAS,CAAC,mBAAmB,IAAI,aAAa,GAAG,IAAI;CAaxD"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { StringUtils, ClientAuthError, AuthorityFactory } from '@azure/msal-common';
@@ -23,23 +23,46 @@ var InteractionHandler = /** @class */ (function () {
23
23
  * Function to handle response parameters from hash.
24
24
  * @param locationHash
25
25
  */
26
- InteractionHandler.prototype.handleCodeResponse = function (locationHash, state, authority, networkModule) {
26
+ InteractionHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule) {
27
27
  return __awaiter(this, void 0, void 0, function () {
28
- var stateKey, requestState, authCodeResponse, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
28
+ var stateKey, requestState, authCodeResponse;
29
+ return __generator(this, function (_a) {
30
+ this.browserRequestLogger.verbose("InteractionHandler.handleCodeResponse called");
31
+ // Check that location hash isn't empty.
32
+ if (StringUtils.isEmpty(locationHash)) {
33
+ throw BrowserAuthError.createEmptyHashError(locationHash);
34
+ }
35
+ stateKey = this.browserStorage.generateStateKey(state);
36
+ requestState = this.browserStorage.getTemporaryCache(stateKey);
37
+ if (!requestState) {
38
+ throw ClientAuthError.createStateNotFoundError("Cached State");
39
+ }
40
+ authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
41
+ return [2 /*return*/, this.handleCodeResponseFromServer(authCodeResponse, state, authority, networkModule)];
42
+ });
43
+ });
44
+ };
45
+ /**
46
+ * Process auth code response from AAD
47
+ * @param authCodeResponse
48
+ * @param state
49
+ * @param authority
50
+ * @param networkModule
51
+ * @returns
52
+ */
53
+ InteractionHandler.prototype.handleCodeResponseFromServer = function (authCodeResponse, state, authority, networkModule, validateNonce) {
54
+ if (validateNonce === void 0) { validateNonce = true; }
55
+ return __awaiter(this, void 0, void 0, function () {
56
+ var stateKey, requestState, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
29
57
  return __generator(this, function (_a) {
30
58
  switch (_a.label) {
31
59
  case 0:
32
- this.browserRequestLogger.verbose("InteractionHandler.handleCodeResponse called");
33
- // Check that location hash isn't empty.
34
- if (StringUtils.isEmpty(locationHash)) {
35
- throw BrowserAuthError.createEmptyHashError(locationHash);
36
- }
60
+ this.browserRequestLogger.trace("InteractionHandler.handleCodeResponseFromServer called");
37
61
  stateKey = this.browserStorage.generateStateKey(state);
38
62
  requestState = this.browserStorage.getTemporaryCache(stateKey);
39
63
  if (!requestState) {
40
64
  throw ClientAuthError.createStateNotFoundError("Cached State");
41
65
  }
42
- authCodeResponse = this.authModule.handleFragmentResponse(locationHash, requestState);
43
66
  nonceKey = this.browserStorage.generateNonceKey(requestState);
44
67
  cachedNonce = this.browserStorage.getTemporaryCache(nonceKey);
45
68
  // Assign code to request
@@ -50,7 +73,10 @@ var InteractionHandler = /** @class */ (function () {
50
73
  _a.sent();
51
74
  _a.label = 2;
52
75
  case 2:
53
- authCodeResponse.nonce = cachedNonce || undefined;
76
+ // Nonce validation not needed when redirect not involved (e.g. hybrid spa, renewing token via rt)
77
+ if (validateNonce) {
78
+ authCodeResponse.nonce = cachedNonce || undefined;
79
+ }
54
80
  authCodeResponse.state = requestState;
55
81
  // Add CCS parameters if available
56
82
  if (authCodeResponse.client_info) {
@@ -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 { StringUtils, CommonAuthorizationCodeRequest, AuthenticationResult, AuthorizationCodeClient, AuthorityFactory, Authority, INetworkModule, ClientAuthError, CcsCredential, Logger } from \"@azure/msal-common\";\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 handleCodeResponse(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 // 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 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;;;;AAYA;;;;IAUI,4BAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B;QAChK,IAAI,CAAC,UAAU,GAAG,cAAc,CAAC;QACjC,IAAI,CAAC,cAAc,GAAG,WAAW,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AM,CAAC,QAAQ,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 } 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,CA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ACrD;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,9 +1,11 @@
1
1
  import { CommonAuthorizationCodeRequest, AuthorizationCodeClient, Logger } from "@azure/msal-common";
2
2
  import { InteractionHandler, InteractionParams } from "./InteractionHandler";
3
3
  import { BrowserCacheManager } from "../cache/BrowserCacheManager";
4
+ import { PopupWindowAttributes } from "../utils/PopupUtils";
4
5
  export declare type PopupParams = InteractionParams & {
5
6
  popup?: Window | null;
6
7
  popupName: string;
8
+ popupWindowAttributes: PopupWindowAttributes;
7
9
  };
8
10
  /**
9
11
  * This class implements the interaction handler base class for browsers. It is written specifically for handling
@@ -1 +1 @@
1
- {"version":3,"file":"PopupHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/PopupHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0B,8BAA8B,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC7H,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAG7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAInE,oBAAY,WAAW,GAAG,iBAAiB,GAAG;IAC1C,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAA;CACpB,CAAC;AAEF;;;GAGG;AACH,qBAAa,YAAa,SAAQ,kBAAkB;IAChD,OAAO,CAAC,UAAU,CAAa;gBAEnB,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,8BAA8B,EAAE,oBAAoB,EAAE,MAAM;IAOpK;;;OAGG;IACH,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM;IAepE;;;;OAIG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAkB5D"}
1
+ {"version":3,"file":"PopupHandler.d.ts","sourceRoot":"","sources":["../../src/interaction_handler/PopupHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAA0B,8BAA8B,EAAE,uBAAuB,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC7H,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAc,MAAM,qBAAqB,CAAC;AAGxE,oBAAY,WAAW,GAAG,iBAAiB,GAAG;IAC1C,KAAK,CAAC,EAAE,MAAM,GAAC,IAAI,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,qBAAqB,EAAE,qBAAqB,CAAA;CAC/C,CAAC;AAEF;;;GAGG;AACH,qBAAa,YAAa,SAAQ,kBAAkB;IAChD,OAAO,CAAC,UAAU,CAAa;gBAEnB,cAAc,EAAE,uBAAuB,EAAE,WAAW,EAAE,mBAAmB,EAAE,eAAe,EAAE,8BAA8B,EAAE,oBAAoB,EAAE,MAAM;IAOpK;;;OAGG;IACH,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM;IAepE;;;;OAIG;IACH,mBAAmB,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAkB5D"}
@@ -1,10 +1,9 @@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
2
2
  'use strict';
3
3
  import { __extends } from '../_virtual/_tslib.js';
4
4
  import { StringUtils, UrlString } from '@azure/msal-common';
5
5
  import { InteractionHandler } from './InteractionHandler.js';
6
6
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
7
- import { TemporaryCacheKeys, BrowserConstants } from '../utils/BrowserConstants.js';
8
7
  import { PopupUtils } from '../utils/PopupUtils.js';
9
8
  import { BrowserUtils } from '../utils/BrowserUtils.js';
10
9
 
@@ -32,10 +31,10 @@ var PopupHandler = /** @class */ (function (_super) {
32
31
  // Check that request url is not empty.
33
32
  if (!StringUtils.isEmpty(requestUrl)) {
34
33
  // Set interaction status in the library.
35
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.INTERACTION_STATUS_KEY, BrowserConstants.INTERACTION_IN_PROGRESS_VALUE, true);
34
+ this.browserStorage.setInteractionInProgress(true);
36
35
  this.browserRequestLogger.infoPii("Navigate to: " + requestUrl);
37
36
  // Open the popup window to requestUrl.
38
- return this.popupUtils.openPopup(requestUrl, params.popupName, params.popup);
37
+ return this.popupUtils.openPopup(requestUrl, params);
39
38
  }
40
39
  else {
41
40
  // Throw error if request URL is empty.
@@ -1 +1 @@
1
- {"version":3,"file":"PopupHandler.js","sources":["../../src/interaction_handler/PopupHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UrlString, StringUtils, CommonAuthorizationCodeRequest, AuthorizationCodeClient, Logger } from \"@azure/msal-common\";\nimport { InteractionHandler, InteractionParams } from \"./InteractionHandler\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { BrowserConstants, TemporaryCacheKeys } from \"../utils/BrowserConstants\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { PopupUtils } from \"../utils/PopupUtils\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\n\nexport type PopupParams = InteractionParams & {\n popup?: Window|null;\n popupName: string\n};\n\n/**\n * This class implements the interaction handler base class for browsers. It is written specifically for handling\n * popup window scenarios. It includes functions for monitoring the popup window for a hash.\n */\nexport class PopupHandler extends InteractionHandler {\n private popupUtils: PopupUtils;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, browserRequestLogger: Logger) {\n super(authCodeModule, storageImpl, authCodeRequest, browserRequestLogger);\n\n // Properly sets this reference for the unload event.\n this.popupUtils = new PopupUtils(storageImpl, browserRequestLogger);\n }\n\n /**\n * Opens a popup window with given request Url.\n * @param requestUrl\n */\n initiateAuthRequest(requestUrl: string, params: PopupParams): Window {\n // Check that request url is not empty.\n if (!StringUtils.isEmpty(requestUrl)) {\n // Set interaction status in the library.\n this.browserStorage.setTemporaryCache(TemporaryCacheKeys.INTERACTION_STATUS_KEY, BrowserConstants.INTERACTION_IN_PROGRESS_VALUE, true);\n this.browserRequestLogger.infoPii(`Navigate to: ${requestUrl}`);\n // Open the popup window to requestUrl.\n return this.popupUtils.openPopup(requestUrl, params.popupName, params.popup);\n } else {\n // Throw error if request URL is empty.\n this.browserRequestLogger.error(\"Navigate url is empty\");\n throw BrowserAuthError.createEmptyNavigationUriError();\n }\n }\n\n /**\n * Monitors a window until it loads a url with a known hash, or hits a specified timeout.\n * @param popupWindow - window that is being monitored\n * @param timeout - milliseconds until timeout\n */\n monitorPopupForHash(popupWindow: Window): Promise<string> {\n return this.popupUtils.monitorPopupForSameOrigin(popupWindow).then(() => {\n const contentHash = popupWindow.location.hash;\n BrowserUtils.clearHash(popupWindow);\n this.popupUtils.cleanPopup(popupWindow);\n\n if (!contentHash) {\n throw BrowserAuthError.createEmptyHashError(popupWindow.location.href);\n }\n\n if (UrlString.hashContainsKnownProperties(contentHash)) {\n return contentHash;\n } else {\n throw BrowserAuthError.createHashDoesNotContainKnownPropertiesError();\n }\n }\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;AAAA;;;;AAkBA;;;;;IAIkC,gCAAkB;IAGhD,sBAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B;QAApK,YACI,kBAAM,cA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M;gBACH,MAAM,gBAAgB,CAAC,4CAA4C,EAAE,CAAC;aACzE;SACJ,CACA,CAAC;KACL;IACL,mBAAC;AAAD,CApDA,CAAkC,kBAAkB;;;;"}
1
+ {"version":3,"file":"PopupHandler.js","sources":["../../src/interaction_handler/PopupHandler.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { UrlString, StringUtils, CommonAuthorizationCodeRequest, AuthorizationCodeClient, Logger } from \"@azure/msal-common\";\nimport { InteractionHandler, InteractionParams } from \"./InteractionHandler\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { BrowserCacheManager } from \"../cache/BrowserCacheManager\";\nimport { PopupWindowAttributes, PopupUtils } from \"../utils/PopupUtils\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\n\nexport type PopupParams = InteractionParams & {\n popup?: Window|null;\n popupName: string;\n popupWindowAttributes: PopupWindowAttributes\n};\n\n/**\n * This class implements the interaction handler base class for browsers. It is written specifically for handling\n * popup window scenarios. It includes functions for monitoring the popup window for a hash.\n */\nexport class PopupHandler extends InteractionHandler {\n private popupUtils: PopupUtils;\n\n constructor(authCodeModule: AuthorizationCodeClient, storageImpl: BrowserCacheManager, authCodeRequest: CommonAuthorizationCodeRequest, browserRequestLogger: Logger) {\n super(authCodeModule, storageImpl, authCodeRequest, browserRequestLogger);\n\n // Properly sets this reference for the unload event.\n this.popupUtils = new PopupUtils(storageImpl, browserRequestLogger);\n }\n\n /**\n * Opens a popup window with given request Url.\n * @param requestUrl\n */\n initiateAuthRequest(requestUrl: string, params: PopupParams): Window {\n // Check that request url is not empty.\n if (!StringUtils.isEmpty(requestUrl)) {\n // Set interaction status in the library.\n this.browserStorage.setInteractionInProgress(true);\n this.browserRequestLogger.infoPii(`Navigate to: ${requestUrl}`);\n // Open the popup window to requestUrl.\n return this.popupUtils.openPopup(requestUrl, params);\n } else {\n // Throw error if request URL is empty.\n this.browserRequestLogger.error(\"Navigate url is empty\");\n throw BrowserAuthError.createEmptyNavigationUriError();\n }\n }\n\n /**\n * Monitors a window until it loads a url with a known hash, or hits a specified timeout.\n * @param popupWindow - window that is being monitored\n * @param timeout - milliseconds until timeout\n */\n monitorPopupForHash(popupWindow: Window): Promise<string> {\n return this.popupUtils.monitorPopupForSameOrigin(popupWindow).then(() => {\n const contentHash = popupWindow.location.hash;\n BrowserUtils.clearHash(popupWindow);\n this.popupUtils.cleanPopup(popupWindow);\n\n if (!contentHash) {\n throw BrowserAuthError.createEmptyHashError(popupWindow.location.href);\n }\n\n if (UrlString.hashContainsKnownProperties(contentHash)) {\n return contentHash;\n } else {\n throw BrowserAuthError.createHashDoesNotContainKnownPropertiesError();\n }\n }\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;AAkBA;;;;;IAIkC,gCAAkB;IAGhD,sBAAY,cAAuC,EAAE,WAAgC,EAAE,eAA+C,EAAE,oBAA4B;QAApK,YACI,kBAAM,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,oBAAoB,CAAC,SAI5E;;QADG,KAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;;KACvE;;;;;IAMD,0CAAmB,GAAnB,UAAoB,UAAkB,EAAE,MAAmB;;QAEvD,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;;YAElC,IAAI,CAAC,cAAc,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;YACnD,IAAI,CAAC,oBAAoB,CAAC,OAAO,CAAC,kBAAgB,UAAY,CAAC,CAAC;;YAEhE,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;SACxD;aAAM;;YAEH,IAAI,CAAC,oBAAoB,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;YACzD,MAAM,gBAAgB,CAAC,6BAA6B,EAAE,CAAC;SAC1D;KACJ;;;;;;IAOD,0CAAmB,GAAnB,UAAoB,WAAmB;QAAvC,iBAiBC;QAhBG,OAAO,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;YAC/D,IAAM,WAAW,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC;YAC9C,YAAY,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;YACpC,KAAI,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YAExC,IAAI,CAAC,WAAW,EAAE;gBACd,MAAM,gBAAgB,CAAC,oBAAoB,CAAC,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;aAC1E;YAED,IAAI,SAAS,CAAC,2BAA2B,CAAC,WAAW,CAAC,EAAE;gBACpD,OAAO,WAAW,CAAC;aACtB;iBAAM;gBACH,MAAM,gBAAgB,CAAC,4CAA4C,EAAE,CAAC;aACzE;SACJ,CACA,CAAC;KACL;IACL,mBAAC;AAAD,CApDA,CAAkC,kBAAkB;;;;"}
@@ -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
- handleCodeResponse(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule, clientId?: string): Promise<AuthenticationResult>;
23
+ handleCodeResponseFromHash(locationHash: string, state: string, authority: Authority, networkModule: INetworkModule, clientId?: string): 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/RedirectHandler.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAe,8BAA8B,EAAE,OAAO,EAAE,oBAAoB,EAAmB,SAAS,EAAE,cAAc,EAAmB,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG9M,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,O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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;IAgDpF;;;OAGG;IACG,0BAA0B,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAuD/K"}
@@ -1,9 +1,9 @@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { StringUtils, ThrottlingUtils, ClientAuthError } from '@azure/msal-common';
5
5
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
6
- import { TemporaryCacheKeys, BrowserConstants, ApiId } from '../utils/BrowserConstants.js';
6
+ import { TemporaryCacheKeys, ApiId } from '../utils/BrowserConstants.js';
7
7
  import { InteractionHandler } from './InteractionHandler.js';
8
8
 
9
9
  /*
@@ -35,7 +35,8 @@ var RedirectHandler = /** @class */ (function (_super) {
35
35
  this.browserStorage.setTemporaryCache(TemporaryCacheKeys.ORIGIN_URI, params.redirectStartPage, true);
36
36
  }
37
37
  // Set interaction status in the library.
38
- this.browserStorage.setTemporaryCache(TemporaryCacheKeys.INTERACTION_STATUS_KEY, BrowserConstants.INTERACTION_IN_PROGRESS_VALUE, true);
38
+ this.browserStorage.setInteractionInProgress(true);
39
+ this.browserStorage.setTemporaryCache(TemporaryCacheKeys.CORRELATION_ID, this.authCodeRequest.correlationId, true);
39
40
  this.browserStorage.cacheCodeRequest(this.authCodeRequest, this.browserCrypto);
40
41
  this.browserRequestLogger.infoPii("RedirectHandler.initiateAuthRequest: Navigate to: " + requestUrl);
41
42
  navigationOptions = {
@@ -77,7 +78,7 @@ var RedirectHandler = /** @class */ (function (_super) {
77
78
  * Handle authorization code response in the window.
78
79
  * @param hash
79
80
  */
80
- RedirectHandler.prototype.handleCodeResponse = function (locationHash, state, authority, networkModule, clientId) {
81
+ RedirectHandler.prototype.handleCodeResponseFromHash = function (locationHash, state, authority, networkModule, clientId) {
81
82
  return __awaiter(this, void 0, void 0, function () {
82
83
  var stateKey, requestState, authCodeResponse, nonceKey, cachedNonce, cachedCcsCred, tokenResponse;
83
84
  return __generator(this, function (_a) {
@@ -89,7 +90,7 @@ var RedirectHandler = /** @class */ (function (_super) {
89
90
  throw BrowserAuthError.createEmptyHashError(locationHash);
90
91
  }
91
92
  // Interaction is completed - remove interaction status.
92
- this.browserStorage.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.INTERACTION_STATUS_KEY));
93
+ this.browserStorage.setInteractionInProgress(false);
93
94
  stateKey = this.browserStorage.generateStateKey(state);
94
95
  requestState = this.browserStorage.getTemporaryCache(stateKey);
95
96
  if (!requestState) {
@@ -120,7 +121,7 @@ var RedirectHandler = /** @class */ (function (_super) {
120
121
  }
121
122
  // Remove throttle if it exists
122
123
  if (clientId) {
123
- ThrottlingUtils.removeThrottle(this.browserStorage, clientId, this.authCodeRequest.authority, this.authCodeRequest.scopes);
124
+ ThrottlingUtils.removeThrottle(this.browserStorage, clientId, this.authCodeRequest);
124
125
  }
125
126
  return [4 /*yield*/, this.authModule.acquireToken(this.authCodeRequest, authCodeResponse)];
126
127
  case 3:
@@ -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, BrowserConstants, 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.INTERACTION_STATUS_KEY, BrowserConstants.INTERACTION_IN_PROGRESS_VALUE, 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 handleCodeResponse(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.removeItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.INTERACTION_STATUS_KEY));\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.authority, this.authCodeRequest.scopes);\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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,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, 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.setInteractionInProgress(true);\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,UA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AAC;;wBAGpE,IAAI,CAAC,eAAe,CAAC,IAAI,GAAG,gBAAgB,CAAC,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;;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,CAxHA,CAAqC,kBAAkB;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { StringUtils, Constants, UrlString } from '@azure/msal-common';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
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.16.1";
2
+ export declare const version = "2.20.0";
3
3
  //# sourceMappingURL=packageMetadata.d.ts.map
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
2
2
  'use strict';
3
3
  /* eslint-disable header/header */
4
4
  var name = "@azure/msal-browser";
5
- var version = "2.16.1";
5
+ var version = "2.20.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.16.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.20.0\";\n"],"names":[],"mappings":";;AAAA;IACa,IAAI,GAAG,sBAAsB;IAC7B,OAAO,GAAG;;;;"}
@@ -0,0 +1,8 @@
1
+ import { CommonAuthorizationCodeRequest } from "@azure/msal-common";
2
+ export declare type AuthorizationCodeRequest = Partial<Omit<CommonAuthorizationCodeRequest, "code" | "enableSpaAuthorizationCode">> & {
3
+ code: string;
4
+ cloudGraphHostName?: string;
5
+ msGraphHost?: string;
6
+ cloudInstanceHostName?: string;
7
+ };
8
+ //# sourceMappingURL=AuthorizationCodeRequest.d.ts.map
@@ -0,0 +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,CAAC,CAAC,GAAG;IACxH,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,4 +1,5 @@
1
1
  import { CommonEndSessionRequest } from "@azure/msal-common";
2
+ import { PopupWindowAttributes } from "../utils/PopupUtils";
2
3
  /**
3
4
  * EndSessionPopupRequest
4
5
  * - account - Account object that will be logged out of. All tokens tied to this account will be cleared.
@@ -7,9 +8,11 @@ import { CommonEndSessionRequest } from "@azure/msal-common";
7
8
  * - correlationId - Unique GUID set per request to trace a request end-to-end for telemetry purposes.
8
9
  * - idTokenHint - ID Token used by B2C to validate logout if required by the policy
9
10
  * - mainWindowRedirectUri - URI to navigate the main window to after logout is complete
11
+ * - popupWindowAttributes - Optional popup window attributes. popupSize with height and width, and popupPosition with top and left can be set.
10
12
  */
11
13
  export declare type EndSessionPopupRequest = Partial<CommonEndSessionRequest> & {
12
14
  authority?: string;
13
15
  mainWindowRedirectUri?: string;
16
+ popupWindowAttributes?: PopupWindowAttributes;
14
17
  };
15
18
  //# sourceMappingURL=EndSessionPopupRequest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EndSessionPopupRequest.d.ts","sourceRoot":"","sources":["../../src/request/EndSessionPopupRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAE7D;;;;;;;;GAQG;AACH,oBAAY,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAAG;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC"}
1
+ {"version":3,"file":"EndSessionPopupRequest.d.ts","sourceRoot":"","sources":["../../src/request/EndSessionPopupRequest.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;;;;;;GASG;AACH,oBAAY,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC,GAAG;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CACjD,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
2
+ import { PopupWindowAttributes } from "../utils/PopupUtils";
2
3
  /**
3
4
  * PopupRequest: Request object passed by user to retrieve a Code from the
4
5
  * server (first leg of authorization code grant flow) with a popup window.
@@ -22,8 +23,10 @@ import { CommonAuthorizationUrlRequest } from "@azure/msal-common";
22
23
  * - tokenQueryParameters - String to string map of custom query parameters added to the /token call
23
24
  * - claims - In cases where Azure AD tenant admin has enabled conditional access policies, and the policy has not been met, exceptions will contain claims that need to be consented to.
24
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
+ * - popupWindowAttributes - Optional popup window attributes. popupSize with height and width, and popupPosition with top and left can be set.
25
27
  */
26
28
  export declare type PopupRequest = Partial<Omit<CommonAuthorizationUrlRequest, "responseMode" | "scopes" | "codeChallenge" | "codeChallengeMethod">> & {
27
29
  scopes: Array<string>;
30
+ popupWindowAttributes?: PopupWindowAttributes;
28
31
  };
29
32
  //# sourceMappingURL=PopupRequest.d.ts.map
@@ -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;AAEnE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,oBAAY,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,6BAA6B,EAAE,cAAc,GAAC,QAAQ,GAAC,eAAe,GAAC,qBAAqB,CAAC,CAAC,GAAG;IACrI,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACzB,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,CAAC,CAAC,GAAG;IACrI,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACtB,qBAAqB,CAAC,EAAE,qBAAqB,CAAC;CACjD,CAAC"}
@@ -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,CAAC,CAAC,GAAG;IACxI,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,CAAA;CACvD,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,CAAC,CAAC,GAAG;IACxI,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"}
@@ -60,7 +60,15 @@ export declare enum TemporaryCacheKeys {
60
60
  REQUEST_PARAMS = "request.params",
61
61
  SCOPES = "scopes",
62
62
  INTERACTION_STATUS_KEY = "interaction.status",
63
- CCS_CREDENTIAL = "ccs.credential"
63
+ CCS_CREDENTIAL = "ccs.credential",
64
+ CORRELATION_ID = "request.correlationId"
65
+ }
66
+ /**
67
+ * Cache keys stored in-memory
68
+ */
69
+ export declare enum InMemoryCacheKeys {
70
+ WRAPPER_SKU = "wrapper.sku",
71
+ WRAPPER_VER = "wrapper.version"
64
72
  }
65
73
  /**
66
74
  * API Codes for Telemetry purposes.
@@ -74,6 +82,7 @@ export declare enum ApiId {
74
82
  ssoSilent = 863,
75
83
  acquireTokenSilent_authCode = 864,
76
84
  handleRedirectPromise = 865,
85
+ acquireTokenByCode = 866,
77
86
  acquireTokenSilent_silentFlow = 61,
78
87
  logout = 961,
79
88
  logoutPopup = 962
@@ -126,4 +135,7 @@ export declare enum WrapperSKU {
126
135
  React = "@azure/msal-react",
127
136
  Angular = "@azure/msal-angular"
128
137
  }
138
+ export declare const DB_NAME = "msal.db";
139
+ export declare const DB_VERSION = 1;
140
+ export declare const DB_TABLE_NAME: string;
129
141
  //# sourceMappingURL=BrowserConstants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEN,CAAC;AAEF,oBAAY,oBAAoB;IAC5B,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAClC;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB;AAED;;GAEG;AACH,oBAAY,kBAAkB;IAC1B,SAAS,cAAc;IACvB,qBAAqB,yBAAyB;IAC9C,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;IAC/B,aAAa,mBAAmB;IAChC,UAAU,mBAAmB;IAC7B,YAAY,uBAAuB;IACnC,QAAQ,YAAY;IACpB,cAAc,mBAAmB;IACjC,MAAM,WAAW;IACjB,sBAAsB,uBAAuB;IAC7C,cAAc,mBAAmB;CACpC;AAED;;;;;GAKG;AACH,oBAAY,KAAK;IACb,oBAAoB,MAAM;IAC1B,iBAAiB,MAAM;IACvB,SAAS,MAAM;IACf,2BAA2B,MAAM;IACjC,qBAAqB,MAAM;IAC3B,6BAA6B,KAAK;IAClC,MAAM,MAAM;IACZ,WAAW,MAAM;CACpB;AAKD,oBAAY,eAAe;IACvB,QAAQ,aAAa;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;CACpB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IACzB;;OAEG;IACH,OAAO,YAAY;IACnB;;OAEG;IACH,KAAK,UAAU;IACf;;OAEG;IACH,MAAM,WAAW;IACjB;;OAEG;IACH,YAAY,iBAAiB;IAC7B;;OAEG;IACH,SAAS,cAAc;IACvB;;OAEG;IACH,cAAc,mBAAmB;IACjC;;OAEG;IACH,IAAI,SAAS;CAChB;AAED,eAAO,MAAM,eAAe,EAAE,eAAe,GAAC,YAE7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,cAAc,QAAQ,CAAC;AAGpC,oBAAY,UAAU;IAClB,KAAK,sBAAsB;IAC3B,OAAO,wBAAwB;CAClC"}
1
+ {"version":3,"file":"BrowserConstants.d.ts","sourceRoot":"","sources":["../../src/utils/BrowserConstants.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;GAEG;AACH,eAAO,MAAM,gBAAgB;IACzB;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;IAEH;;OAEG;;CAEN,CAAC;AAEF,oBAAY,oBAAoB;IAC5B,YAAY,iBAAiB;IAC7B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAClC;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,GAAG,QAAQ;IACX,IAAI,SAAS;CAChB;AAED;;GAEG;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@@
1
- /*! @azure/msal-browser v2.16.1 2021-08-02 */
1
+ /*! @azure/msal-browser v2.20.0 2021-12-07 */
2
2
  'use strict';
3
3
  import { OIDC_DEFAULT_SCOPES } from '@azure/msal-common';
4
4
 
@@ -70,7 +70,16 @@ var TemporaryCacheKeys;
70
70
  TemporaryCacheKeys["SCOPES"] = "scopes";
71
71
  TemporaryCacheKeys["INTERACTION_STATUS_KEY"] = "interaction.status";
72
72
  TemporaryCacheKeys["CCS_CREDENTIAL"] = "ccs.credential";
73
+ TemporaryCacheKeys["CORRELATION_ID"] = "request.correlationId";
73
74
  })(TemporaryCacheKeys || (TemporaryCacheKeys = {}));
75
+ /**
76
+ * Cache keys stored in-memory
77
+ */
78
+ var InMemoryCacheKeys;
79
+ (function (InMemoryCacheKeys) {
80
+ InMemoryCacheKeys["WRAPPER_SKU"] = "wrapper.sku";
81
+ InMemoryCacheKeys["WRAPPER_VER"] = "wrapper.version";
82
+ })(InMemoryCacheKeys || (InMemoryCacheKeys = {}));
74
83
  /**
75
84
  * API Codes for Telemetry purposes.
76
85
  * Before adding a new code you must claim it in the MSAL Telemetry tracker as these number spaces are shared across all MSALs
@@ -84,6 +93,7 @@ var ApiId;
84
93
  ApiId[ApiId["ssoSilent"] = 863] = "ssoSilent";
85
94
  ApiId[ApiId["acquireTokenSilent_authCode"] = 864] = "acquireTokenSilent_authCode";
86
95
  ApiId[ApiId["handleRedirectPromise"] = 865] = "handleRedirectPromise";
96
+ ApiId[ApiId["acquireTokenByCode"] = 866] = "acquireTokenByCode";
87
97
  ApiId[ApiId["acquireTokenSilent_silentFlow"] = 61] = "acquireTokenSilent_silentFlow";
88
98
  ApiId[ApiId["logout"] = 961] = "logout";
89
99
  ApiId[ApiId["logoutPopup"] = 962] = "logoutPopup";
@@ -144,7 +154,11 @@ var WrapperSKU;
144
154
  (function (WrapperSKU) {
145
155
  WrapperSKU["React"] = "@azure/msal-react";
146
156
  WrapperSKU["Angular"] = "@azure/msal-angular";
147
- })(WrapperSKU || (WrapperSKU = {}));
157
+ })(WrapperSKU || (WrapperSKU = {}));
158
+ // DatabaseStorage Constants
159
+ var DB_NAME = "msal.db";
160
+ var DB_VERSION = 1;
161
+ var DB_TABLE_NAME = DB_NAME + ".keys";
148
162
 
149
- export { ApiId, BrowserCacheLocation, BrowserConstants, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InteractionStatus, InteractionType, KEY_FORMAT_JWK, TemporaryCacheKeys, WrapperSKU };
163
+ export { ApiId, BrowserCacheLocation, BrowserConstants, DB_NAME, DB_TABLE_NAME, DB_VERSION, DEFAULT_REQUEST, HTTP_REQUEST_TYPE, InMemoryCacheKeys, InteractionStatus, InteractionType, KEY_FORMAT_JWK, TemporaryCacheKeys, WrapperSKU };
150
164
  //# sourceMappingURL=BrowserConstants.js.map