@azure/msal-browser 2.28.2 → 2.28.3

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 (74) hide show
  1. package/README.md +1 -1
  2. package/dist/_virtual/_tslib.js +1 -1
  3. package/dist/app/ClientApplication.js +1 -1
  4. package/dist/app/IPublicClientApplication.js +1 -1
  5. package/dist/app/PublicClientApplication.d.ts.map +1 -1
  6. package/dist/app/PublicClientApplication.js +3 -1
  7. package/dist/app/PublicClientApplication.js.map +1 -1
  8. package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
  9. package/dist/cache/AsyncMemoryStorage.d.ts +7 -2
  10. package/dist/cache/AsyncMemoryStorage.d.ts.map +1 -1
  11. package/dist/cache/AsyncMemoryStorage.js +19 -15
  12. package/dist/cache/AsyncMemoryStorage.js.map +1 -1
  13. package/dist/cache/BrowserCacheManager.js +1 -1
  14. package/dist/cache/BrowserStorage.js +1 -1
  15. package/dist/cache/CryptoKeyStore.d.ts +18 -0
  16. package/dist/cache/CryptoKeyStore.d.ts.map +1 -0
  17. package/dist/cache/CryptoKeyStore.js +58 -0
  18. package/dist/cache/CryptoKeyStore.js.map +1 -0
  19. package/dist/cache/DatabaseStorage.d.ts.map +1 -1
  20. package/dist/cache/DatabaseStorage.js +10 -22
  21. package/dist/cache/DatabaseStorage.js.map +1 -1
  22. package/dist/cache/MemoryStorage.js +1 -1
  23. package/dist/cache/TokenCache.js +1 -1
  24. package/dist/config/Configuration.js +1 -1
  25. package/dist/crypto/BrowserCrypto.js +1 -1
  26. package/dist/crypto/CryptoOps.d.ts +0 -12
  27. package/dist/crypto/CryptoOps.d.ts.map +1 -1
  28. package/dist/crypto/CryptoOps.js +6 -36
  29. package/dist/crypto/CryptoOps.js.map +1 -1
  30. package/dist/crypto/GuidGenerator.js +1 -1
  31. package/dist/crypto/PkceGenerator.js +1 -1
  32. package/dist/crypto/SignedHttpRequest.js +1 -1
  33. package/dist/encode/Base64Decode.js +1 -1
  34. package/dist/encode/Base64Encode.js +1 -1
  35. package/dist/error/BrowserAuthError.js +1 -1
  36. package/dist/error/BrowserConfigurationAuthError.js +1 -1
  37. package/dist/error/NativeAuthError.js +1 -1
  38. package/dist/event/EventHandler.js +1 -1
  39. package/dist/event/EventMessage.js +1 -1
  40. package/dist/event/EventType.js +1 -1
  41. package/dist/index.cjs.js +139 -124
  42. package/dist/index.cjs.js.map +1 -1
  43. package/dist/index.js +1 -1
  44. package/dist/interaction_client/BaseInteractionClient.js +1 -1
  45. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
  46. package/dist/interaction_client/NativeInteractionClient.js +1 -1
  47. package/dist/interaction_client/PopupClient.js +1 -1
  48. package/dist/interaction_client/RedirectClient.js +1 -1
  49. package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
  50. package/dist/interaction_client/SilentCacheClient.js +1 -1
  51. package/dist/interaction_client/SilentIframeClient.js +1 -1
  52. package/dist/interaction_client/SilentRefreshClient.js +1 -1
  53. package/dist/interaction_client/StandardInteractionClient.js +1 -1
  54. package/dist/interaction_handler/InteractionHandler.js +1 -1
  55. package/dist/interaction_handler/RedirectHandler.js +1 -1
  56. package/dist/interaction_handler/SilentHandler.js +1 -1
  57. package/dist/internals.js +1 -1
  58. package/dist/navigation/NavigationClient.js +1 -1
  59. package/dist/network/FetchClient.js +1 -1
  60. package/dist/network/XhrClient.js +1 -1
  61. package/dist/packageMetadata.d.ts +1 -1
  62. package/dist/packageMetadata.js +2 -2
  63. package/dist/packageMetadata.js.map +1 -1
  64. package/dist/telemetry/BrowserPerformanceClient.js +1 -1
  65. package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
  66. package/dist/utils/BrowserConstants.js +1 -1
  67. package/dist/utils/BrowserProtocolUtils.js +1 -1
  68. package/dist/utils/BrowserStringUtils.js +1 -1
  69. package/dist/utils/BrowserUtils.js +1 -1
  70. package/dist/utils/MathUtils.js +1 -1
  71. package/lib/msal-browser.js +139 -124
  72. package/lib/msal-browser.js.map +1 -1
  73. package/lib/msal-browser.min.js +29 -29
  74. package/package.json +2 -2
package/README.md CHANGED
@@ -59,7 +59,7 @@ npm install @azure/msal-browser
59
59
 
60
60
  <!-- CDN_LATEST -->
61
61
  ```html
62
- <script type="text/javascript" src="https://alcdn.msauth.net/browser/2.28.2/js/msal-browser.min.js"></script>
62
+ <script type="text/javascript" src="https://alcdn.msauth.net/browser/2.28.3/js/msal-browser.min.js"></script>
63
63
  ```
64
64
 
