@azure/msal-browser 2.24.0 → 2.27.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.
- package/README.md +1 -1
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts +11 -7
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +46 -14
- package/dist/app/ClientApplication.js.map +1 -1
- package/dist/app/IPublicClientApplication.js +1 -1
- package/dist/app/PublicClientApplication.d.ts.map +1 -1
- package/dist/app/PublicClientApplication.js +9 -3
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +1 -1
- package/dist/broker/nativeBroker/NativeRequest.d.ts +3 -3
- package/dist/broker/nativeBroker/NativeRequest.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts +26 -1
- package/dist/broker/nativeBroker/NativeResponse.d.ts.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/BrowserCacheManager.js +2 -2
- package/dist/cache/BrowserCacheManager.js.map +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.d.ts +1 -0
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.js +5 -4
- package/dist/cache/TokenCache.js.map +1 -1
- package/dist/config/Configuration.d.ts +4 -0
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.js +2 -1
- package/dist/config/Configuration.js.map +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/CryptoOps.d.ts.map +1 -1
- package/dist/crypto/CryptoOps.js +7 -10
- package/dist/crypto/CryptoOps.js.map +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/PkceGenerator.js +1 -1
- package/dist/crypto/SignedHttpRequest.js +1 -1
- package/dist/encode/Base64Decode.js +1 -1
- package/dist/encode/Base64Encode.js +1 -1
- package/dist/error/BrowserAuthError.d.ts +1 -1
- package/dist/error/BrowserAuthError.js +5 -5
- package/dist/error/BrowserAuthError.js.map +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/NativeAuthError.d.ts +3 -1
- package/dist/error/NativeAuthError.d.ts.map +1 -1
- package/dist/error/NativeAuthError.js +6 -2
- package/dist/error/NativeAuthError.js.map +1 -1
- package/dist/event/EventHandler.js +1 -1
- package/dist/event/EventMessage.js +1 -1
- package/dist/event/EventType.js +1 -1
- package/dist/index.cjs.js +841 -549
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +3 -2
- package/dist/interaction_client/BaseInteractionClient.js.map +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts +12 -0
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +76 -31
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.d.ts +75 -2
- package/dist/interaction_client/PopupClient.d.ts.map +1 -1
- package/dist/interaction_client/PopupClient.js +281 -41
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +1 -1
- package/dist/interaction_client/SilentCacheClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +4 -2
- package/dist/interaction_client/SilentCacheClient.js.map +1 -1
- package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentIframeClient.js +3 -1
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.d.ts.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +3 -1
- package/dist/interaction_client/SilentRefreshClient.js.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +4 -1
- package/dist/interaction_client/StandardInteractionClient.js.map +1 -1
- package/dist/interaction_handler/InteractionHandler.d.ts +3 -8
- package/dist/interaction_handler/InteractionHandler.d.ts.map +1 -1
- package/dist/interaction_handler/InteractionHandler.js +5 -5
- package/dist/interaction_handler/InteractionHandler.js.map +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts +1 -1
- package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
- package/dist/interaction_handler/RedirectHandler.js +12 -12
- package/dist/interaction_handler/RedirectHandler.js.map +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts.map +1 -1
- package/dist/interaction_handler/SilentHandler.js +5 -5
- package/dist/interaction_handler/SilentHandler.js.map +1 -1
- package/dist/internals.d.ts +0 -1
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +1 -2
- package/dist/internals.js.map +1 -1
- package/dist/navigation/NavigationClient.js +1 -1
- package/dist/network/FetchClient.js +1 -1
- package/dist/network/XhrClient.js +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +2 -2
- package/dist/packageMetadata.js.map +1 -1
- package/dist/request/EndSessionPopupRequest.d.ts +1 -1
- package/dist/request/EndSessionPopupRequest.d.ts.map +1 -1
- package/dist/request/PopupRequest.d.ts +1 -1
- package/dist/request/PopupRequest.d.ts.map +1 -1
- package/dist/request/PopupWindowAttributes.d.ts +16 -0
- package/dist/request/PopupWindowAttributes.d.ts.map +1 -0
- package/dist/request/SsoSilentRequest.d.ts +1 -1
- package/dist/telemetry/BrowserPerformanceClient.js +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/utils/BrowserConstants.d.ts +1 -0
- package/dist/utils/BrowserConstants.d.ts.map +1 -1
- package/dist/utils/BrowserConstants.js +3 -2
- package/dist/utils/BrowserConstants.js.map +1 -1
- package/dist/utils/BrowserProtocolUtils.js +1 -1
- package/dist/utils/BrowserStringUtils.js +1 -1
- package/dist/utils/BrowserUtils.js +1 -1
- package/dist/utils/MathUtils.js +1 -1
- package/lib/msal-browser.js +841 -549
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +43 -41
- package/package.json +2 -2
- package/dist/interaction_handler/PopupHandler.d.ts +0 -29
- package/dist/interaction_handler/PopupHandler.d.ts.map +0 -1
- package/dist/interaction_handler/PopupHandler.js +0 -69
- package/dist/interaction_handler/PopupHandler.js.map +0 -1
- package/dist/utils/PopupUtils.d.ts +0 -73
- package/dist/utils/PopupUtils.d.ts.map +0 -1
- package/dist/utils/PopupUtils.js +0 -185
- package/dist/utils/PopupUtils.js.map +0 -1
package/dist/cache/TokenCache.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.27.0 2022-07-05 */
|
|
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';
|
|
@@ -41,6 +41,7 @@ var TokenCache = /** @class */ (function () {
|
|
|
41
41
|
knownAuthorities: this.config.auth.knownAuthorities,
|
|
42
42
|
cloudDiscoveryMetadata: this.config.auth.cloudDiscoveryMetadata,
|
|
43
43
|
authorityMetadata: this.config.auth.authorityMetadata,
|
|
44
|
+
skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,
|
|
44
45
|
};
|
|
45
46
|
var authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);
|
|
46
47
|
// "clientInfo" from options takes precedence over "clientInfo" in response
|
|
@@ -74,8 +75,8 @@ var TokenCache = /** @class */ (function () {
|
|
|
74
75
|
var idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken, this.config.auth.clientId, tenantId);
|
|
75
76
|
var idAuthToken = new AuthToken(idToken, this.cryptoObj);
|
|
76
77
|
var accountEntity = options.clientInfo ?
|
|
77
|
-
AccountEntity.createAccount(options.clientInfo, homeAccountId, idAuthToken, undefined, undefined, undefined,
|
|
78
|
-
AccountEntity.createGenericAccount(homeAccountId, idAuthToken, undefined, undefined, undefined,
|
|
78
|
+
AccountEntity.createAccount(options.clientInfo, homeAccountId, idAuthToken, undefined, undefined, undefined, environment) :
|
|
79
|
+
AccountEntity.createGenericAccount(homeAccountId, idAuthToken, undefined, undefined, undefined, environment);
|
|
79
80
|
if (this.isBrowserEnvironment) {
|
|
80
81
|
this.logger.verbose("TokenCache - loading id token");
|
|
81
82
|
this.storage.setAccount(accountEntity);
|
|
@@ -107,7 +108,7 @@ var TokenCache = /** @class */ (function () {
|
|
|
107
108
|
throw BrowserAuthError.createUnableToLoadTokenError("Please provide an extendedExpiresOn value in the options.");
|
|
108
109
|
}
|
|
109
110
|
var scopes = new ScopeSet(request.scopes).printScopes();
|
|
110
|
-
var expiresOn = response.expires_in;
|
|
111
|
+
var expiresOn = options.expiresOn || (response.expires_in + new Date().getTime() / 1000);
|
|
111
112
|
var extendedExpiresOn = options.extendedExpiresOn;
|
|
112
113
|
var accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes, expiresOn, extendedExpiresOn, this.cryptoObj);
|
|
113
114
|
if (this.isBrowserEnvironment) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenCache.js","sources":["../../src/cache/TokenCache.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AccessTokenEntity, ICrypto, IdTokenEntity, Logger, ScopeSet, Authority, AuthorityOptions, ExternalTokenResponse, AccountEntity, AuthToken } from \"@azure/msal-common\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { BrowserCacheManager } from \"./BrowserCacheManager\";\nimport { ITokenCache } from \"./ITokenCache\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\n\nexport type LoadTokenOptions = {\n clientInfo?: string,\n extendedExpiresOn?: number\n};\n\n/**\n * Token cache manager\n */\nexport class TokenCache implements ITokenCache {\n // Flag to indicate if in browser environment\n public isBrowserEnvironment: boolean;\n // Input configuration by developer/user\n protected config: BrowserConfiguration;\n // Browser cache storage\n private storage: BrowserCacheManager;\n // Logger\n private logger: Logger;\n // Crypto class\n private cryptoObj: ICrypto;\n\n constructor(configuration: BrowserConfiguration, storage: BrowserCacheManager, logger: Logger, cryptoObj: ICrypto) {\n this.isBrowserEnvironment = typeof window !== \"undefined\";\n this.config = configuration;\n this.storage = storage;\n this.logger = logger;\n this.cryptoObj = cryptoObj;\n }\n\n // Move getAllAccounts here and cache utility APIs\n\n /**\n * API to load tokens to msal-browser cache.\n * @param request\n * @param response\n * @param options\n */\n loadExternalTokens(request: SilentRequest, response: ExternalTokenResponse, options: LoadTokenOptions): void {\n this.logger.info(\"TokenCache - loadExternalTokens called\");\n\n if (!response.id_token) {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please ensure server response includes id token.\");\n }\n\n if (request.account) {\n this.loadIdToken(response.id_token, request.account.homeAccountId, request.account.environment, request.account.tenantId, options);\n this.loadAccessToken(request, response, request.account.homeAccountId, request.account.environment, request.account.tenantId, options);\n } else if (request.authority) {\n\n const authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);\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 const authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);\n\n // \"clientInfo\" from options takes precedence over \"clientInfo\" in response\n if (options.clientInfo) {\n this.logger.trace(\"TokenCache - homeAccountId from options\");\n this.loadIdToken(response.id_token, options.clientInfo, authority.hostnameAndPort, authority.tenant, options);\n this.loadAccessToken(request, response, options.clientInfo, authority.hostnameAndPort, authority.tenant, options);\n } else if (response.client_info) {\n this.logger.trace(\"TokenCache - homeAccountId from response\");\n this.loadIdToken(response.id_token, response.client_info, authority.hostnameAndPort, authority.tenant, options);\n this.loadAccessToken(request, response, response.client_info, authority.hostnameAndPort, authority.tenant, options);\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide clientInfo in the response or options.\");\n }\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide a request with an account or a request with authority.\");\n }\n }\n\n /**\n * Helper function to load id tokens to msal-browser cache\n * @param idToken\n * @param homeAccountId\n * @param environment\n * @param tenantId\n * @param options\n */\n private loadIdToken(idToken: string, homeAccountId: string, environment: string, tenantId: string, options: LoadTokenOptions): void {\n\n const idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken, this.config.auth.clientId, tenantId);\n const idAuthToken = new AuthToken(idToken, this.cryptoObj);\n const accountEntity = options.clientInfo ?\n AccountEntity.createAccount(options.clientInfo, homeAccountId, idAuthToken, undefined, undefined, undefined, undefined, environment) :\n AccountEntity.createGenericAccount(homeAccountId, idAuthToken, undefined, undefined, undefined, undefined, environment);\n\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading id token\");\n this.storage.setAccount(accountEntity);\n this.storage.setIdTokenCredential(idTokenEntity);\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\n }\n }\n\n /**\n * Helper function to load access tokens to msal-browser cache\n * @param request\n * @param response\n * @param options\n * @param homeAccountId\n * @param environment\n * @param tenantId\n * @returns\n */\n private loadAccessToken(request: SilentRequest, response: ExternalTokenResponse, homeAccountId: string, environment: string, tenantId: string, options: LoadTokenOptions): void {\n\n if (!response.access_token) {\n this.logger.verbose(\"TokenCache - No access token provided for caching\");\n return;\n }\n\n if (!response.expires_in) {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please ensure server response includes expires_in value.\");\n }\n\n if (!options.extendedExpiresOn) {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide an extendedExpiresOn value in the options.\");\n }\n\n const scopes = new ScopeSet(request.scopes).printScopes();\n const expiresOn = response.expires_in;\n const extendedExpiresOn = options.extendedExpiresOn;\n\n const accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes, expiresOn, extendedExpiresOn, this.cryptoObj);\n\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading access token\");\n this.storage.setAccessTokenCredential(accessTokenEntity);\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAiBA;;;;IAeI,oBAAY,aAAmC,EAAE,OAA4B,EAAE,MAAc,EAAE,SAAkB;QAC7G,IAAI,CAAC,oBAAoB,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC;QAC1D,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;KAC9B;;;;;;;;IAUD,uCAAkB,GAAlB,UAAmB,OAAsB,EAAE,QAA+B,EAAE,OAAyB;QACjG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;QAE3D,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE;YACpB,MAAM,gBAAgB,CAAC,4BAA4B,CAAC,kDAAkD,CAAC,CAAC;SAC3G;QAED,IAAI,OAAO,CAAC,OAAO,EAAE;YACjB,IAAI,CAA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MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAElN,IAAI,IAAI,CAAC,oBAAoB,EAAE;YAC3B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;YACzD,IAAI,CAAC,OAAO,CAAC,wBAAwB,CAAC,iBAAiB,CAAC,CAAC;SAC5D;aAAM;YACH,MAAM,gBAAgB,CAAC,4BAA4B,CAAC,sEAAsE,CAAC,CAAC;SAC/H;KACJ;IACL,iBAAC;AAAD,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"TokenCache.js","sources":["../../src/cache/TokenCache.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AccessTokenEntity, ICrypto, IdTokenEntity, Logger, ScopeSet, Authority, AuthorityOptions, ExternalTokenResponse, AccountEntity, AuthToken } from \"@azure/msal-common\";\nimport { BrowserConfiguration } from \"../config/Configuration\";\nimport { SilentRequest } from \"../request/SilentRequest\";\nimport { BrowserCacheManager } from \"./BrowserCacheManager\";\nimport { ITokenCache } from \"./ITokenCache\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\n\nexport type LoadTokenOptions = {\n clientInfo?: string,\n expiresOn?: number,\n extendedExpiresOn?: number\n};\n\n/**\n * Token cache manager\n */\nexport class TokenCache implements ITokenCache {\n // Flag to indicate if in browser environment\n public isBrowserEnvironment: boolean;\n // Input configuration by developer/user\n protected config: BrowserConfiguration;\n // Browser cache storage\n private storage: BrowserCacheManager;\n // Logger\n private logger: Logger;\n // Crypto class\n private cryptoObj: ICrypto;\n\n constructor(configuration: BrowserConfiguration, storage: BrowserCacheManager, logger: Logger, cryptoObj: ICrypto) {\n this.isBrowserEnvironment = typeof window !== \"undefined\";\n this.config = configuration;\n this.storage = storage;\n this.logger = logger;\n this.cryptoObj = cryptoObj;\n }\n\n // Move getAllAccounts here and cache utility APIs\n\n /**\n * API to load tokens to msal-browser cache.\n * @param request\n * @param response\n * @param options\n */\n loadExternalTokens(request: SilentRequest, response: ExternalTokenResponse, options: LoadTokenOptions): void {\n this.logger.info(\"TokenCache - loadExternalTokens called\");\n\n if (!response.id_token) {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please ensure server response includes id token.\");\n }\n\n if (request.account) {\n this.loadIdToken(response.id_token, request.account.homeAccountId, request.account.environment, request.account.tenantId, options);\n this.loadAccessToken(request, response, request.account.homeAccountId, request.account.environment, request.account.tenantId, options);\n } else if (request.authority) {\n\n const authorityUrl = Authority.generateAuthority(request.authority, request.azureCloudOptions);\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 skipAuthorityMetadataCache: this.config.auth.skipAuthorityMetadataCache,\n };\n const authority = new Authority(authorityUrl, this.config.system.networkClient, this.storage, authorityOptions);\n\n // \"clientInfo\" from options takes precedence over \"clientInfo\" in response\n if (options.clientInfo) {\n this.logger.trace(\"TokenCache - homeAccountId from options\");\n this.loadIdToken(response.id_token, options.clientInfo, authority.hostnameAndPort, authority.tenant, options);\n this.loadAccessToken(request, response, options.clientInfo, authority.hostnameAndPort, authority.tenant, options);\n } else if (response.client_info) {\n this.logger.trace(\"TokenCache - homeAccountId from response\");\n this.loadIdToken(response.id_token, response.client_info, authority.hostnameAndPort, authority.tenant, options);\n this.loadAccessToken(request, response, response.client_info, authority.hostnameAndPort, authority.tenant, options);\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide clientInfo in the response or options.\");\n }\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide a request with an account or a request with authority.\");\n }\n }\n\n /**\n * Helper function to load id tokens to msal-browser cache\n * @param idToken\n * @param homeAccountId\n * @param environment\n * @param tenantId\n * @param options\n */\n private loadIdToken(idToken: string, homeAccountId: string, environment: string, tenantId: string, options: LoadTokenOptions): void {\n\n const idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken, this.config.auth.clientId, tenantId);\n const idAuthToken = new AuthToken(idToken, this.cryptoObj);\n const accountEntity = options.clientInfo ?\n AccountEntity.createAccount(options.clientInfo, homeAccountId, idAuthToken, undefined, undefined, undefined, environment) :\n AccountEntity.createGenericAccount(homeAccountId, idAuthToken, undefined, undefined, undefined, environment);\n\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading id token\");\n this.storage.setAccount(accountEntity);\n this.storage.setIdTokenCredential(idTokenEntity);\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\n }\n }\n\n /**\n * Helper function to load access tokens to msal-browser cache\n * @param request\n * @param response\n * @param options\n * @param homeAccountId\n * @param environment\n * @param tenantId\n * @returns\n */\n private loadAccessToken(request: SilentRequest, response: ExternalTokenResponse, homeAccountId: string, environment: string, tenantId: string, options: LoadTokenOptions): void {\n\n if (!response.access_token) {\n this.logger.verbose(\"TokenCache - No access token provided for caching\");\n return;\n }\n\n if (!response.expires_in) {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please ensure server response includes expires_in value.\");\n }\n\n if (!options.extendedExpiresOn) {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Please provide an extendedExpiresOn value in the options.\");\n }\n\n const scopes = new ScopeSet(request.scopes).printScopes();\n const expiresOn = options.expiresOn || (response.expires_in + new Date().getTime() / 1000);\n const extendedExpiresOn = options.extendedExpiresOn;\n\n const accessTokenEntity = AccessTokenEntity.createAccessTokenEntity(homeAccountId, environment, response.access_token, this.config.auth.clientId, tenantId, scopes, expiresOn, extendedExpiresOn, this.cryptoObj);\n\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading access token\");\n this.storage.setAccessTokenCredential(accessTokenEntity);\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in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|
54
54
|
*/
|
|
55
55
|
azureCloudOptions?: AzureCloudOptions;
|
|
56
|
+
/**
|
|
57
|
+
* Flag of whether to use the local metadata cache
|
|
58
|
+
*/
|
|
59
|
+
skipAuthorityMetadataCache?: boolean;
|
|
56
60
|
};
|
|
57
61
|
/**
|
|
58
62
|
* Use this to configure the below cache configuration options:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.d.ts","sourceRoot":"","sources":["../../src/config/Configuration.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAqC,YAAY,EAAsD,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAEhO,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAIpE,eAAO,MAAM,wBAAwB,QAAQ,CAAC;AAC9C,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAC9C,eAAO,MAAM,2BAA2B,QAAQ,CAAC;AACjD,eAAO,MAAM,0CAA0C,OAAO,CAAC;AAE/D;;GAEG;AACH,oBAAY,kBAAkB,GAAG;IAC7B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACjC;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC;;OAEG;IACH,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC;;OAEG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,C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AC,EAAE,uBAAuB,CAAA;CACtC,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACnC,KAAK,EAAE,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC9B,MAAM,EAAE,QAAQ,CAAC,oBAAoB,CAAC,CAAC;IACvC,SAAS,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAA;CAC/C,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,EAAE,kBAAkB,EAAE,EAAE,aAAa,EAAE,oBAAoB,EAAE,OAAO,GAAG,oBAAoB,CAoE7M"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.27.0 2022-07-05 */
|
|
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';
|
|
@@ -42,6 +42,7 @@ function buildConfiguration(_a, isBrowserEnvironment) {
|
|
|
42
42
|
azureCloudInstance: AzureCloudInstance.None,
|
|
43
43
|
tenant: Constants.EMPTY_STRING
|
|
44
44
|
},
|
|
45
|
+
skipAuthorityMetadataCache: false,
|
|
45
46
|
};
|
|
46
47
|
// Default cache options for browser
|
|
47
48
|
var DEFAULT_CACHE_OPTIONS = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Configuration.js","sources":["../../src/config/Configuration.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SystemOptions, LoggerOptions, INetworkModule, DEFAULT_SYSTEM_OPTIONS, Constants, ProtocolMode, LogLevel, StubbedNetworkModule, AzureCloudInstance, AzureCloudOptions, ApplicationTelemetry } from \"@azure/msal-common\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { BrowserCacheLocation } from \"../utils/BrowserConstants\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { NavigationClient } from \"../navigation/NavigationClient\";\n\n// Default timeout for popup windows and iframes in milliseconds\nexport const DEFAULT_POPUP_TIMEOUT_MS = 60000;\nexport const DEFAULT_IFRAME_TIMEOUT_MS = 6000;\nexport const DEFAULT_REDIRECT_TIMEOUT_MS = 30000;\nexport const DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;\n\n/**\n * Use this to configure the auth options in the Configuration object\n */\nexport type BrowserAuthOptions = {\n /**\n * Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\n */\n clientId: string;\n /**\n * You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\n */\n authority?: string;\n /**\n * An array of URIs that are known to be valid. Used in B2C scenarios.\n */\n knownAuthorities?: Array<string>;\n /**\n * A string containing the cloud discovery response. Used in AAD scenarios.\n */\n cloudDiscoveryMetadata?: string;\n /**\n * A string containing the .well-known/openid-configuration endpoint response\n */\n authorityMetadata?: string;\n /**\n * The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.\n */\n redirectUri?: string;\n /**\n * The redirect URI where the window navigates after a successful logout.\n */\n postLogoutRedirectUri?: string | null;\n /**\n * Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.\n */\n navigateToLoginRequestUrl?: boolean;\n /**\n * Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.\n */\n clientCapabilities?: Array<string>;\n /**\n * Enum that represents the protocol that msal follows. Used for configuring proper endpoints.\n */\n protocolMode?: ProtocolMode;\n /**\n * Enum that represents the Azure Cloud to use.\n */\n azureCloudOptions?: AzureCloudOptions;\n};\n\n/**\n * Use this to configure the below cache configuration options:\n */\nexport type CacheOptions = {\n /**\n * Used to specify the cacheLocation user wants to set. Valid values are \"localStorage\" and \"sessionStorage\"\n */\n cacheLocation?: BrowserCacheLocation | string;\n /**\n * If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.\n */\n storeAuthStateInCookie?: boolean;\n /**\n * If set, MSAL sets the \"Secure\" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.\n */\n secureCookies?: boolean;\n};\n\nexport type BrowserSystemOptions = SystemOptions & {\n /**\n * Used to initialize the Logger object (See ClientConfiguration.ts)\n */\n loggerOptions?: LoggerOptions;\n /**\n * Network interface implementation\n */\n networkClient?: INetworkModule;\n /**\n * Override the methods used to navigate to other webpages. Particularly useful if you are using a client-side router\n */\n navigationClient?: INavigationClient;\n /**\n * Sets the timeout for waiting for a response hash in a popup. Will take precedence over loadFrameTimeout if both are set.\n */\n windowHashTimeout?: number;\n /**\n * Sets the timeout for waiting for a response hash in an iframe. Will take precedence over loadFrameTimeout if both are set.\n */\n iframeHashTimeout?: number;\n /**\n * Sets the timeout for waiting for a response hash in an iframe or popup\n */\n loadFrameTimeout?: number;\n /**\n * Maximum time the library should wait for a frame to load\n */\n navigateFrameWait?: number;\n /**\n * Time to wait for redirection to occur before resolving promise\n */\n redirectNavigationTimeout?: number;\n /**\n * Sets whether popups are opened asynchronously. By default, this flag is set to false. When set to false, blank popups are opened before anything else happens. When set to true, popups are opened when making the network request.\n */\n asyncPopups?: boolean;\n /**\n * Flag to enable redirect opertaions when the app is rendered in an iframe (to support scenarios such as embedded B2C login).\n */\n allowRedirectInIframe?: boolean;\n /**\n * Flag to enable native broker support (e.g. acquiring tokens from WAM on Windows)\n */\n allowNativeBroker?: boolean;\n /**\n * Sets the timeout for waiting for the native broker handshake to resolve\n */\n nativeBrokerHandshakeTimeout?: number;\n};\n\n/**\n * Telemetry Options\n */\nexport type BrowserTelemetryOptions = {\n /**\n * Telemetry information sent on request\n * - appName: Unique string name of an application\n * - appVersion: Version of the application using MSAL\n */\n application?: ApplicationTelemetry;\n};\n\n/**\n * This object allows you to configure important elements of MSAL functionality and is passed into the constructor of PublicClientApplication\n */\nexport type Configuration = {\n /**\n * This is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform\n */\n auth: BrowserAuthOptions,\n /**\n * This is where you configure cache location and whether to store cache in cookies\n */\n cache?: CacheOptions,\n /**\n * This is where you can configure the network client, logger, token renewal offset\n */\n system?: BrowserSystemOptions,\n /**\n * This is where you can configure telemetry data and options\n */\n telemetry?: BrowserTelemetryOptions\n};\n\nexport type BrowserConfiguration = {\n auth: Required<BrowserAuthOptions>,\n cache: Required<CacheOptions>,\n system: Required<BrowserSystemOptions>,\n telemetry: Required<BrowserTelemetryOptions>\n};\n\n/**\n * MSAL function that sets the default options when not explicitly configured from app developer\n *\n * @param auth\n * @param cache\n * @param system\n *\n * @returns Configuration object\n */\nexport function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem, telemetry: userInputTelemetry }: Configuration, isBrowserEnvironment: boolean): BrowserConfiguration {\n\n // Default auth options for browser\n const DEFAULT_AUTH_OPTIONS: Required<BrowserAuthOptions> = {\n clientId: Constants.EMPTY_STRING,\n authority: `${Constants.DEFAULT_AUTHORITY}`,\n knownAuthorities: [],\n cloudDiscoveryMetadata: Constants.EMPTY_STRING,\n authorityMetadata: Constants.EMPTY_STRING,\n redirectUri: Constants.EMPTY_STRING,\n postLogoutRedirectUri: Constants.EMPTY_STRING,\n navigateToLoginRequestUrl: true,\n clientCapabilities: [],\n protocolMode: ProtocolMode.AAD,\n azureCloudOptions: {\n azureCloudInstance: AzureCloudInstance.None,\n tenant: Constants.EMPTY_STRING\n },\n };\n\n // Default cache options for browser\n const DEFAULT_CACHE_OPTIONS: Required<CacheOptions> = {\n cacheLocation: BrowserCacheLocation.SessionStorage,\n storeAuthStateInCookie: false,\n secureCookies: false\n };\n\n // Default logger options for browser\n const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n loggerCallback: (): void => {},\n logLevel: LogLevel.Info,\n piiLoggingEnabled: false\n };\n\n // Default system options for browser\n const DEFAULT_BROWSER_SYSTEM_OPTIONS: Required<BrowserSystemOptions> = {\n ...DEFAULT_SYSTEM_OPTIONS,\n loggerOptions: DEFAULT_LOGGER_OPTIONS,\n networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule,\n navigationClient: new NavigationClient(),\n loadFrameTimeout: 0,\n // If loadFrameTimeout is provided, use that as default.\n windowHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_POPUP_TIMEOUT_MS,\n iframeHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_IFRAME_TIMEOUT_MS,\n navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0,\n redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,\n asyncPopups: false,\n allowRedirectInIframe: false,\n allowNativeBroker: false,\n nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS\n };\n\n const DEFAULT_TELEMETRY_OPTIONS: Required<BrowserTelemetryOptions> = {\n application: {\n appName: Constants.EMPTY_STRING,\n appVersion: Constants.EMPTY_STRING\n }\n };\n\n const overlayedConfig: BrowserConfiguration = {\n auth: { ...DEFAULT_AUTH_OPTIONS, ...userInputAuth },\n cache: { ...DEFAULT_CACHE_OPTIONS, ...userInputCache },\n system: { ...DEFAULT_BROWSER_SYSTEM_OPTIONS, ...userInputSystem },\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry }\n };\n return overlayedConfig;\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAWA;IACa,wBAAwB,GAAG,MAAM;IACjC,yBAAyB,GAAG,KAAK;I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B,KAAI,wBAAwB,EAChF,iBAAiB,EAAE,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,gBAAgB,KAAI,yBAAyB,EACjF,iBAAiB,EAAE,oBAAoB,IAAI,YAAY,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAAC,EAClF,yBAAyB,EAAE,2BAA2B,EACtD,WAAW,EAAE,KAAK,EAClB,qBAAqB,EAAE,KAAK,EAC5B,iBAAiB,EAAE,KAAK,EACxB,4BAA4B,EAAE,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,4BAA4B,KAAI,0CAA0C,GAC5H,CAAC;IAEF,IAAM,yBAAyB,GAAsC;QACjE,WAAW,EAAE;YACT,OAAO,EAAE,SAAS,CAAC,YAAY;YAC/B,UAAU,EAAE,SAAS,CAAC,YAAY;SACrC;KACJ,CAAC;IAEF,IAAM,eAAe,GAAyB;QAC1C,IAAI,wBAAO,oBAAoB,GAAK,aAAa,CAAE;QACnD,KAAK,wBAAO,qBAAqB,GAAK,cAAc,CAAE;QACtD,MAAM,wBAAO,8BAA8B,GAAK,eAAe,CAAE;QACjE,SAAS,wBAAO,yBAAyB,GAAK,kBAAkB,CAAE;KACrE,CAAC;IACF,OAAO,eAAe,CAAC;AAC3B;;;;"}
|
|
1
|
+
{"version":3,"file":"Configuration.js","sources":["../../src/config/Configuration.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SystemOptions, LoggerOptions, INetworkModule, DEFAULT_SYSTEM_OPTIONS, Constants, ProtocolMode, LogLevel, StubbedNetworkModule, AzureCloudInstance, AzureCloudOptions, ApplicationTelemetry } from \"@azure/msal-common\";\nimport { BrowserUtils } from \"../utils/BrowserUtils\";\nimport { BrowserCacheLocation } from \"../utils/BrowserConstants\";\nimport { INavigationClient } from \"../navigation/INavigationClient\";\nimport { NavigationClient } from \"../navigation/NavigationClient\";\n\n// Default timeout for popup windows and iframes in milliseconds\nexport const DEFAULT_POPUP_TIMEOUT_MS = 60000;\nexport const DEFAULT_IFRAME_TIMEOUT_MS = 6000;\nexport const DEFAULT_REDIRECT_TIMEOUT_MS = 30000;\nexport const DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS = 2000;\n\n/**\n * Use this to configure the auth options in the Configuration object\n */\nexport type BrowserAuthOptions = {\n /**\n * Client ID of your app registered with our Application registration portal : https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredAppsPreview in Microsoft Identity Platform\n */\n clientId: string;\n /**\n * You can configure a specific authority, defaults to \" \" or \"https://login.microsoftonline.com/common\"\n */\n authority?: string;\n /**\n * An array of URIs that are known to be valid. Used in B2C scenarios.\n */\n knownAuthorities?: Array<string>;\n /**\n * A string containing the cloud discovery response. Used in AAD scenarios.\n */\n cloudDiscoveryMetadata?: string;\n /**\n * A string containing the .well-known/openid-configuration endpoint response\n */\n authorityMetadata?: string;\n /**\n * The redirect URI where authentication responses can be received by your application. It must exactly match one of the redirect URIs registered in the Azure portal.\n */\n redirectUri?: string;\n /**\n * The redirect URI where the window navigates after a successful logout.\n */\n postLogoutRedirectUri?: string | null;\n /**\n * Boolean indicating whether to navigate to the original request URL after the auth server navigates to the redirect URL.\n */\n navigateToLoginRequestUrl?: boolean;\n /**\n * Array of capabilities which will be added to the claims.access_token.xms_cc request property on every network request.\n */\n clientCapabilities?: Array<string>;\n /**\n * Enum that represents the protocol that msal follows. Used for configuring proper endpoints.\n */\n protocolMode?: ProtocolMode;\n /**\n * Enum that represents the Azure Cloud to use.\n */\n azureCloudOptions?: AzureCloudOptions;\n /**\n * Flag of whether to use the local metadata cache\n */\n skipAuthorityMetadataCache?: boolean;\n};\n\n/**\n * Use this to configure the below cache configuration options:\n */\nexport type CacheOptions = {\n /**\n * Used to specify the cacheLocation user wants to set. Valid values are \"localStorage\" and \"sessionStorage\"\n */\n cacheLocation?: BrowserCacheLocation | string;\n /**\n * If set, MSAL stores the auth request state required for validation of the auth flows in the browser cookies. By default this flag is set to false.\n */\n storeAuthStateInCookie?: boolean;\n /**\n * If set, MSAL sets the \"Secure\" flag on cookies so they can only be sent over HTTPS. By default this flag is set to false.\n */\n secureCookies?: boolean;\n};\n\nexport type BrowserSystemOptions = SystemOptions & {\n /**\n * Used to initialize the Logger object (See ClientConfiguration.ts)\n */\n loggerOptions?: LoggerOptions;\n /**\n * Network interface implementation\n */\n networkClient?: INetworkModule;\n /**\n * Override the methods used to navigate to other webpages. Particularly useful if you are using a client-side router\n */\n navigationClient?: INavigationClient;\n /**\n * Sets the timeout for waiting for a response hash in a popup. Will take precedence over loadFrameTimeout if both are set.\n */\n windowHashTimeout?: number;\n /**\n * Sets the timeout for waiting for a response hash in an iframe. Will take precedence over loadFrameTimeout if both are set.\n */\n iframeHashTimeout?: number;\n /**\n * Sets the timeout for waiting for a response hash in an iframe or popup\n */\n loadFrameTimeout?: number;\n /**\n * Maximum time the library should wait for a frame to load\n */\n navigateFrameWait?: number;\n /**\n * Time to wait for redirection to occur before resolving promise\n */\n redirectNavigationTimeout?: number;\n /**\n * Sets whether popups are opened asynchronously. By default, this flag is set to false. When set to false, blank popups are opened before anything else happens. When set to true, popups are opened when making the network request.\n */\n asyncPopups?: boolean;\n /**\n * Flag to enable redirect opertaions when the app is rendered in an iframe (to support scenarios such as embedded B2C login).\n */\n allowRedirectInIframe?: boolean;\n /**\n * Flag to enable native broker support (e.g. acquiring tokens from WAM on Windows)\n */\n allowNativeBroker?: boolean;\n /**\n * Sets the timeout for waiting for the native broker handshake to resolve\n */\n nativeBrokerHandshakeTimeout?: number;\n};\n\n/**\n * Telemetry Options\n */\nexport type BrowserTelemetryOptions = {\n /**\n * Telemetry information sent on request\n * - appName: Unique string name of an application\n * - appVersion: Version of the application using MSAL\n */\n application?: ApplicationTelemetry;\n};\n\n/**\n * This object allows you to configure important elements of MSAL functionality and is passed into the constructor of PublicClientApplication\n */\nexport type Configuration = {\n /**\n * This is where you configure auth elements like clientID, authority used for authenticating against the Microsoft Identity Platform\n */\n auth: BrowserAuthOptions,\n /**\n * This is where you configure cache location and whether to store cache in cookies\n */\n cache?: CacheOptions,\n /**\n * This is where you can configure the network client, logger, token renewal offset\n */\n system?: BrowserSystemOptions,\n /**\n * This is where you can configure telemetry data and options\n */\n telemetry?: BrowserTelemetryOptions\n};\n\nexport type BrowserConfiguration = {\n auth: Required<BrowserAuthOptions>,\n cache: Required<CacheOptions>,\n system: Required<BrowserSystemOptions>,\n telemetry: Required<BrowserTelemetryOptions>\n};\n\n/**\n * MSAL function that sets the default options when not explicitly configured from app developer\n *\n * @param auth\n * @param cache\n * @param system\n *\n * @returns Configuration object\n */\nexport function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system: userInputSystem, telemetry: userInputTelemetry }: Configuration, isBrowserEnvironment: boolean): BrowserConfiguration {\n\n // Default auth options for browser\n const DEFAULT_AUTH_OPTIONS: Required<BrowserAuthOptions> = {\n clientId: Constants.EMPTY_STRING,\n authority: `${Constants.DEFAULT_AUTHORITY}`,\n knownAuthorities: [],\n cloudDiscoveryMetadata: Constants.EMPTY_STRING,\n authorityMetadata: Constants.EMPTY_STRING,\n redirectUri: Constants.EMPTY_STRING,\n postLogoutRedirectUri: Constants.EMPTY_STRING,\n navigateToLoginRequestUrl: true,\n clientCapabilities: [],\n protocolMode: ProtocolMode.AAD,\n azureCloudOptions: {\n azureCloudInstance: AzureCloudInstance.None,\n tenant: Constants.EMPTY_STRING\n },\n skipAuthorityMetadataCache: false,\n };\n\n // Default cache options for browser\n const DEFAULT_CACHE_OPTIONS: Required<CacheOptions> = {\n cacheLocation: BrowserCacheLocation.SessionStorage,\n storeAuthStateInCookie: false,\n secureCookies: false\n };\n\n // Default logger options for browser\n const DEFAULT_LOGGER_OPTIONS: LoggerOptions = {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n loggerCallback: (): void => {},\n logLevel: LogLevel.Info,\n piiLoggingEnabled: false\n };\n\n // Default system options for browser\n const DEFAULT_BROWSER_SYSTEM_OPTIONS: Required<BrowserSystemOptions> = {\n ...DEFAULT_SYSTEM_OPTIONS,\n loggerOptions: DEFAULT_LOGGER_OPTIONS,\n networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule,\n navigationClient: new NavigationClient(),\n loadFrameTimeout: 0,\n // If loadFrameTimeout is provided, use that as default.\n windowHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_POPUP_TIMEOUT_MS,\n iframeHashTimeout: userInputSystem?.loadFrameTimeout || DEFAULT_IFRAME_TIMEOUT_MS,\n navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0,\n redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS,\n asyncPopups: false,\n allowRedirectInIframe: false,\n allowNativeBroker: false,\n nativeBrokerHandshakeTimeout: userInputSystem?.nativeBrokerHandshakeTimeout || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS\n };\n\n const DEFAULT_TELEMETRY_OPTIONS: Required<BrowserTelemetryOptions> = {\n application: {\n appName: Constants.EMPTY_STRING,\n appVersion: Constants.EMPTY_STRING\n }\n };\n\n const overlayedConfig: BrowserConfiguration = {\n auth: { ...DEFAULT_AUTH_OPTIONS, ...userInputAuth },\n cache: { ...DEFAULT_CACHE_OPTIONS, ...userInputCache },\n system: { ...DEFAULT_BROWSER_SYSTEM_OPTIONS, ...userInputSystem },\n telemetry: { ...DEFAULT_TELEMETRY_OPTIONS, ...userInputTelemetry }\n };\n return overlayedConfig;\n}\n\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAWA;IACa,wBAAwB,GAAG,MAAM;IACjC,yBAAyB,GAAG,KAAK;IACjC,2BAA2B,GAAG,MAAM;IACpC,0CAA0C,GAAG,KAAK;AAsK/D;;;;;;;;;SASgB,kBAAkB,CAAC,EAAqH,EAAE,oBAA6B;QAA5I,aAAa,UAAA,EAAS,cAAc,WAAA,EAAU,eAAe,YAAA,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Y,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAAC,EAClF,yBAAyB,EAAE,2BAA2B,EACtD,WAAW,EAAE,KAAK,EAClB,qBAAqB,EAAE,KAAK,EAC5B,iBAAiB,EAAE,KAAK,EACxB,4BAA4B,EAAE,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,4BAA4B,KAAI,0CAA0C,GAC5H,CAAC;IAEF,IAAM,yBAAyB,GAAsC;QACjE,WAAW,EAAE;YACT,OAAO,EAAE,SAAS,CAAC,YAAY;YAC/B,UAAU,EAAE,SAAS,CAAC,YAAY;SACrC;KACJ,CAAC;IAEF,IAAM,eAAe,GAAyB;QAC1C,IAAI,wBAAO,oBAAoB,GAAK,aAAa,CAAE;QACnD,KAAK,wBAAO,qBAAqB,GAAK,cAAc,CAAE;QACtD,MAAM,wBAAO,8BAA8B,GAAK,eAAe,CAAE;QACjE,SAAS,wBAAO,yBAAyB,GAAK,kBAAkB,CAAE;KACrE,CAAC;IACF,OAAO,eAAe,CAAC;AAC3B;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoOps.d.ts","sourceRoot":"","sources":["../../src/crypto/CryptoOps.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,OAAO,EAAE,kBAAkB,
|
|
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,CAA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AAG,OAAO,CAAC,MAAM,CAAC;IA4C/F;;;OAGG;IACG,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAKvD"}
|
package/dist/crypto/CryptoOps.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.27.0 2022-07-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __awaiter, __generator } from '../_virtual/_tslib.js';
|
|
4
|
-
import { PerformanceEvents } from '@azure/msal-common';
|
|
4
|
+
import { PerformanceEvents, JoseHeader } from '@azure/msal-common';
|
|
5
5
|
import { GuidGenerator } from './GuidGenerator.js';
|
|
6
6
|
import { Base64Encode } from '../encode/Base64Encode.js';
|
|
7
7
|
import { Base64Decode } from '../encode/Base64Decode.js';
|
|
8
8
|
import { PkceGenerator } from './PkceGenerator.js';
|
|
9
9
|
import { BrowserCrypto } from './BrowserCrypto.js';
|
|
10
10
|
import { BrowserStringUtils } from '../utils/BrowserStringUtils.js';
|
|
11
|
-
import { KEY_FORMAT_JWK } from '../utils/BrowserConstants.js';
|
|
12
11
|
import { BrowserAuthError } from '../error/BrowserAuthError.js';
|
|
13
12
|
import { AsyncMemoryStorage } from '../cache/AsyncMemoryStorage.js';
|
|
14
13
|
|
|
@@ -187,7 +186,7 @@ var CryptoOps = /** @class */ (function () {
|
|
|
187
186
|
CryptoOps.prototype.signJwt = function (payload, kid, correlationId) {
|
|
188
187
|
var _a;
|
|
189
188
|
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
-
var signJwtMeasurement, cachedKeyPair, publicKeyJwk, publicKeyJwkString,
|
|
189
|
+
var signJwtMeasurement, cachedKeyPair, publicKeyJwk, publicKeyJwkString, encodedKeyIdThumbprint, shrHeader, encodedShrHeader, encodedPayload, tokenString, tokenBuffer, signatureBuffer, encodedSignature, signedJwt;
|
|
191
190
|
return __generator(this, function (_b) {
|
|
192
191
|
switch (_b.label) {
|
|
193
192
|
case 0:
|
|
@@ -202,17 +201,15 @@ var CryptoOps = /** @class */ (function () {
|
|
|
202
201
|
case 2:
|
|
203
202
|
publicKeyJwk = _b.sent();
|
|
204
203
|
publicKeyJwkString = BrowserCrypto.getJwkString(publicKeyJwk);
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
};
|
|
209
|
-
encodedHeader = this.b64Encode.urlEncode(JSON.stringify(header));
|
|
204
|
+
encodedKeyIdThumbprint = this.b64Encode.urlEncode(JSON.stringify({ kid: kid }));
|
|
205
|
+
shrHeader = JoseHeader.getShrHeaderString({ kid: encodedKeyIdThumbprint, alg: publicKeyJwk.alg });
|
|
206
|
+
encodedShrHeader = this.b64Encode.urlEncode(shrHeader);
|
|
210
207
|
// Generate payload
|
|
211
208
|
payload.cnf = {
|
|
212
209
|
jwk: JSON.parse(publicKeyJwkString)
|
|
213
210
|
};
|
|
214
211
|
encodedPayload = this.b64Encode.urlEncode(JSON.stringify(payload));
|
|
215
|
-
tokenString =
|
|
212
|
+
tokenString = encodedShrHeader + "." + encodedPayload;
|
|
216
213
|
tokenBuffer = BrowserStringUtils.stringToArrayBuffer(tokenString);
|
|
217
214
|
return [4 /*yield*/, this.browserCrypto.sign(cachedKeyPair.privateKey, tokenBuffer)];
|
|
218
215
|
case 3:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoOps.js","sources":["../../src/crypto/CryptoOps.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICrypto, IPerformanceClient, Logger, PerformanceEvents, PkceCodes, SignedHttpRequest, SignedHttpRequestParameters } from \"@azure/msal-common\";\nimport { GuidGenerator } from \"./GuidGenerator\";\nimport { Base64Encode } from \"../encode/Base64Encode\";\nimport { Base64Decode } from \"../encode/Base64Decode\";\nimport { PkceGenerator } from \"./PkceGenerator\";\nimport { BrowserCrypto } from \"./BrowserCrypto\";\nimport { BrowserStringUtils } from \"../utils/BrowserStringUtils\";\nimport { KEY_FORMAT_JWK } from \"../utils/BrowserConstants\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { AsyncMemoryStorage } from \"../cache/AsyncMemoryStorage\";\n\nexport type CachedKeyPair = {\n publicKey: CryptoKey,\n privateKey: CryptoKey,\n requestMethod?: string,\n requestUri?: string\n};\n\n/**\n * MSAL CryptoKeyStore DB Version 2\n */\nexport type CryptoKeyStore = {\n asymmetricKeys: AsyncMemoryStorage<CachedKeyPair>;\n symmetricKeys: AsyncMemoryStorage<CryptoKey>;\n};\n\nexport enum CryptoKeyStoreNames {\n asymmetricKeys = \"asymmetricKeys\",\n symmetricKeys = \"symmetricKeys\"\n}\n\n/**\n * This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and \n * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).\n */\nexport class CryptoOps implements ICrypto {\n\n private browserCrypto: BrowserCrypto;\n private guidGenerator: GuidGenerator;\n private b64Encode: Base64Encode;\n private b64Decode: Base64Decode;\n private pkceGenerator: PkceGenerator;\n private logger: Logger;\n\n /**\n * CryptoOps can be used in contexts outside a PCA instance,\n * meaning there won't be a performance manager available.\n */\n private performanceClient: IPerformanceClient | undefined;\n\n private static POP_KEY_USAGES: Array<KeyUsage> = [\"sign\", \"verify\"];\n private static EXTRACTABLE: boolean = true;\n private cache: CryptoKeyStore;\n\n constructor(logger: Logger, performanceClient?: IPerformanceClient) {\n this.logger = logger;\n // Browser crypto needs to be validated first before any other classes can be set.\n this.browserCrypto = new BrowserCrypto(this.logger);\n this.b64Encode = new Base64Encode();\n this.b64Decode = new Base64Decode();\n this.guidGenerator = new GuidGenerator(this.browserCrypto);\n this.pkceGenerator = new PkceGenerator(this.browserCrypto);\n this.cache = {\n asymmetricKeys: new AsyncMemoryStorage<CachedKeyPair>(this.logger, CryptoKeyStoreNames.asymmetricKeys),\n symmetricKeys: new AsyncMemoryStorage<CryptoKey>(this.logger, CryptoKeyStoreNames.symmetricKeys)\n };\n this.performanceClient = performanceClient;\n }\n\n /**\n * Creates a new random GUID - used to populate state and nonce.\n * @returns string (GUID)\n */\n createNewGuid(): string {\n return this.guidGenerator.generateGuid();\n }\n\n /**\n * Encodes input string to base64.\n * @param input \n */\n base64Encode(input: string): string {\n return this.b64Encode.encode(input);\n } \n \n /**\n * Decodes input string from base64.\n * @param input \n */\n base64Decode(input: string): string {\n return this.b64Decode.decode(input);\n }\n\n /**\n * Generates PKCE codes used in Authorization Code Flow.\n */\n async generatePkceCodes(): Promise<PkceCodes> {\n return this.pkceGenerator.generateCodes();\n }\n\n /**\n * Generates a keypair, stores it and returns a thumbprint\n * @param request\n */\n async getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise<string> {\n const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);\n\n // Generate Keypair\n const keyPair: CryptoKeyPair = await this.browserCrypto.generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES);\n\n // Generate Thumbprint for Public Key\n const publicKeyJwk: JsonWebKey = await this.browserCrypto.exportJwk(keyPair.publicKey);\n \n const pubKeyThumprintObj: JsonWebKey = {\n e: publicKeyJwk.e,\n kty: publicKeyJwk.kty,\n n: publicKeyJwk.n\n };\n\n const publicJwkString: string = BrowserCrypto.getJwkString(pubKeyThumprintObj);\n const publicJwkHash = await this.hashString(publicJwkString);\n\n // Generate Thumbprint for Private Key\n const privateKeyJwk: JsonWebKey = await this.browserCrypto.exportJwk(keyPair.privateKey);\n // Re-import private key to make it unextractable\n const unextractablePrivateKey: CryptoKey = await this.browserCrypto.importJwk(privateKeyJwk, false, [\"sign\"]);\n\n // Store Keypair data in keystore\n await this.cache.asymmetricKeys.setItem(\n publicJwkHash, \n {\n privateKey: unextractablePrivateKey,\n publicKey: keyPair.publicKey,\n requestMethod: request.resourceRequestMethod,\n requestUri: request.resourceRequestUri\n }\n );\n\n if (publicKeyThumbMeasurement) {\n publicKeyThumbMeasurement.endMeasurement({\n success: true\n });\n }\n\n return publicJwkHash;\n }\n\n /**\n * Removes cryptographic keypair from key store matching the keyId passed in\n * @param kid \n */\n async removeTokenBindingKey(kid: string): Promise<boolean> {\n await this.cache.asymmetricKeys.removeItem(kid);\n const keyFound = await this.cache.asymmetricKeys.containsKey(kid);\n return !keyFound;\n }\n\n /**\n * Removes all cryptographic keys from IndexedDB storage\n */\n async clearKeystore(): Promise<boolean> {\n try {\n this.logger.verbose(\"Deleting in-memory and persistent asymmetric key stores\");\n await this.cache.asymmetricKeys.clear();\n this.logger.verbose(\"Successfully deleted asymmetric key stores\");\n this.logger.verbose(\"Deleting in-memory and persistent symmetric key stores\");\n await this.cache.symmetricKeys.clear();\n this.logger.verbose(\"Successfully deleted symmetric key stores\");\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 /**\n * Signs the given object as a jwt payload with private key retrieved by given kid.\n * @param payload \n * @param kid \n */\n async signJwt(payload: SignedHttpRequest, kid: string, correlationId?: string): Promise<string> {\n const signJwtMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsSignJwt, correlationId);\n const cachedKeyPair = await this.cache.asymmetricKeys.getItem(kid);\n \n if (!cachedKeyPair) {\n throw BrowserAuthError.createSigningKeyNotFoundInStorageError(kid);\n }\n\n // Get public key as JWK\n const publicKeyJwk = await this.browserCrypto.exportJwk(cachedKeyPair.publicKey);\n const publicKeyJwkString = BrowserCrypto.getJwkString(publicKeyJwk);\n\n // Generate header\n const header = {\n alg: publicKeyJwk.alg,\n type: KEY_FORMAT_JWK\n };\n const encodedHeader = this.b64Encode.urlEncode(JSON.stringify(header));\n\n // Generate payload\n payload.cnf = {\n jwk: JSON.parse(publicKeyJwkString)\n };\n const encodedPayload = this.b64Encode.urlEncode(JSON.stringify(payload));\n\n // Form token string\n const tokenString = `${encodedHeader}.${encodedPayload}`;\n\n // Sign token\n const tokenBuffer = BrowserStringUtils.stringToArrayBuffer(tokenString);\n const signatureBuffer = await this.browserCrypto.sign(cachedKeyPair.privateKey, tokenBuffer);\n const encodedSignature = this.b64Encode.urlEncodeArr(new Uint8Array(signatureBuffer));\n\n const signedJwt = `${tokenString}.${encodedSignature}`;\n\n if (signJwtMeasurement) {\n signJwtMeasurement.endMeasurement({\n success: true\n });\n }\n\n return signedJwt;\n }\n\n /**\n * Returns the SHA-256 hash of an input string\n * @param plainText\n */\n async hashString(plainText: string): Promise<string> {\n const hashBuffer: ArrayBuffer = await this.browserCrypto.sha256Digest(plainText);\n const hashBytes = new Uint8Array(hashBuffer);\n return this.b64Encode.urlEncodeArr(hashBytes);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;IA+BY;AAAZ,WAAY,mBAAmB;IAC3B,wDAAiC,CAAA;IACjC,sDAA+B,CAAA;AACnC,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B;AAED;;;;;IAuBI,mBAAY,MAAc,EAAE,iBAAsC;QAC9D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;;QAErB,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpD,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAE,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,IAAI,YAAY,EAAE,CAAC;QACpC,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3D,IAAI,CAAC,aAAa,GAAG,IAAI,aAAa,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC3D,IAAI,CAAC,KAAK,GAAG;YACT,cAAc,EAAE,IAAI,kBAAkB,CAAgB,IAAI,CA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,"file":"CryptoOps.js","sources":["../../src/crypto/CryptoOps.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ICrypto, IPerformanceClient, JoseHeader, Logger, PerformanceEvents, PkceCodes, SignedHttpRequest, SignedHttpRequestParameters } from \"@azure/msal-common\";\nimport { GuidGenerator } from \"./GuidGenerator\";\nimport { Base64Encode } from \"../encode/Base64Encode\";\nimport { Base64Decode } from \"../encode/Base64Decode\";\nimport { PkceGenerator } from \"./PkceGenerator\";\nimport { BrowserCrypto } from \"./BrowserCrypto\";\nimport { BrowserStringUtils } from \"../utils/BrowserStringUtils\";\nimport { BrowserAuthError } from \"../error/BrowserAuthError\";\nimport { AsyncMemoryStorage } from \"../cache/AsyncMemoryStorage\";\n\nexport type CachedKeyPair = {\n publicKey: CryptoKey,\n privateKey: CryptoKey,\n requestMethod?: string,\n requestUri?: string\n};\n\n/**\n * MSAL CryptoKeyStore DB Version 2\n */\nexport type CryptoKeyStore = {\n asymmetricKeys: AsyncMemoryStorage<CachedKeyPair>;\n symmetricKeys: AsyncMemoryStorage<CryptoKey>;\n};\n\nexport enum CryptoKeyStoreNames {\n asymmetricKeys = \"asymmetricKeys\",\n symmetricKeys = \"symmetricKeys\"\n}\n\n/**\n * This class implements MSAL's crypto interface, which allows it to perform base64 encoding and decoding, generating cryptographically random GUIDs and \n * implementing Proof Key for Code Exchange specs for the OAuth Authorization Code Flow using PKCE (rfc here: https://tools.ietf.org/html/rfc7636).\n */\nexport class CryptoOps implements ICrypto {\n\n private browserCrypto: BrowserCrypto;\n private guidGenerator: GuidGenerator;\n private b64Encode: Base64Encode;\n private b64Decode: Base64Decode;\n private pkceGenerator: PkceGenerator;\n private logger: Logger;\n\n /**\n * CryptoOps can be used in contexts outside a PCA instance,\n * meaning there won't be a performance manager available.\n */\n private performanceClient: IPerformanceClient | undefined;\n\n private static POP_KEY_USAGES: Array<KeyUsage> = [\"sign\", \"verify\"];\n private static EXTRACTABLE: boolean = true;\n private cache: CryptoKeyStore;\n\n constructor(logger: Logger, performanceClient?: IPerformanceClient) {\n this.logger = logger;\n // Browser crypto needs to be validated first before any other classes can be set.\n this.browserCrypto = new BrowserCrypto(this.logger);\n this.b64Encode = new Base64Encode();\n this.b64Decode = new Base64Decode();\n this.guidGenerator = new GuidGenerator(this.browserCrypto);\n this.pkceGenerator = new PkceGenerator(this.browserCrypto);\n this.cache = {\n asymmetricKeys: new AsyncMemoryStorage<CachedKeyPair>(this.logger, CryptoKeyStoreNames.asymmetricKeys),\n symmetricKeys: new AsyncMemoryStorage<CryptoKey>(this.logger, CryptoKeyStoreNames.symmetricKeys)\n };\n this.performanceClient = performanceClient;\n }\n\n /**\n * Creates a new random GUID - used to populate state and nonce.\n * @returns string (GUID)\n */\n createNewGuid(): string {\n return this.guidGenerator.generateGuid();\n }\n\n /**\n * Encodes input string to base64.\n * @param input \n */\n base64Encode(input: string): string {\n return this.b64Encode.encode(input);\n } \n \n /**\n * Decodes input string from base64.\n * @param input \n */\n base64Decode(input: string): string {\n return this.b64Decode.decode(input);\n }\n\n /**\n * Generates PKCE codes used in Authorization Code Flow.\n */\n async generatePkceCodes(): Promise<PkceCodes> {\n return this.pkceGenerator.generateCodes();\n }\n\n /**\n * Generates a keypair, stores it and returns a thumbprint\n * @param request\n */\n async getPublicKeyThumbprint(request: SignedHttpRequestParameters): Promise<string> {\n const publicKeyThumbMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsGetPublicKeyThumbprint, request.correlationId);\n\n // Generate Keypair\n const keyPair: CryptoKeyPair = await this.browserCrypto.generateKeyPair(CryptoOps.EXTRACTABLE, CryptoOps.POP_KEY_USAGES);\n\n // Generate Thumbprint for Public Key\n const publicKeyJwk: JsonWebKey = await this.browserCrypto.exportJwk(keyPair.publicKey);\n \n const pubKeyThumprintObj: JsonWebKey = {\n e: publicKeyJwk.e,\n kty: publicKeyJwk.kty,\n n: publicKeyJwk.n\n };\n\n const publicJwkString: string = BrowserCrypto.getJwkString(pubKeyThumprintObj);\n const publicJwkHash = await this.hashString(publicJwkString);\n\n // Generate Thumbprint for Private Key\n const privateKeyJwk: JsonWebKey = await this.browserCrypto.exportJwk(keyPair.privateKey);\n // Re-import private key to make it unextractable\n const unextractablePrivateKey: CryptoKey = await this.browserCrypto.importJwk(privateKeyJwk, false, [\"sign\"]);\n\n // Store Keypair data in keystore\n await this.cache.asymmetricKeys.setItem(\n publicJwkHash, \n {\n privateKey: unextractablePrivateKey,\n publicKey: keyPair.publicKey,\n requestMethod: request.resourceRequestMethod,\n requestUri: request.resourceRequestUri\n }\n );\n\n if (publicKeyThumbMeasurement) {\n publicKeyThumbMeasurement.endMeasurement({\n success: true\n });\n }\n\n return publicJwkHash;\n }\n\n /**\n * Removes cryptographic keypair from key store matching the keyId passed in\n * @param kid \n */\n async removeTokenBindingKey(kid: string): Promise<boolean> {\n await this.cache.asymmetricKeys.removeItem(kid);\n const keyFound = await this.cache.asymmetricKeys.containsKey(kid);\n return !keyFound;\n }\n\n /**\n * Removes all cryptographic keys from IndexedDB storage\n */\n async clearKeystore(): Promise<boolean> {\n try {\n this.logger.verbose(\"Deleting in-memory and persistent asymmetric key stores\");\n await this.cache.asymmetricKeys.clear();\n this.logger.verbose(\"Successfully deleted asymmetric key stores\");\n this.logger.verbose(\"Deleting in-memory and persistent symmetric key stores\");\n await this.cache.symmetricKeys.clear();\n this.logger.verbose(\"Successfully deleted symmetric key stores\");\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 /**\n * Signs the given object as a jwt payload with private key retrieved by given kid.\n * @param payload \n * @param kid \n */\n async signJwt(payload: SignedHttpRequest, kid: string, correlationId?: string): Promise<string> {\n const signJwtMeasurement = this.performanceClient?.startMeasurement(PerformanceEvents.CryptoOptsSignJwt, correlationId);\n const cachedKeyPair = await this.cache.asymmetricKeys.getItem(kid);\n \n if (!cachedKeyPair) {\n throw BrowserAuthError.createSigningKeyNotFoundInStorageError(kid);\n }\n\n // Get public key as JWK\n const publicKeyJwk = await this.browserCrypto.exportJwk(cachedKeyPair.publicKey);\n const publicKeyJwkString = BrowserCrypto.getJwkString(publicKeyJwk);\n \n // Base64URL encode public key thumbprint with keyId only: BASE64URL({ kid: \"FULL_PUBLIC_KEY_HASH\" })\n const encodedKeyIdThumbprint = this.b64Encode.urlEncode(JSON.stringify({ kid: kid }));\n\n // Generate header\n const shrHeader = JoseHeader.getShrHeaderString({ kid: encodedKeyIdThumbprint, alg: publicKeyJwk.alg });\n const encodedShrHeader = this.b64Encode.urlEncode(shrHeader);\n\n // Generate payload\n payload.cnf = {\n jwk: JSON.parse(publicKeyJwkString)\n };\n const encodedPayload = this.b64Encode.urlEncode(JSON.stringify(payload));\n\n // Form token string\n const tokenString = `${encodedShrHeader}.${encodedPayload}`;\n\n // Sign token\n const tokenBuffer = BrowserStringUtils.stringToArrayBuffer(tokenString);\n const signatureBuffer = await this.browserCrypto.sign(cachedKeyPair.privateKey, tokenBuffer);\n const encodedSignature = this.b64Encode.urlEncodeArr(new Uint8Array(signatureBuffer));\n\n const signedJwt = `${tokenString}.${encodedSignature}`;\n\n if (signJwtMeasurement) {\n signJwtMeasurement.endMeasurement({\n success: true\n });\n }\n\n return signedJwt;\n }\n\n /**\n * Returns the SHA-256 hash of an input string\n * @param plainText\n */\n async hashString(plainText: string): Promise<string> {\n const hashBuffer: ArrayBuffer = await this.browserCrypto.sha256Digest(plainText);\n const hashBytes = new Uint8Array(hashBuffer);\n return this.b64Encode.urlEncodeArr(hashBytes);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAAA;;;;IA8BY;AAAZ,WAAY,mBAAmB;IAC3B,wDAAiC,CAAA;IACjC,sDAA+B,CAAA;AACnC,CAAC,EAHW,mBAAmB,KAAnB,mBAAmB,QAG9B;AAED;;;;;IAuBI,mBAAY,MAA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AC,CAAC;wBAEhF,SAAS,GAAM,WAAW,SAAI,gBAAkB,CAAC;wBAEvD,IAAI,kBAAkB,EAAE;4BACpB,kBAAkB,CAAC,cAAc,CAAC;gCAC9B,OAAO,EAAE,IAAI;6BAChB,CAAC,CAAC;yBACN;wBAED,sBAAO,SAAS,EAAC;;;;KACpB;;;;;IAMK,8BAAU,GAAhB,UAAiB,SAAiB;;;;;4BACE,qBAAM,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC,EAAA;;wBAA1E,UAAU,GAAgB,SAAgD;wBAC1E,SAAS,GAAG,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC;wBAC7C,sBAAO,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,SAAS,CAAC,EAAC;;;;KACjD;IA3Lc,wBAAc,GAAoB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACrD,qBAAW,GAAY,IAAI,CAAC;IA2L/C,gBAAC;CA3MD;;;;"}
|
|
@@ -252,7 +252,7 @@ export declare class BrowserAuthError extends AuthError {
|
|
|
252
252
|
*/
|
|
253
253
|
static createMonitorIframeTimeoutError(): BrowserAuthError;
|
|
254
254
|
/**
|
|
255
|
-
* Creates an error thrown when navigateWindow is called inside an iframe.
|
|
255
|
+
* Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.
|
|
256
256
|
* @param windowParentCheck
|
|
257
257
|
*/
|
|
258
258
|
static createRedirectInIframeError(windowParentCheck: boolean): BrowserAuthError;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.27.0 2022-07-05 */
|
|
2
2
|
'use strict';
|
|
3
3
|
import { __extends } from '../_virtual/_tslib.js';
|
|
4
4
|
import { StringUtils, AuthError } from '@azure/msal-common';
|
|
@@ -29,7 +29,7 @@ var BrowserAuthErrorMessage = {
|
|
|
29
29
|
},
|
|
30
30
|
hashEmptyError: {
|
|
31
31
|
code: "hash_empty_error",
|
|
32
|
-
desc: "Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash."
|
|
32
|
+
desc: "Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors."
|
|
33
33
|
},
|
|
34
34
|
hashDoesNotContainStateError: {
|
|
35
35
|
code: "no_state_in_hash",
|
|
@@ -37,7 +37,7 @@ var BrowserAuthErrorMessage = {
|
|
|
37
37
|
},
|
|
38
38
|
hashDoesNotContainKnownPropertiesError: {
|
|
39
39
|
code: "hash_does_not_contain_known_properties",
|
|
40
|
-
desc: "Hash does not contain known properites. Please verify that your redirectUri is not changing the hash."
|
|
40
|
+
desc: "Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors."
|
|
41
41
|
},
|
|
42
42
|
unableToParseStateError: {
|
|
43
43
|
code: "unable_to_parse_state",
|
|
@@ -73,7 +73,7 @@ var BrowserAuthErrorMessage = {
|
|
|
73
73
|
},
|
|
74
74
|
redirectInIframeError: {
|
|
75
75
|
code: "redirect_in_iframe",
|
|
76
|
-
desc: "
|
|
76
|
+
desc: "Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs."
|
|
77
77
|
},
|
|
78
78
|
blockTokenRequestsInHiddenIframeError: {
|
|
79
79
|
code: "block_iframe_reload",
|
|
@@ -298,7 +298,7 @@ var BrowserAuthError = /** @class */ (function (_super) {
|
|
|
298
298
|
return new BrowserAuthError(BrowserAuthErrorMessage.monitorIframeTimeoutError.code, BrowserAuthErrorMessage.monitorIframeTimeoutError.desc);
|
|
299
299
|
};
|
|
300
300
|
/**
|
|
301
|
-
* Creates an error thrown when navigateWindow is called inside an iframe.
|
|
301
|
+
* Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.
|
|
302
302
|
* @param windowParentCheck
|
|
303
303
|
*/
|
|
304
304
|
BrowserAuthError.createRedirectInIframeError = function (windowParentCheck) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BrowserAuthError.js","sources":["../../src/error/BrowserAuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError, StringUtils } from \"@azure/msal-common\";\n\n/**\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const BrowserAuthErrorMessage = {\n pkceNotGenerated: {\n code: \"pkce_not_created\",\n desc: \"The PKCE code challenge and verifier could not be generated.\"\n },\n cryptoDoesNotExist: {\n code: \"crypto_nonexistent\",\n desc: \"The crypto object or function is not available.\"\n },\n httpMethodNotImplementedError: {\n code: \"http_method_not_implemented\",\n desc: \"The HTTP method given has not been implemented in this library.\"\n },\n emptyNavigateUriError: {\n code: \"empty_navigate_uri\",\n desc: \"Navigation URI is empty. Please check stack trace for more info.\"\n },\n hashEmptyError: {\n code: \"hash_empty_error\",\n desc: \"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash.\"\n },\n hashDoesNotContainStateError: {\n code: \"no_state_in_hash\",\n desc: \"Hash does not contain state. Please verify that the request originated from msal.\"\n },\n hashDoesNotContainKnownPropertiesError: {\n code: \"hash_does_not_contain_known_properties\",\n desc: \"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash.\"\n },\n unableToParseStateError: {\n code: \"unable_to_parse_state\",\n desc: \"Unable to parse state. Please verify that the request originated from msal.\"\n },\n stateInteractionTypeMismatchError: {\n code: \"state_interaction_type_mismatch\",\n desc: \"Hash contains state but the interaction type does not match the caller.\"\n },\n interactionInProgress: {\n code: \"interaction_in_progress\",\n desc: \"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n popupWindowError: {\n code: \"popup_window_error\",\n desc: \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"\n },\n emptyWindowError: {\n code: \"empty_window_error\",\n desc: \"window.open returned null or undefined window object.\"\n },\n userCancelledError: {\n code: \"user_cancelled\",\n desc: \"User cancelled the flow.\"\n },\n monitorPopupTimeoutError: {\n code: \"monitor_window_timeout\",\n desc: \"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n monitorIframeTimeoutError: {\n code: \"monitor_window_timeout\",\n desc: \"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n redirectInIframeError: {\n code: \"redirect_in_iframe\",\n desc: \"Code flow is not supported inside an iframe. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.\"\n },\n blockTokenRequestsInHiddenIframeError: {\n code: \"block_iframe_reload\",\n desc: \"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors\"\n },\n blockAcquireTokenInPopupsError: {\n code: \"block_nested_popups\",\n desc: \"Request was blocked inside a popup because MSAL detected it was running in a popup.\"\n },\n iframeClosedPrematurelyError: {\n code: \"iframe_closed_prematurely\",\n desc: \"The iframe being monitored was closed prematurely.\"\n },\n silentLogoutUnsupportedError: {\n code: \"silent_logout_unsupported\",\n desc: \"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.\"\n },\n noAccountError: {\n code: \"no_account_error\",\n desc: \"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.\"\n },\n silentPromptValueError: {\n code: \"silent_prompt_value_error\",\n desc: \"The value given for the prompt value is not valid for silent requests - must be set to 'none'.\"\n },\n noTokenRequestCacheError: {\n code: \"no_token_request_cache_error\",\n desc: \"No token request found in cache.\"\n },\n unableToParseTokenRequestCacheError: {\n code: \"unable_to_parse_token_request_cache_error\",\n desc: \"The cached token request could not be parsed.\"\n },\n noCachedAuthorityError: {\n code: \"no_cached_authority_error\",\n desc: \"No cached authority found.\"\n },\n authRequestNotSet: {\n code: \"auth_request_not_set_error\",\n desc: \"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler\"\n },\n invalidCacheType: {\n code: \"invalid_cache_type\",\n desc: \"Invalid cache type\"\n },\n notInBrowserEnvironment: {\n code: \"non_browser_environment\",\n desc: \"Login and token requests are not supported in non-browser environments.\"\n },\n databaseNotOpen: {\n code: \"database_not_open\",\n desc: \"Database is not open!\"\n },\n noNetworkConnectivity: {\n code: \"no_network_connectivity\",\n desc: \"No network connectivity. Check your internet connection.\"\n },\n postRequestFailed: {\n code: \"post_request_failed\",\n desc: \"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'\"\n },\n getRequestFailed: {\n code: \"get_request_failed\",\n desc: \"Network request failed. Please check the network trace to determine root cause.\"\n },\n failedToParseNetworkResponse: {\n code: \"failed_to_parse_response\",\n desc: \"Failed to parse network response. Check network trace.\"\n },\n unableToLoadTokenError: {\n code: \"unable_to_load_token\",\n desc: \"Error loading token to cache.\"\n },\n signingKeyNotFoundInStorage: {\n code: \"crypto_key_not_found\",\n desc: \"Cryptographic Key or Keypair not found in browser storage.\"\n },\n authCodeRequired: {\n code: \"auth_code_required\",\n desc: \"An authorization code must be provided (as the `code` property on the request) to this flow.\"\n },\n authCodeOrNativeAccountRequired: {\n code: \"auth_code_or_nativeAccountId_required\",\n desc: \"An authorization code or nativeAccountId must be provided to this flow.\"\n },\n databaseUnavailable: {\n code: \"database_unavailable\",\n desc: \"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.\"\n },\n unableToAcquireTokenFromNativePlatform: {\n code: \"unable_to_acquire_token_from_native_platform\",\n desc: \"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors.\"\n },\n nativeHandshakeTimeout: {\n code: \"native_handshake_timeout\",\n desc: \"Timed out while attempting to establish connection to browser extension\"\n },\n nativeExtensionNotInstalled: {\n code: \"native_extension_not_installed\",\n desc: \"Native extension is not installed. If you think this is a mistake call the initialize function.\"\n },\n nativeConnectionNotEstablished: {\n code: \"native_connection_not_established\",\n desc: \"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors.\"\n },\n nativeBrokerCalledBeforeInitialize: {\n code: \"native_broker_called_before_initialize\",\n desc: \"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors.\"\n },\n nativePromptNotSupported: {\n code: \"native_prompt_not_supported\",\n desc: \"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.\"\n }\n};\n\n/**\n * Browser library error class thrown by the MSAL.js library for SPAs\n */\nexport class BrowserAuthError extends AuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n\n Object.setPrototypeOf(this, BrowserAuthError.prototype);\n this.name = \"BrowserAuthError\";\n }\n\n /**\n * Creates an error thrown when PKCE is not implemented.\n * @param errDetail\n */\n static createPkceNotGeneratedError(errDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.pkceNotGenerated.code,\n `${BrowserAuthErrorMessage.pkceNotGenerated.desc} Detail:${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the crypto object is unavailable.\n * @param errDetail\n */\n static createCryptoNotAvailableError(errDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.cryptoDoesNotExist.code,\n `${BrowserAuthErrorMessage.cryptoDoesNotExist.desc} Detail:${errDetail}`);\n }\n\n /**\n * Creates an error thrown when an HTTP method hasn't been implemented by the browser class.\n * @param method\n */\n static createHttpMethodNotImplementedError(method: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.httpMethodNotImplementedError.code,\n `${BrowserAuthErrorMessage.httpMethodNotImplementedError.desc} Given Method: ${method}`);\n }\n\n /**\n * Creates an error thrown when the navigation URI is empty.\n */\n static createEmptyNavigationUriError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.emptyNavigateUriError.code, BrowserAuthErrorMessage.emptyNavigateUriError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n * @param hashValue\n */\n static createEmptyHashError(hashValue: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashEmptyError.code, `${BrowserAuthErrorMessage.hashEmptyError.desc} Given Url: ${hashValue}`);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n */\n static createHashDoesNotContainStateError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainStateError.code, BrowserAuthErrorMessage.hashDoesNotContainStateError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value does not contain known properties\n */\n static createHashDoesNotContainKnownPropertiesError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.code, BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n */\n static createUnableToParseStateError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseStateError.code, BrowserAuthErrorMessage.unableToParseStateError.desc);\n }\n\n /**\n * Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.\n */\n static createStateInteractionTypeMismatchError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.stateInteractionTypeMismatchError.code, BrowserAuthErrorMessage.stateInteractionTypeMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when a browser interaction (redirect or popup) is in progress.\n */\n static createInteractionInProgressError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.interactionInProgress.code, BrowserAuthErrorMessage.interactionInProgress.desc);\n }\n\n /**\n * Creates an error thrown when the popup window could not be opened.\n * @param errDetail\n */\n static createPopupWindowError(errDetail?: string): BrowserAuthError {\n let errorMessage = BrowserAuthErrorMessage.popupWindowError.desc;\n errorMessage = !StringUtils.isEmpty(errDetail) ? `${errorMessage} Details: ${errDetail}` : errorMessage;\n return new BrowserAuthError(BrowserAuthErrorMessage.popupWindowError.code, errorMessage);\n }\n\n /**\n * Creates an error thrown when window.open returns an empty window object.\n * @param errDetail\n */\n static createEmptyWindowCreatedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.emptyWindowError.code, BrowserAuthErrorMessage.emptyWindowError.desc);\n }\n\n /**\n * Creates an error thrown when the user closes a popup.\n */\n static createUserCancelledError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.userCancelledError.code,\n BrowserAuthErrorMessage.userCancelledError.desc);\n }\n\n /**\n * Creates an error thrown when monitorPopupFromHash times out for a given popup.\n */\n static createMonitorPopupTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.monitorPopupTimeoutError.code,\n BrowserAuthErrorMessage.monitorPopupTimeoutError.desc);\n }\n\n /**\n * Creates an error thrown when monitorIframeFromHash times out for a given iframe.\n */\n static createMonitorIframeTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.monitorIframeTimeoutError.code,\n BrowserAuthErrorMessage.monitorIframeTimeoutError.desc);\n }\n\n /**\n * Creates an error thrown when navigateWindow is called inside an iframe.\n * @param windowParentCheck\n */\n static createRedirectInIframeError(windowParentCheck: boolean): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.redirectInIframeError.code,\n `${BrowserAuthErrorMessage.redirectInIframeError.desc} (window.parent !== window) => ${windowParentCheck}`);\n }\n\n /**\n * Creates an error thrown when an auth reload is done inside an iframe.\n */\n static createBlockReloadInHiddenIframeError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.code,\n BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.desc);\n }\n\n /**\n * Creates an error thrown when a popup attempts to call an acquireToken API\n * @returns\n */\n static createBlockAcquireTokenInPopupsError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.code,\n BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.desc);\n }\n\n /**\n * Creates an error thrown when an iframe is found to be closed before the timeout is reached.\n */\n static createIframeClosedPrematurelyError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.iframeClosedPrematurelyError.code, BrowserAuthErrorMessage.iframeClosedPrematurelyError.desc);\n }\n\n /**\n * Creates an error thrown when the logout API is called on any of the silent interaction clients\n */\n static createSilentLogoutUnsupportedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.silentLogoutUnsupportedError.code, BrowserAuthErrorMessage.silentLogoutUnsupportedError.desc);\n }\n\n /**\n * Creates an error thrown when the account object is not provided in the acquireTokenSilent API.\n */\n static createNoAccountError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noAccountError.code, BrowserAuthErrorMessage.noAccountError.desc);\n }\n\n /**\n * Creates an error thrown when a given prompt value is invalid for silent requests.\n */\n static createSilentPromptValueError(givenPrompt: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.silentPromptValueError.code, `${BrowserAuthErrorMessage.silentPromptValueError.desc} Given value: ${givenPrompt}`);\n }\n\n /**\n * Creates an error thrown when the cached token request could not be retrieved from the cache\n */\n static createUnableToParseTokenRequestCacheError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.code,\n BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.desc);\n }\n\n /**\n * Creates an error thrown when the token request could not be retrieved from the cache\n */\n static createNoTokenRequestCacheError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noTokenRequestCacheError.code,\n BrowserAuthErrorMessage.noTokenRequestCacheError.desc);\n }\n\n /**\n * Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)\n */\n static createAuthRequestNotSetError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authRequestNotSet.code,\n BrowserAuthErrorMessage.authRequestNotSet.desc);\n }\n\n /**\n * Creates an error thrown when the authority could not be retrieved from the cache\n */\n static createNoCachedAuthorityError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noCachedAuthorityError.code,\n BrowserAuthErrorMessage.noCachedAuthorityError.desc);\n }\n\n /**\n * Creates an error thrown if cache type is invalid.\n */\n static createInvalidCacheTypeError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.invalidCacheType.code, `${BrowserAuthErrorMessage.invalidCacheType.desc}`);\n }\n\n /**\n * Create an error thrown when login and token requests are made from a non-browser environment\n */\n static createNonBrowserEnvironmentError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.notInBrowserEnvironment.code, BrowserAuthErrorMessage.notInBrowserEnvironment.desc);\n }\n\n /**\n * Create an error thrown when indexDB database is not open\n */\n static createDatabaseNotOpenError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.databaseNotOpen.code, BrowserAuthErrorMessage.databaseNotOpen.desc);\n }\n\n /**\n * Create an error thrown when token fetch fails due to no internet\n */\n static createNoNetworkConnectivityError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noNetworkConnectivity.code, BrowserAuthErrorMessage.noNetworkConnectivity.desc);\n }\n\n /**\n * Create an error thrown when token fetch fails due to reasons other than internet connectivity\n */\n static createPostRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.postRequestFailed.code, `${BrowserAuthErrorMessage.postRequestFailed.desc} | Network client threw: ${errorDesc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when get request fails due to reasons other than internet connectivity\n */\n static createGetRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.getRequestFailed.code, `${BrowserAuthErrorMessage.getRequestFailed.desc} | Network client threw: ${errorDesc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when network client fails to parse network response\n */\n static createFailedToParseNetworkResponseError(endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.failedToParseNetworkResponse.code, `${BrowserAuthErrorMessage.failedToParseNetworkResponse.desc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when the necessary information is not available to sideload tokens\n */\n static createUnableToLoadTokenError(errorDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToLoadTokenError.code, `${BrowserAuthErrorMessage.unableToLoadTokenError.desc} | ${errorDetail}`);\n }\n\n /**\n * Create an error thrown when the queried cryptographic key is not found in IndexedDB\n */\n static createSigningKeyNotFoundInStorageError(keyId: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code, `${BrowserAuthErrorMessage.signingKeyNotFoundInStorage.desc} | No match found for KeyId: ${keyId}`);\n }\n\n /**\n * Create an error when an authorization code is required but not provided\n */\n static createAuthCodeRequiredError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authCodeRequired.code, BrowserAuthErrorMessage.authCodeRequired.desc);\n }\n\n /**\n * Create an error when an authorization code or native account ID is required but not provided\n */\n static createAuthCodeOrNativeAccountIdRequiredError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.code, BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.desc);\n }\n\n /**\n * Create an error when IndexedDB is unavailable\n */\n static createDatabaseUnavailableError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.databaseUnavailable.code, BrowserAuthErrorMessage.databaseUnavailable.desc);\n }\n\n /**\n * Create an error when native token acquisition is not possible\n */\n static createUnableToAcquireTokenFromNativePlatformError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.code, BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.desc);\n }\n\n /**\n * Create an error thrown when Handshake with browser extension times out\n */\n static createNativeHandshakeTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeHandshakeTimeout.code, BrowserAuthErrorMessage.nativeHandshakeTimeout.desc);\n }\n\n /**\n * Create an error thrown when browser extension is not installed\n */\n static createNativeExtensionNotInstalledError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeExtensionNotInstalled.code, BrowserAuthErrorMessage.nativeExtensionNotInstalled.desc);\n }\n\n /**\n * Create an error when native connection has not been established\n * @returns\n */\n static createNativeConnectionNotEstablishedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeConnectionNotEstablished.code, BrowserAuthErrorMessage.nativeConnectionNotEstablished.desc);\n }\n\n /**\n * Create an error thrown when the initialize function hasn't been called\n */\n static createNativeBrokerCalledBeforeInitialize(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.code, BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.desc);\n }\n\n /**\n * Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create\n * These requests must go through eSTS to ensure eSTS is aware of the new account\n */\n static createNativePromptParameterNotSupportedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativePromptNotSupported.code, BrowserAuthErrorMessage.nativePromptNotSupported.desc);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,uBAAuB,GAAG;IACnC,gBAAgB,EAAE;QACd,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,8DAA8D;KACvE;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,iDAAiD;KAC1D;IACD,6BAA6B,EAAE;QAC3B,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,iEAAiE;KAC1E;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,oBAAoB;QAC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,CAAC;KACnI;;;;IAKM,kEAAiD,GAAxD;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,sCAAsC,CAAC,IAAI,EAAE,uBAAuB,CAAC,sCAAsC,CAAC,IAAI,CAAC,CAAC;KACzK;;;;IAKM,kDAAiC,GAAxC;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,IAAI,EAAE,uBAAuB,CAAC,sBAAsB,CAAC,IAAI,CAAC,CAAC;KACzI;;;;IAKM,uDAAsC,GAA7C;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,2BAA2B,CAAC,IAAI,EAAE,uBAAuB,CAAC,2BAA2B,CAAC,IAAI,CAAC,CAAC;KACnJ;;;;;IAMM,0DAAyC,GAAhD;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,8BAA8B,CAAC,IAAI,EAAE,uBAAuB,CAAC,8BAA8B,CAAC,IAAI,CAAC,CAAC;KACzJ;;;;IAKM,yDAAwC,GAA/C;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,kCAAkC,CAAC,IAAI,EAAE,uBAAuB,CAAC,kCAAkC,CAAC,IAAI,CAAC,CAAC;KACjK;;;;;IAMM,6DAA4C,GAAnD;QACI,OAAO,IAAI,gBAAgB,CAAC,uBAAuB,CAAC,wBAAwB,CAAC,IAAI,EAAE,uBAAuB,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;KAC7I;IACL,uBAAC;AAAD,CArVA,CAAsC,SAAS;;;;"}
|
|
1
|
+
{"version":3,"file":"BrowserAuthError.js","sources":["../../src/error/BrowserAuthError.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { AuthError, StringUtils } from \"@azure/msal-common\";\n\n/**\n * BrowserAuthErrorMessage class containing string constants used by error codes and messages.\n */\nexport const BrowserAuthErrorMessage = {\n pkceNotGenerated: {\n code: \"pkce_not_created\",\n desc: \"The PKCE code challenge and verifier could not be generated.\"\n },\n cryptoDoesNotExist: {\n code: \"crypto_nonexistent\",\n desc: \"The crypto object or function is not available.\"\n },\n httpMethodNotImplementedError: {\n code: \"http_method_not_implemented\",\n desc: \"The HTTP method given has not been implemented in this library.\"\n },\n emptyNavigateUriError: {\n code: \"empty_navigate_uri\",\n desc: \"Navigation URI is empty. Please check stack trace for more info.\"\n },\n hashEmptyError: {\n code: \"hash_empty_error\",\n desc: \"Hash value cannot be processed because it is empty. Please verify that your redirectUri is not clearing the hash. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n hashDoesNotContainStateError: {\n code: \"no_state_in_hash\",\n desc: \"Hash does not contain state. Please verify that the request originated from msal.\"\n },\n hashDoesNotContainKnownPropertiesError: {\n code: \"hash_does_not_contain_known_properties\",\n desc: \"Hash does not contain known properites. Please verify that your redirectUri is not changing the hash. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n unableToParseStateError: {\n code: \"unable_to_parse_state\",\n desc: \"Unable to parse state. Please verify that the request originated from msal.\"\n },\n stateInteractionTypeMismatchError: {\n code: \"state_interaction_type_mismatch\",\n desc: \"Hash contains state but the interaction type does not match the caller.\"\n },\n interactionInProgress: {\n code: \"interaction_in_progress\",\n desc: \"Interaction is currently in progress. Please ensure that this interaction has been completed before calling an interactive API. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n popupWindowError: {\n code: \"popup_window_error\",\n desc: \"Error opening popup window. This can happen if you are using IE or if popups are blocked in the browser.\"\n },\n emptyWindowError: {\n code: \"empty_window_error\",\n desc: \"window.open returned null or undefined window object.\"\n },\n userCancelledError: {\n code: \"user_cancelled\",\n desc: \"User cancelled the flow.\"\n },\n monitorPopupTimeoutError: {\n code: \"monitor_window_timeout\",\n desc: \"Token acquisition in popup failed due to timeout. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n monitorIframeTimeoutError: {\n code: \"monitor_window_timeout\",\n desc: \"Token acquisition in iframe failed due to timeout. For more visit: aka.ms/msaljs/browser-errors.\"\n },\n redirectInIframeError: {\n code: \"redirect_in_iframe\",\n desc: \"Redirects are not supported for iframed or brokered applications. Please ensure you are using MSAL.js in a top frame of the window if using the redirect APIs, or use the popup APIs.\"\n },\n blockTokenRequestsInHiddenIframeError: {\n code: \"block_iframe_reload\",\n desc: \"Request was blocked inside an iframe because MSAL detected an authentication response. For more visit: aka.ms/msaljs/browser-errors\"\n },\n blockAcquireTokenInPopupsError: {\n code: \"block_nested_popups\",\n desc: \"Request was blocked inside a popup because MSAL detected it was running in a popup.\"\n },\n iframeClosedPrematurelyError: {\n code: \"iframe_closed_prematurely\",\n desc: \"The iframe being monitored was closed prematurely.\"\n },\n silentLogoutUnsupportedError: {\n code: \"silent_logout_unsupported\",\n desc: \"Silent logout not supported. Please call logoutRedirect or logoutPopup instead.\"\n },\n noAccountError: {\n code: \"no_account_error\",\n desc: \"No account object provided to acquireTokenSilent and no active account has been set. Please call setActiveAccount or provide an account on the request.\"\n },\n silentPromptValueError: {\n code: \"silent_prompt_value_error\",\n desc: \"The value given for the prompt value is not valid for silent requests - must be set to 'none'.\"\n },\n noTokenRequestCacheError: {\n code: \"no_token_request_cache_error\",\n desc: \"No token request found in cache.\"\n },\n unableToParseTokenRequestCacheError: {\n code: \"unable_to_parse_token_request_cache_error\",\n desc: \"The cached token request could not be parsed.\"\n },\n noCachedAuthorityError: {\n code: \"no_cached_authority_error\",\n desc: \"No cached authority found.\"\n },\n authRequestNotSet: {\n code: \"auth_request_not_set_error\",\n desc: \"Auth Request not set. Please ensure initiateAuthRequest was called from the InteractionHandler\"\n },\n invalidCacheType: {\n code: \"invalid_cache_type\",\n desc: \"Invalid cache type\"\n },\n notInBrowserEnvironment: {\n code: \"non_browser_environment\",\n desc: \"Login and token requests are not supported in non-browser environments.\"\n },\n databaseNotOpen: {\n code: \"database_not_open\",\n desc: \"Database is not open!\"\n },\n noNetworkConnectivity: {\n code: \"no_network_connectivity\",\n desc: \"No network connectivity. Check your internet connection.\"\n },\n postRequestFailed: {\n code: \"post_request_failed\",\n desc: \"Network request failed: If the browser threw a CORS error, check that the redirectUri is registered in the Azure App Portal as type 'SPA'\"\n },\n getRequestFailed: {\n code: \"get_request_failed\",\n desc: \"Network request failed. Please check the network trace to determine root cause.\"\n },\n failedToParseNetworkResponse: {\n code: \"failed_to_parse_response\",\n desc: \"Failed to parse network response. Check network trace.\"\n },\n unableToLoadTokenError: {\n code: \"unable_to_load_token\",\n desc: \"Error loading token to cache.\"\n },\n signingKeyNotFoundInStorage: {\n code: \"crypto_key_not_found\",\n desc: \"Cryptographic Key or Keypair not found in browser storage.\"\n },\n authCodeRequired: {\n code: \"auth_code_required\",\n desc: \"An authorization code must be provided (as the `code` property on the request) to this flow.\"\n },\n authCodeOrNativeAccountRequired: {\n code: \"auth_code_or_nativeAccountId_required\",\n desc: \"An authorization code or nativeAccountId must be provided to this flow.\"\n },\n databaseUnavailable: {\n code: \"database_unavailable\",\n desc: \"IndexedDB, which is required for persistent cryptographic key storage, is unavailable. This may be caused by browser privacy features which block persistent storage in third-party contexts.\"\n },\n unableToAcquireTokenFromNativePlatform: {\n code: \"unable_to_acquire_token_from_native_platform\",\n desc: \"Unable to acquire token from native platform. For a list of possible reasons visit aka.ms/msaljs/browser-errors.\"\n },\n nativeHandshakeTimeout: {\n code: \"native_handshake_timeout\",\n desc: \"Timed out while attempting to establish connection to browser extension\"\n },\n nativeExtensionNotInstalled: {\n code: \"native_extension_not_installed\",\n desc: \"Native extension is not installed. If you think this is a mistake call the initialize function.\"\n },\n nativeConnectionNotEstablished: {\n code: \"native_connection_not_established\",\n desc: \"Connection to native platform has not been established. Please install a compatible browser extension and run initialize(). For more please visit aka.ms/msaljs/browser-errors.\"\n },\n nativeBrokerCalledBeforeInitialize: {\n code: \"native_broker_called_before_initialize\",\n desc: \"You must call and await the initialize function before attempting to call any other MSAL API when native brokering is enabled. For more please visit aka.ms/msaljs/browser-errors.\"\n },\n nativePromptNotSupported: {\n code: \"native_prompt_not_supported\",\n desc: \"The provided prompt is not supported by the native platform. This request should be routed to the web based flow.\"\n }\n};\n\n/**\n * Browser library error class thrown by the MSAL.js library for SPAs\n */\nexport class BrowserAuthError extends AuthError {\n\n constructor(errorCode: string, errorMessage?: string) {\n super(errorCode, errorMessage);\n\n Object.setPrototypeOf(this, BrowserAuthError.prototype);\n this.name = \"BrowserAuthError\";\n }\n\n /**\n * Creates an error thrown when PKCE is not implemented.\n * @param errDetail\n */\n static createPkceNotGeneratedError(errDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.pkceNotGenerated.code,\n `${BrowserAuthErrorMessage.pkceNotGenerated.desc} Detail:${errDetail}`);\n }\n\n /**\n * Creates an error thrown when the crypto object is unavailable.\n * @param errDetail\n */\n static createCryptoNotAvailableError(errDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.cryptoDoesNotExist.code,\n `${BrowserAuthErrorMessage.cryptoDoesNotExist.desc} Detail:${errDetail}`);\n }\n\n /**\n * Creates an error thrown when an HTTP method hasn't been implemented by the browser class.\n * @param method\n */\n static createHttpMethodNotImplementedError(method: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.httpMethodNotImplementedError.code,\n `${BrowserAuthErrorMessage.httpMethodNotImplementedError.desc} Given Method: ${method}`);\n }\n\n /**\n * Creates an error thrown when the navigation URI is empty.\n */\n static createEmptyNavigationUriError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.emptyNavigateUriError.code, BrowserAuthErrorMessage.emptyNavigateUriError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n * @param hashValue\n */\n static createEmptyHashError(hashValue: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashEmptyError.code, `${BrowserAuthErrorMessage.hashEmptyError.desc} Given Url: ${hashValue}`);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n */\n static createHashDoesNotContainStateError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainStateError.code, BrowserAuthErrorMessage.hashDoesNotContainStateError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value does not contain known properties\n */\n static createHashDoesNotContainKnownPropertiesError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.code, BrowserAuthErrorMessage.hashDoesNotContainKnownPropertiesError.desc);\n }\n\n /**\n * Creates an error thrown when the hash string value is unexpectedly empty.\n */\n static createUnableToParseStateError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseStateError.code, BrowserAuthErrorMessage.unableToParseStateError.desc);\n }\n\n /**\n * Creates an error thrown when the state value in the hash does not match the interaction type of the API attempting to consume it.\n */\n static createStateInteractionTypeMismatchError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.stateInteractionTypeMismatchError.code, BrowserAuthErrorMessage.stateInteractionTypeMismatchError.desc);\n }\n\n /**\n * Creates an error thrown when a browser interaction (redirect or popup) is in progress.\n */\n static createInteractionInProgressError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.interactionInProgress.code, BrowserAuthErrorMessage.interactionInProgress.desc);\n }\n\n /**\n * Creates an error thrown when the popup window could not be opened.\n * @param errDetail\n */\n static createPopupWindowError(errDetail?: string): BrowserAuthError {\n let errorMessage = BrowserAuthErrorMessage.popupWindowError.desc;\n errorMessage = !StringUtils.isEmpty(errDetail) ? `${errorMessage} Details: ${errDetail}` : errorMessage;\n return new BrowserAuthError(BrowserAuthErrorMessage.popupWindowError.code, errorMessage);\n }\n\n /**\n * Creates an error thrown when window.open returns an empty window object.\n * @param errDetail\n */\n static createEmptyWindowCreatedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.emptyWindowError.code, BrowserAuthErrorMessage.emptyWindowError.desc);\n }\n\n /**\n * Creates an error thrown when the user closes a popup.\n */\n static createUserCancelledError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.userCancelledError.code,\n BrowserAuthErrorMessage.userCancelledError.desc);\n }\n\n /**\n * Creates an error thrown when monitorPopupFromHash times out for a given popup.\n */\n static createMonitorPopupTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.monitorPopupTimeoutError.code,\n BrowserAuthErrorMessage.monitorPopupTimeoutError.desc);\n }\n\n /**\n * Creates an error thrown when monitorIframeFromHash times out for a given iframe.\n */\n static createMonitorIframeTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.monitorIframeTimeoutError.code,\n BrowserAuthErrorMessage.monitorIframeTimeoutError.desc);\n }\n\n /**\n * Creates an error thrown when navigateWindow is called inside an iframe or brokered applications.\n * @param windowParentCheck\n */\n static createRedirectInIframeError(windowParentCheck: boolean): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.redirectInIframeError.code,\n `${BrowserAuthErrorMessage.redirectInIframeError.desc} (window.parent !== window) => ${windowParentCheck}`);\n }\n\n /**\n * Creates an error thrown when an auth reload is done inside an iframe.\n */\n static createBlockReloadInHiddenIframeError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.code,\n BrowserAuthErrorMessage.blockTokenRequestsInHiddenIframeError.desc);\n }\n\n /**\n * Creates an error thrown when a popup attempts to call an acquireToken API\n * @returns\n */\n static createBlockAcquireTokenInPopupsError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.code,\n BrowserAuthErrorMessage.blockAcquireTokenInPopupsError.desc);\n }\n\n /**\n * Creates an error thrown when an iframe is found to be closed before the timeout is reached.\n */\n static createIframeClosedPrematurelyError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.iframeClosedPrematurelyError.code, BrowserAuthErrorMessage.iframeClosedPrematurelyError.desc);\n }\n\n /**\n * Creates an error thrown when the logout API is called on any of the silent interaction clients\n */\n static createSilentLogoutUnsupportedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.silentLogoutUnsupportedError.code, BrowserAuthErrorMessage.silentLogoutUnsupportedError.desc);\n }\n\n /**\n * Creates an error thrown when the account object is not provided in the acquireTokenSilent API.\n */\n static createNoAccountError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noAccountError.code, BrowserAuthErrorMessage.noAccountError.desc);\n }\n\n /**\n * Creates an error thrown when a given prompt value is invalid for silent requests.\n */\n static createSilentPromptValueError(givenPrompt: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.silentPromptValueError.code, `${BrowserAuthErrorMessage.silentPromptValueError.desc} Given value: ${givenPrompt}`);\n }\n\n /**\n * Creates an error thrown when the cached token request could not be retrieved from the cache\n */\n static createUnableToParseTokenRequestCacheError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.code,\n BrowserAuthErrorMessage.unableToParseTokenRequestCacheError.desc);\n }\n\n /**\n * Creates an error thrown when the token request could not be retrieved from the cache\n */\n static createNoTokenRequestCacheError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noTokenRequestCacheError.code,\n BrowserAuthErrorMessage.noTokenRequestCacheError.desc);\n }\n\n /**\n * Creates an error thrown when handleCodeResponse is called before initiateAuthRequest (InteractionHandler)\n */\n static createAuthRequestNotSetError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authRequestNotSet.code,\n BrowserAuthErrorMessage.authRequestNotSet.desc);\n }\n\n /**\n * Creates an error thrown when the authority could not be retrieved from the cache\n */\n static createNoCachedAuthorityError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noCachedAuthorityError.code,\n BrowserAuthErrorMessage.noCachedAuthorityError.desc);\n }\n\n /**\n * Creates an error thrown if cache type is invalid.\n */\n static createInvalidCacheTypeError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.invalidCacheType.code, `${BrowserAuthErrorMessage.invalidCacheType.desc}`);\n }\n\n /**\n * Create an error thrown when login and token requests are made from a non-browser environment\n */\n static createNonBrowserEnvironmentError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.notInBrowserEnvironment.code, BrowserAuthErrorMessage.notInBrowserEnvironment.desc);\n }\n\n /**\n * Create an error thrown when indexDB database is not open\n */\n static createDatabaseNotOpenError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.databaseNotOpen.code, BrowserAuthErrorMessage.databaseNotOpen.desc);\n }\n\n /**\n * Create an error thrown when token fetch fails due to no internet\n */\n static createNoNetworkConnectivityError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.noNetworkConnectivity.code, BrowserAuthErrorMessage.noNetworkConnectivity.desc);\n }\n\n /**\n * Create an error thrown when token fetch fails due to reasons other than internet connectivity\n */\n static createPostRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.postRequestFailed.code, `${BrowserAuthErrorMessage.postRequestFailed.desc} | Network client threw: ${errorDesc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when get request fails due to reasons other than internet connectivity\n */\n static createGetRequestFailedError(errorDesc: string, endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.getRequestFailed.code, `${BrowserAuthErrorMessage.getRequestFailed.desc} | Network client threw: ${errorDesc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when network client fails to parse network response\n */\n static createFailedToParseNetworkResponseError(endpoint: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.failedToParseNetworkResponse.code, `${BrowserAuthErrorMessage.failedToParseNetworkResponse.desc} | Attempted to reach: ${endpoint.split(\"?\")[0]}`);\n }\n\n /**\n * Create an error thrown when the necessary information is not available to sideload tokens\n */\n static createUnableToLoadTokenError(errorDetail: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToLoadTokenError.code, `${BrowserAuthErrorMessage.unableToLoadTokenError.desc} | ${errorDetail}`);\n }\n\n /**\n * Create an error thrown when the queried cryptographic key is not found in IndexedDB\n */\n static createSigningKeyNotFoundInStorageError(keyId: string): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.signingKeyNotFoundInStorage.code, `${BrowserAuthErrorMessage.signingKeyNotFoundInStorage.desc} | No match found for KeyId: ${keyId}`);\n }\n\n /**\n * Create an error when an authorization code is required but not provided\n */\n static createAuthCodeRequiredError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authCodeRequired.code, BrowserAuthErrorMessage.authCodeRequired.desc);\n }\n\n /**\n * Create an error when an authorization code or native account ID is required but not provided\n */\n static createAuthCodeOrNativeAccountIdRequiredError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.code, BrowserAuthErrorMessage.authCodeOrNativeAccountRequired.desc);\n }\n\n /**\n * Create an error when IndexedDB is unavailable\n */\n static createDatabaseUnavailableError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.databaseUnavailable.code, BrowserAuthErrorMessage.databaseUnavailable.desc);\n }\n\n /**\n * Create an error when native token acquisition is not possible\n */\n static createUnableToAcquireTokenFromNativePlatformError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.code, BrowserAuthErrorMessage.unableToAcquireTokenFromNativePlatform.desc);\n }\n\n /**\n * Create an error thrown when Handshake with browser extension times out\n */\n static createNativeHandshakeTimeoutError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeHandshakeTimeout.code, BrowserAuthErrorMessage.nativeHandshakeTimeout.desc);\n }\n\n /**\n * Create an error thrown when browser extension is not installed\n */\n static createNativeExtensionNotInstalledError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeExtensionNotInstalled.code, BrowserAuthErrorMessage.nativeExtensionNotInstalled.desc);\n }\n\n /**\n * Create an error when native connection has not been established\n * @returns\n */\n static createNativeConnectionNotEstablishedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeConnectionNotEstablished.code, BrowserAuthErrorMessage.nativeConnectionNotEstablished.desc);\n }\n\n /**\n * Create an error thrown when the initialize function hasn't been called\n */\n static createNativeBrokerCalledBeforeInitialize(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.code, BrowserAuthErrorMessage.nativeBrokerCalledBeforeInitialize.desc);\n }\n\n /**\n * Create an error thrown when requesting a token directly from the native platform with an unsupported prompt parameter e.g. select_account, login or create\n * These requests must go through eSTS to ensure eSTS is aware of the new account\n */\n static createNativePromptParameterNotSupportedError(): BrowserAuthError {\n return new BrowserAuthError(BrowserAuthErrorMessage.nativePromptNotSupported.code, BrowserAuthErrorMessage.nativePromptNotSupported.desc);\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAOA;;;IAGa,uBAAuB,GAAG;IACnC,gBAAgB,EAAE;QACd,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,8DAA8D;KACvE;IACD,kBAAkB,EAAE;QAChB,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,iDAAiD;KAC1D;IACD,6BAA6B,EAAE;QAC3B,IAAI,EAAE,6BAA6B;QACnC,IAAI,EAAE,iEAAiE;KAC1E;IACD,qBAAqB,EAAE;QACnB,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,kEAAkE;KAC3E;IACD,cAAc,EAAE;QACZ,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,iKAAiK;KAC1K;IACD,4BAA4B,EAAE;QAC1B,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,mFAAmF;KAC5F;IACD,sCAAsC,EAAE;QACpC,IAAI,EA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