65
65
  See [here](https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/cdn-usage.md) for more info on how to use this package from the Microsoft CDN.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  /*! *****************************************************************************
4
4
  Copyright (c) Microsoft Corporation.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { CryptoOps } from '../crypto/CryptoOps.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"PublicClientApplication.d.ts","sourceRoot":"","sources":["../../src/app/PublicClientApplication.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAA8D,MAAM,oBAAoB,CAAC;AACnI,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA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kB,YAAW,wBAAwB;IAG9F,OAAO,CAAC,yBAAyB,CAA6C;IAE9E;;;;;;;;;;;;;;;;;;;;OAoBG;gBACS,aAAa,EAAE,aAAa;IAMxC;;;;;;;;OAQG;IACG,aAAa,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAS7D;;;;;;OAMG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC;IASjE;;;;;OAKG;IACG,kBAAkB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAgE/E;;;;;OAKG;cACa,uBAAuB,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAoDvH"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { __extends, __awaiter, __generator, __assign } from '../_virtual/_tslib.js';
4
4
  import { PerformanceEvents, Constants } from '@azure/msal-common';
@@ -127,6 +127,8 @@ var PublicClientApplication = /** @class */ (function (_super) {
127
127
  .catch(function (error) {
128
128
  _this.activeSilentTokenRequests.delete(silentRequestKey);
129
129
  atsMeasurement.endMeasurement({
130
+ errorCode: error.errorCode,
131
+ subErrorCode: error.subError,
130
132
  success: false
131
133
  });
132
134
  atsMeasurement.flushMeasurement();
@@ -1 +1 @@
1
- {"version":3,"file":"PublicClientApplication.js","sources":["../../src/app/PublicClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AccountInfo, AuthenticationResult, Constants, RequestThumbprint, AuthError, PerformanceEvents } from \"@azure/msal-common\";\nimport { Configuration } from \"../config/Configuration\";\nimport { DEFAULT_REQUEST, InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { IPublicClientApplication } from \"./IPublicClientApplication\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { ClientApplication } from \"./ClientApplication\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { EventType } from \"../event/EventType\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { NativeAuthError } from \"../error/NativeAuthError\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\n\n/**\n * The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications\n * to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.\n */\nexport class PublicClientApplication extends ClientApplication implements IPublicClientApplication {\n\n // Active requests\n private activeSilentTokenRequests: Map<string, Promise<AuthenticationResult>>;\n\n /**\n * @constructor\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\n *\n * Important attributes in the Configuration object for auth are:\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\n * - authority: the authority URL for your application.\n * - redirect_uri: the uri of your application registered in the portal.\n *\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\n *\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\n * Full B2C functionality will be available in this library in future versions.\n *\n * @param configuration object for the MSAL PublicClientApplication instance\n */\n constructor(configuration: Configuration) {\n super(configuration);\n\n this.activeSilentTokenRequests = new Map();\n }\n\n /**\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so\n * any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n async loginRedirect(request?: RedirectRequest): Promise<void> {\n const correlationId: string = this.getRequestCorrelationId(request);\n this.logger.verbose(\"loginRedirect called\", correlationId);\n return this.acquireTokenRedirect({\n correlationId,\n ...(request || DEFAULT_REQUEST)\n });\n }\n\n /**\n * Use when initiating the login process via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n loginPopup(request?: PopupRequest): Promise<AuthenticationResult> {\n const correlationId: string = this.getRequestCorrelationId(request);\n this.logger.verbose(\"loginPopup called\", correlationId);\n return this.acquireTokenPopup({\n correlationId,\n ...(request || DEFAULT_REQUEST)\n });\n }\n\n /**\n * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.\n *\n * @param {@link (SilentRequest:type)}\n * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object\n */\n async acquireTokenSilent(request: SilentRequest): Promise<AuthenticationResult> {\n const correlationId = this.getRequestCorrelationId(request);\n const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.verbose(\"acquireTokenSilent called\", correlationId);\n const account = request.account || this.getActiveAccount();\n if (!account) {\n throw BrowserAuthError.createNoAccountError();\n }\n const thumbprint: RequestThumbprint = {\n clientId: this.config.auth.clientId,\n authority: request.authority || Constants.EMPTY_STRING,\n scopes: request.scopes,\n homeAccountIdentifier: account.homeAccountId,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n const silentRequestKey = JSON.stringify(thumbprint);\n const cachedResponse = this.activeSilentTokenRequests.get(silentRequestKey);\n if (typeof cachedResponse === \"undefined\") {\n this.logger.verbose(\"acquireTokenSilent called for the first time, storing active request\", correlationId);\n const response = this.acquireTokenSilentAsync({\n ...request,\n correlationId\n }, account)\n .then((result) => {\n this.activeSilentTokenRequests.delete(silentRequestKey);\n atsMeasurement.endMeasurement({\n success: true,\n fromCache: result.fromCache,\n accessTokenSize: result.accessToken.length,\n idTokenSize: result.idToken.length,\n isNativeBroker: result.fromNativeBroker\n });\n atsMeasurement.flushMeasurement();\n return result;\n })\n .catch((error: AuthError) => {\n this.activeSilentTokenRequests.delete(silentRequestKey);\n atsMeasurement.endMeasurement({\n success: false\n });\n atsMeasurement.flushMeasurement();\n throw error;\n });\n this.activeSilentTokenRequests.set(silentRequestKey, response);\n return response;\n } else {\n this.logger.verbose(\"acquireTokenSilent has been called previously, returning the result from the first call\", correlationId);\n atsMeasurement.endMeasurement({\n success: true\n });\n // Discard measurements for memoized calls, as they are usually only a couple of ms and will artificially deflate metrics\n atsMeasurement.discardMeasurement();\n return cachedResponse;\n }\n }\n\n /**\n * Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.\n * @param {@link (SilentRequest:type)}\n * @param {@link (AccountInfo:type)}\n * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} \n */\n protected async acquireTokenSilentAsync(request: SilentRequest, account: AccountInfo): Promise<AuthenticationResult>{\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);\n const astsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);\n\n let result: Promise<AuthenticationResult>;\n if (NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) && account.nativeAccountId) {\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from native platform\");\n const silentRequest: SilentRequest = {\n ...request,\n account\n };\n result = this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(async (e: AuthError) => {\n // If native token acquisition fails for availability reasons fallback to web flow\n if (e instanceof NativeAuthError && e.isFatal()) {\n this.logger.verbose(\"acquireTokenSilent - native platform unavailable, falling back to web flow\");\n this.nativeExtensionProvider = undefined; // Prevent future requests from continuing to attempt \n\n // Cache will not contain tokens, given that previous WAM requests succeeded. Skip cache and RT renewal and go straight to iframe renewal\n const silentIframeClient = this.createSilentIframeClient(request.correlationId);\n return silentIframeClient.acquireToken(request);\n }\n throw e;\n }); \n } else {\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from web flow\");\n const silentCacheClient = this.createSilentCacheClient(request.correlationId);\n const silentRequest = await silentCacheClient.initializeSilentRequest(request, account);\n result = silentCacheClient.acquireToken(silentRequest).catch(async () => {\n return this.acquireTokenByRefreshToken(silentRequest);\n });\n }\n\n return result.then((response) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, response);\n astsAsyncMeasurement.endMeasurement({\n success: true,\n fromCache: response.fromCache,\n accessTokenSize: response.accessToken.length,\n idTokenSize: response.idToken.length,\n isNativeBroker: response.fromNativeBroker\n });\n return response;\n }).catch((tokenRenewalError: AuthError) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError);\n astsAsyncMeasurement.endMeasurement({\n errorCode: tokenRenewalError.errorCode,\n subErrorCode: tokenRenewalError.subError,\n success: false\n });\n throw tokenRenewalError;\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAkBA;;;;;IAI6C,2CAAiB;;;;;;;;;;;;;;;;;;;;;;IA0B1D,iCAAY,a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AAE,QAAQ,CAAC,gBAAgB;6BAC5C,CAAC,CAAC;4BACH,OAAO,QAAQ,CAAC;yBACnB,CAAC,CAAC,KAAK,CAAC,UAAC,iBAA4B;4BAClC,KAAI,CAAC,YAAY,CAAC,SAAS,CAAC,SAAS,CAAC,qBAAqB,EAAE,eAAe,CAAC,MAAM,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC;4BAC9G,oBAAoB,CAAC,cAAc,CAAC;gCAChC,SAAS,EAAE,iBAAiB,CAAC,SAAS;gCACtC,YAAY,EAAE,iBAAiB,CAAC,QAAQ;gCACxC,OAAO,EAAE,KAAK;6BACjB,CAAC,CAAC;4BACH,MAAM,iBAAiB,CAAC;yBAC3B,CAAC,EAAC;;;;KACN;IACL,8BAAC;AAAD,CAhMA,CAA6C,iBAAiB;;;;"}
1
+ {"version":3,"file":"PublicClientApplication.js","sources":["../../src/app/PublicClientApplication.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AccountInfo, AuthenticationResult, Constants, RequestThumbprint, AuthError, PerformanceEvents } from \"@azure/msal-common\";\nimport { Configuration } from \"../config/Configuration\";\nimport { DEFAULT_REQUEST, InteractionType, ApiId } from \"../utils/BrowserConstants\";\nimport { IPublicClientApplication } from \"./IPublicClientApplication\";\nimport { RedirectRequest } from \"../request/RedirectRequest\";\nimport { PopupRequest } from \"../request/PopupRequest\";\nimport { ClientApplication } from \"./ClientApplication\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { EventType } from \"../event/EventType\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { NativeAuthError } from \"../error/NativeAuthError\";\nimport { NativeMessageHandler } from \"../broker/nativeBroker/NativeMessageHandler\";\n\n/**\n * The PublicClientApplication class is the object exposed by the library to perform authentication and authorization functions in Single Page Applications\n * to obtain JWT tokens as described in the OAuth 2.0 Authorization Code Flow with PKCE specification.\n */\nexport class PublicClientApplication extends ClientApplication implements IPublicClientApplication {\n\n // Active requests\n private activeSilentTokenRequests: Map<string, Promise<AuthenticationResult>>;\n\n /**\n * @constructor\n * Constructor for the PublicClientApplication used to instantiate the PublicClientApplication object\n *\n * Important attributes in the Configuration object for auth are:\n * - clientID: the application ID of your application. You can obtain one by registering your application with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview\n * - authority: the authority URL for your application.\n * - redirect_uri: the uri of your application registered in the portal.\n *\n * In Azure AD, authority is a URL indicating the Azure active directory that MSAL uses to obtain tokens.\n * It is of the form https://login.microsoftonline.com/{Enter_the_Tenant_Info_Here}\n * If your application supports Accounts in one organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with the Tenant Id or Tenant name (for example, contoso.microsoft.com).\n * If your application supports Accounts in any organizational directory, replace \"Enter_the_Tenant_Info_Here\" value with organizations.\n * If your application supports Accounts in any organizational directory and personal Microsoft accounts, replace \"Enter_the_Tenant_Info_Here\" value with common.\n * To restrict support to Personal Microsoft accounts only, replace \"Enter_the_Tenant_Info_Here\" value with consumers.\n *\n * In Azure B2C, authority is of the form https://{instance}/tfp/{tenant}/{policyName}/\n * Full B2C functionality will be available in this library in future versions.\n *\n * @param configuration object for the MSAL PublicClientApplication instance\n */\n constructor(configuration: Configuration) {\n super(configuration);\n\n this.activeSilentTokenRequests = new Map();\n }\n\n /**\n * Use when initiating the login process by redirecting the user's browser to the authorization endpoint. This function redirects the page, so\n * any code that follows this function will not execute.\n *\n * IMPORTANT: It is NOT recommended to have code that is dependent on the resolution of the Promise. This function will navigate away from the current\n * browser window. It currently returns a Promise in order to reflect the asynchronous nature of the code running in this function.\n *\n * @param request\n */\n async loginRedirect(request?: RedirectRequest): Promise<void> {\n const correlationId: string = this.getRequestCorrelationId(request);\n this.logger.verbose(\"loginRedirect called\", correlationId);\n return this.acquireTokenRedirect({\n correlationId,\n ...(request || DEFAULT_REQUEST)\n });\n }\n\n /**\n * Use when initiating the login process via opening a popup window in the user's browser\n *\n * @param request\n *\n * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.\n */\n loginPopup(request?: PopupRequest): Promise<AuthenticationResult> {\n const correlationId: string = this.getRequestCorrelationId(request);\n this.logger.verbose(\"loginPopup called\", correlationId);\n return this.acquireTokenPopup({\n correlationId,\n ...(request || DEFAULT_REQUEST)\n });\n }\n\n /**\n * Silently acquire an access token for a given set of scopes. Returns currently processing promise if parallel requests are made.\n *\n * @param {@link (SilentRequest:type)}\n * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} object\n */\n async acquireTokenSilent(request: SilentRequest): Promise<AuthenticationResult> {\n const correlationId = this.getRequestCorrelationId(request);\n const atsMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilent, correlationId);\n this.preflightBrowserEnvironmentCheck(InteractionType.Silent);\n this.logger.verbose(\"acquireTokenSilent called\", correlationId);\n const account = request.account || this.getActiveAccount();\n if (!account) {\n throw BrowserAuthError.createNoAccountError();\n }\n const thumbprint: RequestThumbprint = {\n clientId: this.config.auth.clientId,\n authority: request.authority || Constants.EMPTY_STRING,\n scopes: request.scopes,\n homeAccountIdentifier: account.homeAccountId,\n claims: request.claims,\n authenticationScheme: request.authenticationScheme,\n resourceRequestMethod: request.resourceRequestMethod,\n resourceRequestUri: request.resourceRequestUri,\n shrClaims: request.shrClaims,\n sshKid: request.sshKid\n };\n const silentRequestKey = JSON.stringify(thumbprint);\n const cachedResponse = this.activeSilentTokenRequests.get(silentRequestKey);\n if (typeof cachedResponse === \"undefined\") {\n this.logger.verbose(\"acquireTokenSilent called for the first time, storing active request\", correlationId);\n const response = this.acquireTokenSilentAsync({\n ...request,\n correlationId\n }, account)\n .then((result) => {\n this.activeSilentTokenRequests.delete(silentRequestKey);\n atsMeasurement.endMeasurement({\n success: true,\n fromCache: result.fromCache,\n accessTokenSize: result.accessToken.length,\n idTokenSize: result.idToken.length,\n isNativeBroker: result.fromNativeBroker\n });\n atsMeasurement.flushMeasurement();\n return result;\n })\n .catch((error: AuthError) => {\n this.activeSilentTokenRequests.delete(silentRequestKey);\n atsMeasurement.endMeasurement({\n errorCode: error.errorCode,\n subErrorCode: error.subError,\n success: false\n });\n atsMeasurement.flushMeasurement();\n throw error;\n });\n this.activeSilentTokenRequests.set(silentRequestKey, response);\n return response;\n } else {\n this.logger.verbose(\"acquireTokenSilent has been called previously, returning the result from the first call\", correlationId);\n atsMeasurement.endMeasurement({\n success: true\n });\n // Discard measurements for memoized calls, as they are usually only a couple of ms and will artificially deflate metrics\n atsMeasurement.discardMeasurement();\n return cachedResponse;\n }\n }\n\n /**\n * Silently acquire an access token for a given set of scopes. Will use cached token if available, otherwise will attempt to acquire a new token from the network via refresh token.\n * @param {@link (SilentRequest:type)}\n * @param {@link (AccountInfo:type)}\n * @returns {Promise.<AuthenticationResult>} - a promise that is fulfilled when this function has completed, or rejected if an error was raised. Returns the {@link AuthResponse} \n */\n protected async acquireTokenSilentAsync(request: SilentRequest, account: AccountInfo): Promise<AuthenticationResult>{\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_START, InteractionType.Silent, request);\n const astsAsyncMeasurement = this.performanceClient.startMeasurement(PerformanceEvents.AcquireTokenSilentAsync, request.correlationId);\n\n let result: Promise<AuthenticationResult>;\n if (NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeExtensionProvider, request.authenticationScheme) && account.nativeAccountId) {\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from native platform\");\n const silentRequest: SilentRequest = {\n ...request,\n account\n };\n result = this.acquireTokenNative(silentRequest, ApiId.acquireTokenSilent_silentFlow).catch(async (e: AuthError) => {\n // If native token acquisition fails for availability reasons fallback to web flow\n if (e instanceof NativeAuthError && e.isFatal()) {\n this.logger.verbose(\"acquireTokenSilent - native platform unavailable, falling back to web flow\");\n this.nativeExtensionProvider = undefined; // Prevent future requests from continuing to attempt \n\n // Cache will not contain tokens, given that previous WAM requests succeeded. Skip cache and RT renewal and go straight to iframe renewal\n const silentIframeClient = this.createSilentIframeClient(request.correlationId);\n return silentIframeClient.acquireToken(request);\n }\n throw e;\n }); \n } else {\n this.logger.verbose(\"acquireTokenSilent - attempting to acquire token from web flow\");\n const silentCacheClient = this.createSilentCacheClient(request.correlationId);\n const silentRequest = await silentCacheClient.initializeSilentRequest(request, account);\n result = silentCacheClient.acquireToken(silentRequest).catch(async () => {\n return this.acquireTokenByRefreshToken(silentRequest);\n });\n }\n\n return result.then((response) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_SUCCESS, InteractionType.Silent, response);\n astsAsyncMeasurement.endMeasurement({\n success: true,\n fromCache: response.fromCache,\n accessTokenSize: response.accessToken.length,\n idTokenSize: response.idToken.length,\n isNativeBroker: response.fromNativeBroker\n });\n return response;\n }).catch((tokenRenewalError: AuthError) => {\n this.eventHandler.emitEvent(EventType.ACQUIRE_TOKEN_FAILURE, InteractionType.Silent, null, tokenRenewalError);\n astsAsyncMeasurement.endMeasurement({\n errorCode: tokenRenewalError.errorCode,\n subErrorCode: tokenRenewalError.subError,\n success: false\n });\n throw tokenRenewalError;\n });\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;AAkBA;;;;;IAI6C,2CAAiB;;;;;;;;;;;;;;;;;;;;;;IA0B1D,iCAAY,aAA4B;QAAxC,YACI,kBAAM,aAAa,CAAC,SAGvB;QADG,KAAI,CAAC,yBAAyB,GAAG,IAAI,GAAG,EAAE,CAAC;;KAC9C;;;;;;;;;;IAWK,+CAAa,GAAnB,UAAoB,OAAyB;;;;gBACnC,aAAa,GAAW,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;gBACpE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,sBAAsB,EAAE,aAAa,CAAC,CAAC;gBAC3D,sBAAO,IAAI,CAAC,oBAAoB,YAC5B,aAAa,eAAA,KACT,OAAO,IAAI,eAAe,GAChC,EAAC;;;KACN;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S;gCACtC,YAAY,EAAE,iBAAiB,CAAC,QAAQ;gCACxC,OAAO,EAAE,KAAK;6BACjB,CAAC,CAAC;4BACH,MAAM,iBAAiB,CAAC;yBAC3B,CAAC,EAAC;;;;KACN;IACL,8BAAC;AAAD,CAlMA,CAA6C,iBAAiB;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../../_virtual/_tslib.js';
4
4
  import { NativeConstants, NativeExtensionMethod } from '../../utils/BrowserConstants.js';
@@ -40,8 +40,13 @@ export declare class AsyncMemoryStorage<T> implements IAsyncStorage<T> {
40
40
  */
41
41
  containsKey(key: string): Promise<boolean>;
42
42
  /**
43
- * Clears in-memory Map and tries to delete the IndexedDB database.
43
+ * Clears in-memory Map
44
44
  */
45
- clear(): Promise<boolean>;
45
+ clearInMemory(): void;
46
+ /**
47
+ * Tries to delete the IndexedDB database
48
+ * @returns
49
+ */
50
+ clearPersistent(): Promise<boolean>;
46
51
  }
47
52
  //# sourceMappingURL=AsyncMemoryStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncMemoryStorage.d.ts","sourceRoot":"","sources":["../../src/cache/AsyncMemoryStorage.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAG5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAGtD;;;GAGG;AACH,qBAAa,kBAAkB,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IAC1D,OAAO,CAAC,aAAa,CAAmB;IACxC,OAAO,CAAC,cAAc,CAAqB;IAC3C,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAS;gBAEd,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAO7C,OAAO,CAAC,yBAAyB;IAOjC;;;;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,CAAC;IAS5C;;;OAGG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAalC;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAahD;;OAEG;IACH,aAAa,IAAI,IAAI;IAOrB;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;CAc5C"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BrowserAuthError, BrowserAuthErrorMessage } from '../error/BrowserAuthError.js';
@@ -167,34 +167,38 @@ var AsyncMemoryStorage = /** @class */ (function () {
167
167
  });
168
168
  };
169
169
  /**
170
- * Clears in-memory Map and tries to delete the IndexedDB database.
170
+ * Clears in-memory Map
171
171
  */
172
- AsyncMemoryStorage.prototype.clear = function () {
172
+ AsyncMemoryStorage.prototype.clearInMemory = function () {
173
+ // InMemory cache is a Map instance, clear is straightforward
174
+ this.logger.verbose("Deleting in-memory keystore " + this.storeName);
175
+ this.inMemoryCache.clear();
176
+ this.logger.verbose("In-memory keystore " + this.storeName + " deleted");
177
+ };
178
+ /**
179
+ * Tries to delete the IndexedDB database
180
+ * @returns
181
+ */
182
+ AsyncMemoryStorage.prototype.clearPersistent = function () {
173
183
  return __awaiter(this, void 0, void 0, function () {
174
184
  var dbDeleted, e_6;
175
185
  return __generator(this, function (_a) {
176
186
  switch (_a.label) {
177
187
  case 0:
178
- // InMemory cache is a Map instance, clear is straightforward
179
- this.logger.verbose("Deleting in-memory keystore " + this.storeName);
180
- this.inMemoryCache.clear();
181
- this.logger.verbose("In-memory keystore " + this.storeName + " deleted");
182
- this.logger.verbose("Deleting persistent keystore " + this.storeName);
183
- _a.label = 1;
184
- case 1:
185
- _a.trys.push([1, 3, , 4]);
188
+ _a.trys.push([0, 2, , 3]);
189
+ this.logger.verbose("Deleting persistent keystore");
186
190
  return [4 /*yield*/, this.indexedDBCache.deleteDatabase()];
187
- case 2:
191
+ case 1:
188
192
  dbDeleted = _a.sent();
189
193
  if (dbDeleted) {
190
- this.logger.verbose("Persistent keystore " + this.storeName + " deleted");
194
+ this.logger.verbose("Persistent keystore deleted");
191
195
  }
192
196
  return [2 /*return*/, dbDeleted];
193
- case 3:
197
+ case 2:
194
198
  e_6 = _a.sent();
195
199
  this.handleDatabaseAccessError(e_6);
196
200
  return [2 /*return*/, false];
197
- case 4: return [2 /*return*/];
201
+ case 3: return [2 /*return*/];
198
202
  }
199
203
  });
200
204
  });
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncMemoryStorage.js","sources":["../../src/cache/AsyncMemoryStorage.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Logger } from \"@azure/msal-common\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\nimport { DatabaseStorage } from \"./DatabaseStorage\";\nimport { IAsyncStorage } from \"./IAsyncMemoryStorage\";\nimport { MemoryStorage } from \"./MemoryStorage\";\n\n/**\n * This class allows MSAL to store artifacts asynchronously using the DatabaseStorage IndexedDB wrapper,\n * backed up with the more volatile MemoryStorage object for cases in which IndexedDB may be unavailable.\n */\nexport class AsyncMemoryStorage<T> implements IAsyncStorage<T> {\n private inMemoryCache: MemoryStorage<T>;\n private indexedDBCache: DatabaseStorage<T>;\n private logger: Logger;\n private storeName: string;\n\n constructor(logger: Logger, storeName: string) {\n this.inMemoryCache = new MemoryStorage<T>();\n this.indexedDBCache = new DatabaseStorage<T>();\n this.logger = logger;\n this.storeName = storeName;\n }\n\n private handleDatabaseAccessError(error: unknown): void {\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.databaseUnavailable.code) {\n this.logger.error(\"Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.\");\n } else {\n throw error;\n }\n }\n /**\n * Get the item matching the given key. Tries in-memory cache first, then in the asynchronous\n * storage object if item isn't found in-memory.\n * @param key \n */\n async getItem(key: string): Promise<T | null> {\n const item = this.inMemoryCache.getItem(key);\n if(!item) {\n try {\n this.logger.verbose(\"Queried item not found in in-memory cache, now querying persistent storage.\");\n return await this.indexedDBCache.getItem(key);\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n return item;\n }\n\n /**\n * Sets the item in the in-memory cache and then tries to set it in the asynchronous\n * storage object with the given key.\n * @param key \n * @param value \n */\n async setItem(key: string, value: T): Promise<void> {\n this.inMemoryCache.setItem(key, value);\n try {\n await this.indexedDBCache.setItem(key, value);\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n\n /**\n * Removes the item matching the key from the in-memory cache, then tries to remove it from the asynchronous storage object.\n * @param key \n */\n async removeItem(key: string): Promise<void> {\n this.inMemoryCache.removeItem(key);\n try {\n await this.indexedDBCache.removeItem(key);\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n\n /**\n * Get all the keys from the in-memory cache as an iterable array of strings. If no keys are found, query the keys in the \n * asynchronous storage object.\n */\n async getKeys(): Promise<string[]> {\n const cacheKeys = this.inMemoryCache.getKeys();\n if (cacheKeys.length === 0) {\n try {\n this.logger.verbose(\"In-memory cache is empty, now querying persistent storage.\");\n return await this.indexedDBCache.getKeys();\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n return cacheKeys;\n }\n\n /**\n * Returns true or false if the given key is present in the cache.\n * @param key \n */\n async containsKey(key: string): Promise<boolean> {\n const containsKey = this.inMemoryCache.containsKey(key);\n if(!containsKey) {\n try {\n this.logger.verbose(\"Key not found in in-memory cache, now querying persistent storage.\");\n return await this.indexedDBCache.containsKey(key);\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n return containsKey;\n }\n\n /**\n * Clears in-memory Map and tries to delete the IndexedDB database.\n */\n async clear(): Promise<boolean> {\n // InMemory cache is a Map instance, clear is straightforward\n this.logger.verbose(`Deleting in-memory keystore ${this.storeName}`);\n this.inMemoryCache.clear();\n this.logger.verbose(`In-memory keystore ${this.storeName} deleted`);\n this.logger.verbose(`Deleting persistent keystore ${this.storeName}`);\n \n try {\n const dbDeleted = await this.indexedDBCache.deleteDatabase();\n \n if (dbDeleted) {\n this.logger.verbose(`Persistent keystore ${this.storeName} deleted`);\n }\n \n return dbDeleted;\n } catch (e) {\n this.handleDatabaseAccessError(e);\n return false;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;AAWA;;;;;IAUI,4BAAY,MAAc,EAAE,SAAiB;QACzC,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAK,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,IAAI,eAAe,EAAK,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;KAC9B;IAEO,sDAAyB,GAAjC,UAAkC,KAAc;QAC5C,IAAI,KAAK,YAAY,gBAAgB,IAAI,KAAK,CAAC,SAAS,KAAK,uBAAuB,CAAC,mBAAmB,CAAC,IAAI,EAAE;YAC3G,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6IAA6I,CAAC,CAAC;SACpK;aAAM;YACH,MAAM,KAAK,CAAC;SACf;KACJ;;;;;;IAMK,oCAAO,GAAb,UAAc,GAAW;;;;;;wBACf,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;6BAC1C,CAAC,IAAI,EAAL,wBAAK;;;;wBAEA,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,6EAA6E,CAAC,CAAC;wBAC5F,qBAAM,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,EAAA;4BAA7C,sBAAO,SAAsC,EAAC;;;wBAE9C,IAAI,CAAC,yBAAyB,CAAC,GAAC,CAAC,CAAC;;4BAG1C,sBAA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AAM,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,CAAC,EAAA;4BAAjD,sBAAO,SAA0C,EAAC;;;wBAElD,IAAI,CAAC,yBAAyB,CAAC,GAAC,CAAC,CAAC;;4BAG1C,sBAAO,WAAW,EAAC;;;;KACtB;;;;IAKK,kCAAK,GAAX;;;;;;;wBAEI,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,iCAA+B,IAAI,CAAC,SAAW,CAAC,CAAC;wBACrE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;wBAC3B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,wBAAsB,IAAI,CAAC,SAAS,aAAU,CAAC,CAAC;wBACpE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,kCAAgC,IAAI,CAAC,SAAW,CAAC,CAAC;;;;wBAGhD,qBAAM,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE,EAAA;;wBAAtD,SAAS,GAAG,SAA0C;wBAE5D,IAAI,SAAS,EAAE;4BACX,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,yBAAuB,IAAI,CAAC,SAAS,aAAU,CAAC,CAAC;yBACxE;wBAED,sBAAO,SAAS,EAAC;;;wBAEjB,IAAI,CAAC,yBAAyB,CAAC,GAAC,CAAC,CAAC;wBAClC,sBAAO,KAAK,EAAC;;;;;KAEpB;IACL,yBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"AsyncMemoryStorage.js","sources":["../../src/cache/AsyncMemoryStorage.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Logger } from \"@azure/msal-common\";\nimport { BrowserAuthError, BrowserAuthErrorMessage } from \"../error/BrowserAuthError\";\nimport { DatabaseStorage } from \"./DatabaseStorage\";\nimport { IAsyncStorage } from \"./IAsyncMemoryStorage\";\nimport { MemoryStorage } from \"./MemoryStorage\";\n\n/**\n * This class allows MSAL to store artifacts asynchronously using the DatabaseStorage IndexedDB wrapper,\n * backed up with the more volatile MemoryStorage object for cases in which IndexedDB may be unavailable.\n */\nexport class AsyncMemoryStorage<T> implements IAsyncStorage<T> {\n private inMemoryCache: MemoryStorage<T>;\n private indexedDBCache: DatabaseStorage<T>;\n private logger: Logger;\n private storeName: string;\n\n constructor(logger: Logger, storeName: string) {\n this.inMemoryCache = new MemoryStorage<T>();\n this.indexedDBCache = new DatabaseStorage<T>();\n this.logger = logger;\n this.storeName = storeName;\n }\n\n private handleDatabaseAccessError(error: unknown): void {\n if (error instanceof BrowserAuthError && error.errorCode === BrowserAuthErrorMessage.databaseUnavailable.code) {\n this.logger.error(\"Could not access persistent storage. This may be caused by browser privacy features which block persistent storage in third-party contexts.\");\n } else {\n throw error;\n }\n }\n /**\n * Get the item matching the given key. Tries in-memory cache first, then in the asynchronous\n * storage object if item isn't found in-memory.\n * @param key \n */\n async getItem(key: string): Promise<T | null> {\n const item = this.inMemoryCache.getItem(key);\n if(!item) {\n try {\n this.logger.verbose(\"Queried item not found in in-memory cache, now querying persistent storage.\");\n return await this.indexedDBCache.getItem(key);\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n return item;\n }\n\n /**\n * Sets the item in the in-memory cache and then tries to set it in the asynchronous\n * storage object with the given key.\n * @param key \n * @param value \n */\n async setItem(key: string, value: T): Promise<void> {\n this.inMemoryCache.setItem(key, value);\n try {\n await this.indexedDBCache.setItem(key, value);\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n\n /**\n * Removes the item matching the key from the in-memory cache, then tries to remove it from the asynchronous storage object.\n * @param key \n */\n async removeItem(key: string): Promise<void> {\n this.inMemoryCache.removeItem(key);\n try {\n await this.indexedDBCache.removeItem(key);\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n\n /**\n * Get all the keys from the in-memory cache as an iterable array of strings. If no keys are found, query the keys in the \n * asynchronous storage object.\n */\n async getKeys(): Promise<string[]> {\n const cacheKeys = this.inMemoryCache.getKeys();\n if (cacheKeys.length === 0) {\n try {\n this.logger.verbose(\"In-memory cache is empty, now querying persistent storage.\");\n return await this.indexedDBCache.getKeys();\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n return cacheKeys;\n }\n\n /**\n * Returns true or false if the given key is present in the cache.\n * @param key \n */\n async containsKey(key: string): Promise<boolean> {\n const containsKey = this.inMemoryCache.containsKey(key);\n if(!containsKey) {\n try {\n this.logger.verbose(\"Key not found in in-memory cache, now querying persistent storage.\");\n return await this.indexedDBCache.containsKey(key);\n } catch (e) {\n this.handleDatabaseAccessError(e);\n }\n }\n return containsKey;\n }\n\n /**\n * Clears in-memory Map\n */\n clearInMemory(): void {\n // InMemory cache is a Map instance, clear is straightforward\n this.logger.verbose(`Deleting in-memory keystore ${this.storeName}`);\n this.inMemoryCache.clear();\n this.logger.verbose(`In-memory keystore ${this.storeName} deleted`);\n }\n\n /**\n * Tries to delete the IndexedDB database\n * @returns\n */\n async clearPersistent(): Promise<boolean> {\n try {\n this.logger.verbose(\"Deleting persistent keystore\");\n const dbDeleted = await this.indexedDBCache.deleteDatabase();\n if (dbDeleted) {\n this.logger.verbose(\"Persistent keystore deleted\");\n }\n \n return dbDeleted;\n } catch (e) {\n this.handleDatabaseAccessError(e);\n return false;\n }\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;AAWA;;;;;IAUI,4BAAY,MAAc,EAAE,SAAiB;QACzC,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,EAAK,CAAC;QAC5C,IAAI,CAAC,cAAc,GAAG,IAAI,eAAe,EAAK,CAAC;QAC/C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;KAC9B;IAEO,sDAAyB,GAAjC,UAAkC,KAAc;QAC5C,IAAI,KAAK,YAAY,gBAAgB,IAAI,KAAK,CAAC,SAAS,KAAK,uBAAuB,CAAC,mBAAmB,CAAC,IAAI,EAAE;YAC3G,IAAI,CAAC,MAA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,CAAC,GAAC,CAAC,CAAC;wBAClC,sBAAO,KAAK,EAAC;;;;;KAEpB;IACL,yBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { __extends, __spread, __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { AccountEntity, CacheManager, IdTokenEntity, AccessTokenEntity, RefreshTokenEntity, AppMetadataEntity, ServerTelemetryEntity, AuthorityMetadataEntity, Constants, PersistentCacheKeys, ClientAuthError, ThrottlingEntity, StringUtils, ProtocolUtils, CcsCredentialType, IdToken, DEFAULT_CRYPTO_IMPLEMENTATION } from '@azure/msal-common';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { BrowserConfigurationAuthError } from '../error/BrowserConfigurationAuthError.js';
4
4
  import { BrowserCacheLocation } from '../utils/BrowserConstants.js';
@@ -0,0 +1,18 @@
1
+ import { Logger } from "@azure/msal-common";
2
+ import { CachedKeyPair } from "../crypto/CryptoOps";
3
+ import { AsyncMemoryStorage } from "./AsyncMemoryStorage";
4
+ export declare enum CryptoKeyStoreNames {
5
+ asymmetricKeys = "asymmetricKeys",
6
+ symmetricKeys = "symmetricKeys"
7
+ }
8
+ /**
9
+ * MSAL CryptoKeyStore DB Version 2
10
+ */
11
+ export declare class CryptoKeyStore {
12
+ asymmetricKeys: AsyncMemoryStorage<CachedKeyPair>;
13
+ symmetricKeys: AsyncMemoryStorage<CryptoKey>;
14
+ logger: Logger;
15
+ constructor(logger: Logger);
16
+ clear(): Promise<boolean>;
17
+ }
18
+ //# sourceMappingURL=CryptoKeyStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CryptoKeyStore.d.ts","sourceRoot":"","sources":["../../src/cache/CryptoKeyStore.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,oBAAY,mBAAmB;IAC3B,cAAc,mBAAmB;IACjC,aAAa,kBAAkB;CAClC;AACD;;GAEG;AACH,qBAAa,cAAc;IAChB,cAAc,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAClD,aAAa,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;gBAEV,MAAM,EAAE,MAAM;IAMpB,KAAK,IAAI,OAAO,CAAC,OAAO,CAAC;CAsBlC"}
@@ -0,0 +1,58 @@
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
+ 'use strict';
3
+ import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
+ import { AsyncMemoryStorage } from './AsyncMemoryStorage.js';
5
+
6
+ /*
7
+ * Copyright (c) Microsoft Corporation. All rights reserved.
8
+ * Licensed under the MIT License.
9
+ */
10
+ var CryptoKeyStoreNames;
11
+ (function (CryptoKeyStoreNames) {
12
+ CryptoKeyStoreNames["asymmetricKeys"] = "asymmetricKeys";
13
+ CryptoKeyStoreNames["symmetricKeys"] = "symmetricKeys";
14
+ })(CryptoKeyStoreNames || (CryptoKeyStoreNames = {}));
15
+ /**
16
+ * MSAL CryptoKeyStore DB Version 2
17
+ */
18
+ var CryptoKeyStore = /** @class */ (function () {
19
+ function CryptoKeyStore(logger) {
20
+ this.logger = logger;
21
+ this.asymmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.asymmetricKeys);
22
+ this.symmetricKeys = new AsyncMemoryStorage(this.logger, CryptoKeyStoreNames.symmetricKeys);
23
+ }
24
+ CryptoKeyStore.prototype.clear = function () {
25
+ return __awaiter(this, void 0, void 0, function () {
26
+ var e_1;
27
+ return __generator(this, function (_a) {
28
+ switch (_a.label) {
29
+ case 0:
30
+ // Delete in-memory keystores
31
+ this.asymmetricKeys.clearInMemory();
32
+ this.symmetricKeys.clearInMemory();
33
+ _a.label = 1;
34
+ case 1:
35
+ _a.trys.push([1, 3, , 4]);
36
+ return [4 /*yield*/, this.asymmetricKeys.clearPersistent()];
37
+ case 2:
38
+ _a.sent();
39
+ return [2 /*return*/, true];
40
+ case 3:
41
+ e_1 = _a.sent();
42
+ if (e_1 instanceof Error) {
43
+ this.logger.error("Clearing keystore failed with error: " + e_1.message);
44
+ }
45
+ else {
46
+ this.logger.error("Clearing keystore failed with unknown error");
47
+ }
48
+ return [2 /*return*/, false];
49
+ case 4: return [2 /*return*/];
50
+ }
51
+ });
52
+ });
53
+ };
54
+ return CryptoKeyStore;
55
+ }());
56
+
57
+ export { CryptoKeyStore, CryptoKeyStoreNames };
58
+ //# sourceMappingURL=CryptoKeyStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CryptoKeyStore.js","sources":["../../src/cache/CryptoKeyStore.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Logger } from \"@azure/msal-common\";\nimport { CachedKeyPair } from \"../crypto/CryptoOps\";\nimport { AsyncMemoryStorage } from \"./AsyncMemoryStorage\";\n\nexport enum CryptoKeyStoreNames {\n asymmetricKeys = \"asymmetricKeys\",\n symmetricKeys = \"symmetricKeys\"\n}\n/**\n * MSAL CryptoKeyStore DB Version 2\n */\nexport class CryptoKeyStore {\n public asymmetricKeys: AsyncMemoryStorage<CachedKeyPair>;\n public symmetricKeys: AsyncMemoryStorage<CryptoKey>;\n public logger: Logger;\n\n constructor(logger: Logger){\n this.logger = logger;\n this.asymmetricKeys = new AsyncMemoryStorage<CachedKeyPair>(this.logger, CryptoKeyStoreNames.asymmetricKeys);\n this.symmetricKeys = new AsyncMemoryStorage<CryptoKey>(this.logger, CryptoKeyStoreNames.symmetricKeys);\n }\n\n async clear(): Promise<boolean> {\n // Delete in-memory keystores\n this.asymmetricKeys.clearInMemory();\n\t this.symmetricKeys.clearInMemory();\n\t\t\n /**\n * There is only one database, so calling clearPersistent on asymmetric keystore takes care of\n * every persistent keystore\n */\n try {\n await this.asymmetricKeys.clearPersistent();\n return true;\n } catch (e) {\n if (e instanceof Error) {\n this.logger.error(`Clearing keystore failed with error: ${e.message}`);\n } else {\n this.logger.error(\"Clearing keystore failed with unknown error\");\n }\n \n return false;\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;IASY;AAAZ,WAAY,mBAAmB;IAC3B,wDAAiC,CAAA;IACjC,sDAA+B,CAAA;AACnC,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B;AACD;;;;IAQI,wBAAY,MAAc;QACtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,IAAI,kBAAkB,CAAgB,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,cAAc,CAAC,CAAC;QAC7G,IAAI,CAAC,aAAa,GAAG,IAAI,kBAAkB,CAAY,IAAI,CAAC,MAAM,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;KAC1G;IAEK,8BAAK,GAAX;;;;;;;wBAEI,IAAI,CAAC,cAAc,CAAC,aAAa,EAAE,CAAC;wBACvC,IAAI,CAAC,aAAa,CAAC,aAAa,EAAE,CAAC;;;;wBAO5B,qBAAM,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,EAAA;;wBAA3C,SAA2C,CAAC;wBAC5C,sBAAO,IAAI,EAAC;;;wBAEZ,IAAI,GAAC,YAAY,KAAK,EAAE;4BACpB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0CAAwC,GAAC,CAAC,OAAS,CAAC,CAAC;yBAC1E;6BAAM;4BACH,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAC;yBACpE;wBAED,sBAAO,KAAK,EAAC;;;;;KAEpB;IACL,qBAAC;AAAD,CAAC;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseStorage.d.ts","sourceRoot":"","sources":["../../src/cache/DatabaseStorage.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAmBtD;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,CAAwB;IAClC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAU;;IASxB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB3B;;;OAGG;IACH,eAAe,IAAI,IAAI;IAQvB;;OAEG;YACW,gBAAgB;IAM9B;;;OAGG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAwB7C;;;;OAIG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBrD;;;OAGG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB5C;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAwBlC;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBhD;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAuB3C"}
1
+ {"version":3,"file":"DatabaseStorage.d.ts","sourceRoot":"","sources":["../../src/cache/DatabaseStorage.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AActD;;GAEG;AACH,qBAAa,eAAe,CAAC,CAAC,CAAE,YAAW,aAAa,CAAC,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,CAAwB;IAClC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,MAAM,CAAU;;IASxB;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAiB3B;;;OAGG;IACH,eAAe,IAAI,IAAI;IAQvB;;OAEG;YACW,gBAAgB;IAM9B;;;OAGG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAwB7C;;;;OAIG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAyBrD;;;OAGG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAuB5C;;OAEG;IACG,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAwBlC;;;OAGG;IACG,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBhD;;;;OAIG;IACG,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;CAc3C"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
@@ -241,29 +241,17 @@ var DatabaseStorage = /** @class */ (function () {
241
241
  */
242
242
  DatabaseStorage.prototype.deleteDatabase = function () {
243
243
  return __awaiter(this, void 0, void 0, function () {
244
- var existingDatabases, database;
245
244
  return __generator(this, function (_a) {
246
- switch (_a.label) {
247
- case 0:
248
- // Check if database being deleted exists
249
- if (this.db && this.dbOpen) {
250
- this.closeConnection();
251
- }
252
- return [4 /*yield*/, window.indexedDB.databases()];
253
- case 1:
254
- existingDatabases = _a.sent();
255
- database = existingDatabases.find(function (database) { return database.name === DB_NAME; });
256
- // If database exists, delete it
257
- if (database) {
258
- return [2 /*return*/, new Promise(function (resolve, reject) {
259
- var deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
260
- deleteDbRequest.addEventListener("success", function () { return resolve(true); });
261
- deleteDbRequest.addEventListener("error", function () { return reject(false); });
262
- })];
263
- }
264
- // Database doesn't exist, return true
265
- return [2 /*return*/, true];
245
+ // Check if database being deleted exists
246
+ if (this.db && this.dbOpen) {
247
+ this.closeConnection();
266
248
  }
249
+ return [2 /*return*/, new Promise(function (resolve, reject) {
250
+ var deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);
251
+ deleteDbRequest.addEventListener("success", function () { return resolve(true); });
252
+ deleteDbRequest.addEventListener("blocked", function () { return resolve(true); });
253
+ deleteDbRequest.addEventListener("error", function () { return reject(false); });
254
+ })];
267
255
  });
268
256
  });
269
257
  };
@@ -1 +1 @@
1
- {"version":3,"file":"DatabaseStorage.js","sources":["../../src/cache/DatabaseStorage.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { DB_NAME, DB_TABLE_NAME, DB_VERSION } from \"../utils/BrowserConstants\";\nimport { IAsyncStorage } from \"./IAsyncMemoryStorage\";\n\ninterface IDBOpenDBRequestEvent extends Event {\n target: IDBOpenDBRequest & EventTarget;\n}\n\ninterface IDBOpenOnUpgradeNeededEvent extends IDBVersionChangeEvent {\n target: IDBOpenDBRequest & EventTarget;\n}\n\ninterface IDBRequestEvent extends Event {\n target: IDBRequest & EventTarget;\n}\n\ninterface IDBDatabaseInfo {\n name?: string;\n version?: number;\n}\n\n/**\n * Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\n */\nexport class DatabaseStorage<T> implements IAsyncStorage<T> {\n private db: IDBDatabase|undefined;\n private dbName: string;\n private tableName: string;\n private version: number;\n private dbOpen: boolean;\n\n constructor() {\n this.dbName = DB_NAME;\n this.version = DB_VERSION;\n this.tableName = DB_TABLE_NAME;\n this.dbOpen = false;\n }\n\n /**\n * Opens IndexedDB instance.\n */\n async open(): Promise<void> {\n return new Promise((resolve, reject) => {\n const openDB = window.indexedDB.open(this.dbName, this.version);\n openDB.addEventListener(\"upgradeneeded\", (e: IDBVersionChangeEvent) => {\n const event = e as IDBOpenOnUpgradeNeededEvent;\n event.target.result.createObjectStore(this.tableName);\n });\n openDB.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBOpenDBRequestEvent;\n this.db = event.target.result;\n this.dbOpen = true;\n resolve();\n });\n openDB.addEventListener(\"error\", () => reject(BrowserAuthError.createDatabaseUnavailableError()));\n });\n }\n\n /**\n * Closes the connection to IndexedDB database when all pending transactions\n * complete.\n */\n closeConnection(): void {\n const db = this.db;\n if (db && this.dbOpen) {\n db.close();\n this.dbOpen = false;\n }\n }\n\n /**\n * Opens database if it's not already open\n */\n private async validateDbIsOpen(): Promise<void> {\n if (!this.dbOpen) {\n return await this.open();\n }\n }\n\n /**\n * Retrieves item from IndexedDB instance.\n * @param key \n */\n async getItem(key: string): Promise<T | null> {\n await this.validateDbIsOpen();\n return new Promise<T>((resolve, reject) => {\n // TODO: Add timeouts?\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbGet = objectStore.get(key);\n \n dbGet.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result);\n });\n\n dbGet.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Adds item to IndexedDB under given key\n * @param key \n * @param payload \n */\n async setItem(key: string, payload: T): Promise<void> {\n await this.validateDbIsOpen();\n return new Promise<void>((resolve: Function, reject: Function) => {\n // TODO: Add timeouts?\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\n\n const objectStore = transaction.objectStore(this.tableName);\n\n const dbPut = objectStore.put(payload, key);\n\n dbPut.addEventListener(\"success\", () => {\n this.closeConnection();\n resolve();\n });\n\n dbPut.addEventListener(\"error\", (e) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Removes item from IndexedDB under given key\n * @param key\n */\n async removeItem(key: string): Promise<void> {\n await this.validateDbIsOpen();\n return new Promise<void>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbDelete = objectStore.delete(key);\n\n dbDelete.addEventListener(\"success\", () => {\n this.closeConnection();\n resolve();\n });\n\n dbDelete.addEventListener(\"error\", (e) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Get all the keys from the storage object as an iterable array of strings.\n */\n async getKeys(): Promise<string[]> {\n await this.validateDbIsOpen();\n return new Promise<string[]>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbGetKeys = objectStore.getAllKeys();\n\n dbGetKeys.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result);\n });\n\n dbGetKeys.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * \n * Checks whether there is an object under the search key in the object store\n */\n async containsKey(key: string): Promise<boolean> {\n await this.validateDbIsOpen();\n\n return new Promise<boolean>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbContainsKey = objectStore.count(key);\n\n dbContainsKey.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result === 1);\n });\n\n dbContainsKey.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Deletes the MSAL database. The database is deleted rather than cleared to make it possible\n * for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues\n * with IndexedDB database versions.\n */\n async deleteDatabase(): Promise<boolean> {\n // Check if database being deleted exists\n\n if (this.db && this.dbOpen) {\n this.closeConnection();\n }\n \n // @ts-ignore\n const existingDatabases = await window.indexedDB.databases();\n const database = existingDatabases.find((database: IDBDatabaseInfo) => database.name === DB_NAME );\n\n // If database exists, delete it\n if (database) {\n return new Promise<boolean>((resolve: Function, reject: Function) => {\n const deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);\n deleteDbRequest.addEventListener(\"success\", () => resolve(true));\n deleteDbRequest.addEventListener(\"error\", () => reject(false));\n });\n }\n\n // Database doesn't exist, return true\n return true;\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AA0BA;;;;IAUI;QACI,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;KACvB;;;;IAKK,8BAAI,GAAV;;;;gBACI,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;wBAC/B,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAI,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;wBAChE,MAAM,CAAC,gBAAgB,CAAC,eAAe,EAAE,UAA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,OAAA,MAAM,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;iCAClE,CAAC,EAAC;yBACN;;wBAGD,sBAAO,IAAI,EAAC;;;;KACf;IACL,sBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"DatabaseStorage.js","sources":["../../src/cache/DatabaseStorage.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { DB_NAME, DB_TABLE_NAME, DB_VERSION } from \"../utils/BrowserConstants\";\nimport { IAsyncStorage } from \"./IAsyncMemoryStorage\";\n\ninterface IDBOpenDBRequestEvent extends Event {\n target: IDBOpenDBRequest & EventTarget;\n}\n\ninterface IDBOpenOnUpgradeNeededEvent extends IDBVersionChangeEvent {\n target: IDBOpenDBRequest & EventTarget;\n}\n\ninterface IDBRequestEvent extends Event {\n target: IDBRequest & EventTarget;\n}\n\n/**\n * Storage wrapper for IndexedDB storage in browsers: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\n */\nexport class DatabaseStorage<T> implements IAsyncStorage<T> {\n private db: IDBDatabase|undefined;\n private dbName: string;\n private tableName: string;\n private version: number;\n private dbOpen: boolean;\n\n constructor() {\n this.dbName = DB_NAME;\n this.version = DB_VERSION;\n this.tableName = DB_TABLE_NAME;\n this.dbOpen = false;\n }\n\n /**\n * Opens IndexedDB instance.\n */\n async open(): Promise<void> {\n return new Promise((resolve, reject) => {\n const openDB = window.indexedDB.open(this.dbName, this.version);\n openDB.addEventListener(\"upgradeneeded\", (e: IDBVersionChangeEvent) => {\n const event = e as IDBOpenOnUpgradeNeededEvent;\n event.target.result.createObjectStore(this.tableName);\n });\n openDB.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBOpenDBRequestEvent;\n this.db = event.target.result;\n this.dbOpen = true;\n resolve();\n });\n openDB.addEventListener(\"error\", () => reject(BrowserAuthError.createDatabaseUnavailableError()));\n });\n }\n\n /**\n * Closes the connection to IndexedDB database when all pending transactions\n * complete.\n */\n closeConnection(): void {\n const db = this.db;\n if (db && this.dbOpen) {\n db.close();\n this.dbOpen = false;\n }\n }\n\n /**\n * Opens database if it's not already open\n */\n private async validateDbIsOpen(): Promise<void> {\n if (!this.dbOpen) {\n return await this.open();\n }\n }\n\n /**\n * Retrieves item from IndexedDB instance.\n * @param key \n */\n async getItem(key: string): Promise<T | null> {\n await this.validateDbIsOpen();\n return new Promise<T>((resolve, reject) => {\n // TODO: Add timeouts?\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbGet = objectStore.get(key);\n \n dbGet.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result);\n });\n\n dbGet.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Adds item to IndexedDB under given key\n * @param key \n * @param payload \n */\n async setItem(key: string, payload: T): Promise<void> {\n await this.validateDbIsOpen();\n return new Promise<void>((resolve: Function, reject: Function) => {\n // TODO: Add timeouts?\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\n\n const objectStore = transaction.objectStore(this.tableName);\n\n const dbPut = objectStore.put(payload, key);\n\n dbPut.addEventListener(\"success\", () => {\n this.closeConnection();\n resolve();\n });\n\n dbPut.addEventListener(\"error\", (e) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Removes item from IndexedDB under given key\n * @param key\n */\n async removeItem(key: string): Promise<void> {\n await this.validateDbIsOpen();\n return new Promise<void>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readwrite\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbDelete = objectStore.delete(key);\n\n dbDelete.addEventListener(\"success\", () => {\n this.closeConnection();\n resolve();\n });\n\n dbDelete.addEventListener(\"error\", (e) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Get all the keys from the storage object as an iterable array of strings.\n */\n async getKeys(): Promise<string[]> {\n await this.validateDbIsOpen();\n return new Promise<string[]>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbGetKeys = objectStore.getAllKeys();\n\n dbGetKeys.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result);\n });\n\n dbGetKeys.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * \n * Checks whether there is an object under the search key in the object store\n */\n async containsKey(key: string): Promise<boolean> {\n await this.validateDbIsOpen();\n\n return new Promise<boolean>((resolve: Function, reject: Function) => {\n if (!this.db) {\n return reject(BrowserAuthError.createDatabaseNotOpenError());\n }\n\n const transaction = this.db.transaction([this.tableName], \"readonly\");\n const objectStore = transaction.objectStore(this.tableName);\n const dbContainsKey = objectStore.count(key);\n\n dbContainsKey.addEventListener(\"success\", (e: Event) => {\n const event = e as IDBRequestEvent;\n this.closeConnection();\n resolve(event.target.result === 1);\n });\n\n dbContainsKey.addEventListener(\"error\", (e: Event) => {\n this.closeConnection();\n reject(e);\n });\n });\n }\n\n /**\n * Deletes the MSAL database. The database is deleted rather than cleared to make it possible\n * for client applications to downgrade to a previous MSAL version without worrying about forward compatibility issues\n * with IndexedDB database versions.\n */\n async deleteDatabase(): Promise<boolean> {\n // Check if database being deleted exists\n\n if (this.db && this.dbOpen) {\n this.closeConnection();\n }\n\n return new Promise<boolean>((resolve: Function, reject: Function) => {\n const deleteDbRequest = window.indexedDB.deleteDatabase(DB_NAME);\n deleteDbRequest.addEventListener(\"success\", () => resolve(true));\n deleteDbRequest.addEventListener(\"blocked\", () => resolve(true));\n deleteDbRequest.addEventListener(\"error\", () => reject(false));\n });\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AAqBA;;;;IAUI;QACI,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC;QAC1B,IAAI,CAAC,SAAS,GAAG,aAAa,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;KACvB;;;;IAKK,8BAAI,GAAV;;;;gBACI,sBAAO,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;wBAC/B,IAAM,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,KAAI,CAAC,MAAM,EAAE,KAAI,CAAC,OAAO,CAAC,CAAC;wBAChE,MAAM,CAAC,gBAAgB,CAAC,eAAe,EAAE,UAAC,CAAwB;4BAC9D,IAAM,KAAK,GAAG,CAAgC,CAAC;4BAC/C,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,iBAAiB,CAAC,KAAI,CAAC,SAAS,CAAC,CAAC;yBACzD,CAAC,CAAC;wBACH,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAC,CAAQ;4BACxC,IAAM,KAAK,GAAG,CAA0B,CAAC;4BACzC,KAAI,CAAC,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC;4BAC9B,KAAI,CAAC,MAAM,GAAG,IAAI,CAAC;4BACnB,OAAO,EAAE,CAAC;yBACb,CAAC,CAAC;wBACH,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAG,cAAM,OAAA,MAAM,CAAC,gBAAgB,CAAC,8BAA8B,EAAE,CAAC,GAAA,CAAC,CAAC;qBACtG,CAAC,EAAC;;;KACN;;;;;IAMD,yCAAe,GAAf;QACI,IAAM,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QACnB,IAAI,EAAE,IAAI,IA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oBACxB,IAAI,CAAC,eAAe,EAAE,CAAC;iBAC1B;gBAED,sBAAO,IAAI,OAAO,CAAU,UAAC,OAAiB,EAAE,MAAgB;wBAC5D,IAAM,eAAe,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;wBACjE,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,GAAA,CAAC,CAAC;wBACjE,eAAe,CAAC,gBAAgB,CAAC,SAAS,EAAE,cAAM,OAAA,OAAO,CAAC,IAAI,CAAC,GAAA,CAAC,CAAC;wBACjE,eAAe,CAAC,gBAAgB,CAAC,OAAO,EAAE,cAAM,OAAA,MAAM,CAAC,KAAK,CAAC,GAAA,CAAC,CAAC;qBAClE,CAAC,EAAC;;;KACN;IACL,sBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { Authority, IdTokenEntity, AuthToken, AccountEntity, ScopeSet, AccessTokenEntity } from '@azure/msal-common';
4
4
  import { BrowserAuthError } from '../error/BrowserAuthError.js';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { __assign } from '../_virtual/_tslib.js';
4
4
  import { DEFAULT_SYSTEM_OPTIONS, StubbedNetworkModule, Constants, ProtocolMode, AzureCloudInstance, LogLevel } from '@azure/msal-common';
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-browser v2.28.2 2022-09-06 */
1
+ /*! @azure/msal-browser v2.28.3 2022-09-12 */
2
2
  'use strict';
3
3
  import { __awaiter, __generator } from '../_virtual/_tslib.js';
4
4
  import { BrowserStringUtils } from '../utils/BrowserStringUtils.js';
@@ -1,22 +1,10 @@
1
1
  import { ICrypto, IPerformanceClient, Logger, PkceCodes, SignedHttpRequest, SignedHttpRequestParameters } from "@azure/msal-common";
2
- import { AsyncMemoryStorage } from "../cache/AsyncMemoryStorage";
3
2
  export declare type CachedKeyPair = {
4
3
  publicKey: CryptoKey;
5
4
  privateKey: CryptoKey;
6
5
  requestMethod?: string;
7
6
  requestUri?: string;
8
7
  };
9
- /**
10
- * MSAL CryptoKeyStore DB Version 2
11
- */
12
- export declare type CryptoKeyStore = {
13
- asymmetricKeys: AsyncMemoryStorage<CachedKeyPair>;
14
- symmetricKeys: AsyncMemoryStorage<CryptoKey>;
15
- };
16
- export declare enum CryptoKeyStoreNames {
17
- asymmetricKeys = "asymmetricKeys",
18
- symmetricKeys = "symmetricKeys"
19
- }
20
8
  /**
21
9
  * This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and
22
10
  * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).
@@ -1 +1 @@
1
- {"version":3,"file":"CryptoOps.d.ts","sourceRoot":"","sources":["../../src/crypto/CryptoOps.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAc,MAAM,EAAqB,SAAS,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAQnK,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEjE,oBAAY,aAAa,GAAG;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;CACtB,CAAC;AAEF;;GAEG;AACH,oBAAY,cA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