@azure/msal-browser 2.29.0 → 2.31.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 -2
- package/dist/_virtual/_tslib.js +1 -1
- package/dist/app/ClientApplication.d.ts.map +1 -1
- package/dist/app/ClientApplication.js +13 -9
- 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 +8 -6
- package/dist/app/PublicClientApplication.js.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts +11 -0
- package/dist/broker/nativeBroker/NativeMessageHandler.d.ts.map +1 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js +16 -1
- package/dist/broker/nativeBroker/NativeMessageHandler.js.map +1 -1
- package/dist/cache/AsyncMemoryStorage.js +1 -1
- package/dist/cache/BrowserCacheManager.js +1 -1
- package/dist/cache/BrowserStorage.js +1 -1
- package/dist/cache/CryptoKeyStore.js +1 -1
- package/dist/cache/DatabaseStorage.js +1 -1
- package/dist/cache/ITokenCache.d.ts +6 -3
- package/dist/cache/ITokenCache.d.ts.map +1 -1
- package/dist/cache/MemoryStorage.js +1 -1
- package/dist/cache/TokenCache.d.ts +33 -5
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.js +121 -20
- 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 +3 -3
- package/dist/config/Configuration.js.map +1 -1
- package/dist/crypto/BrowserCrypto.js +1 -1
- package/dist/crypto/CryptoOps.js +1 -1
- package/dist/crypto/GuidGenerator.js +1 -1
- package/dist/crypto/ModernBrowserCrypto.js +1 -1
- package/dist/crypto/MsBrowserCrypto.js +1 -1
- package/dist/crypto/MsrBrowserCrypto.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.js +1 -1
- package/dist/error/BrowserConfigurationAuthError.js +1 -1
- package/dist/error/NativeAuthError.js +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 +296 -132
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/interaction_client/BaseInteractionClient.js +1 -1
- package/dist/interaction_client/HybridSpaAuthorizationCodeClient.js +1 -1
- package/dist/interaction_client/NativeInteractionClient.d.ts.map +1 -1
- package/dist/interaction_client/NativeInteractionClient.js +28 -7
- package/dist/interaction_client/NativeInteractionClient.js.map +1 -1
- package/dist/interaction_client/PopupClient.js +4 -4
- package/dist/interaction_client/PopupClient.js.map +1 -1
- package/dist/interaction_client/RedirectClient.js +1 -1
- package/dist/interaction_client/SilentAuthCodeClient.js +2 -2
- package/dist/interaction_client/SilentAuthCodeClient.js.map +1 -1
- package/dist/interaction_client/SilentCacheClient.js +1 -1
- package/dist/interaction_client/SilentIframeClient.js +2 -2
- package/dist/interaction_client/SilentIframeClient.js.map +1 -1
- package/dist/interaction_client/SilentRefreshClient.js +1 -1
- package/dist/interaction_client/StandardInteractionClient.js +1 -1
- package/dist/interaction_handler/InteractionHandler.js +1 -1
- package/dist/interaction_handler/RedirectHandler.js +1 -1
- package/dist/interaction_handler/SilentHandler.d.ts +3 -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.js +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/telemetry/BrowserPerformanceClient.js +1 -1
- package/dist/telemetry/BrowserPerformanceMeasurement.js +1 -1
- package/dist/utils/BrowserConstants.d.ts +1 -1
- package/dist/utils/BrowserConstants.js +2 -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 +296 -132
- package/lib/msal-browser.js.map +1 -1
- package/lib/msal-browser.min.js +44 -44
- package/package.json +2 -2
|
@@ -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 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);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Cache.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, RefreshTokenEntity , AuthorityType, CacheRecord, AuthenticationResult, Constants } 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 * @returns `AuthenticationResult` for the response that was loaded.\n */\n loadExternalTokens(request: SilentRequest, response: ExternalTokenResponse, options: LoadTokenOptions): AuthenticationResult {\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 const idToken = new AuthToken(response.id_token, this.cryptoObj);\n\n let cacheRecord: CacheRecord | undefined;\n let authority: Authority | undefined;\n\n if (request.account) {\n const cacheRecordAccount = this.loadAccount(idToken, request.account.environment, undefined, undefined, request.account.homeAccountId);\n cacheRecord = new CacheRecord(\n cacheRecordAccount,\n this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId),\n this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment, request.account.tenantId, options),\n this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, request.account.environment)\n );\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 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 const cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, options.clientInfo, authority.authorityType);\n cacheRecord = new CacheRecord(\n cacheRecordAccount,\n this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant),\n this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options),\n this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort)\n );\n } else if (response.client_info) {\n this.logger.trace(\"TokenCache - homeAccountId from response\");\n const cacheRecordAccount = this.loadAccount(idToken, authority.hostnameAndPort, response.client_info, authority.authorityType);\n cacheRecord = new CacheRecord(\n cacheRecordAccount,\n this.loadIdToken(idToken, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant),\n this.loadAccessToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort, authority.tenant, options),\n this.loadRefreshToken(request, response, cacheRecordAccount.homeAccountId, authority.hostnameAndPort)\n );\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 return this.generateAuthenticationResult(request, idToken, cacheRecord, authority);\n }\n\n /**\n * Helper function to load account to msal-browser cache\n * @param idToken\n * @param environment\n * @param clientInfo\n * @param authorityType\n * @param requestHomeAccountId\n * @returns `AccountEntity`\n */\n private loadAccount(idToken: AuthToken, environment: string, clientInfo?: string, authorityType?: AuthorityType, requestHomeAccountId?: string): AccountEntity {\n\n let homeAccountId;\n if (requestHomeAccountId) {\n homeAccountId = requestHomeAccountId;\n } else if (authorityType !== undefined && clientInfo) {\n homeAccountId = AccountEntity.generateHomeAccountId(clientInfo, authorityType, this.logger, this.cryptoObj, idToken);\n }\n\n if (!homeAccountId) {\n throw BrowserAuthError.createUnableToLoadTokenError(\"Unexpected missing homeAccountId\");\n }\n\n const accountEntity = clientInfo ?\n AccountEntity.createAccount(clientInfo, homeAccountId, idToken, undefined, undefined, undefined, environment) :\n AccountEntity.createGenericAccount(homeAccountId, idToken, undefined, undefined, undefined, environment);\n\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading account\");\n\n this.storage.setAccount(accountEntity);\n return accountEntity;\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\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 * @returns `IdTokenEntity`\n */\n private loadIdToken(idToken: AuthToken, homeAccountId: string, environment: string, tenantId: string): IdTokenEntity {\n\n const idTokenEntity = IdTokenEntity.createIdTokenEntity(homeAccountId, environment, idToken.rawToken, this.config.auth.clientId, tenantId);\n\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading id token\");\n this.storage.setIdTokenCredential(idTokenEntity);\n return 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 homeAccountId\n * @param environment\n * @param tenantId\n * @returns `AccessTokenEntity`\n */\n private loadAccessToken(request: SilentRequest, response: ExternalTokenResponse, homeAccountId: string, environment: string, tenantId: string, options: LoadTokenOptions): AccessTokenEntity | null {\n\n if (!response.access_token) {\n this.logger.verbose(\"TokenCache - No access token provided for caching\");\n return null;\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 return accessTokenEntity;\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\n }\n }\n\n /**\n * Helper function to load refresh tokens to msal-browser cache\n * @param request\n * @param response\n * @param homeAccountId\n * @param environment\n * @returns `RefreshTokenEntity`\n */\n private loadRefreshToken(request: SilentRequest, response: ExternalTokenResponse, homeAccountId: string, environment: string): RefreshTokenEntity | null {\n\n if (!response.refresh_token) {\n this.logger.verbose(\"TokenCache - No refresh token provided for caching\");\n return null;\n }\n\n const refreshTokenEntity = RefreshTokenEntity.createRefreshTokenEntity(homeAccountId, environment, response.refresh_token, this.config.auth.clientId);\n\n if (this.isBrowserEnvironment) {\n this.logger.verbose(\"TokenCache - loading refresh token\");\n this.storage.setRefreshTokenCredential(refreshTokenEntity);\n return refreshTokenEntity;\n } else {\n throw BrowserAuthError.createUnableToLoadTokenError(\"loadExternalTokens is designed to work in browser environments only.\");\n }\n }\n\n /**\n * Helper function to generate an `AuthenticationResult` for the result.\n * @param request\n * @param idTokenObj\n * @param cacheRecord\n * @param authority\n * @returns `AuthenticationResult`\n */\n private generateAuthenticationResult(\n request: SilentRequest,\n idTokenObj: AuthToken,\n cacheRecord?: CacheRecord,\n authority?: Authority,\n ): AuthenticationResult {\n let accessToken: string = Constants.EMPTY_STRING;\n let responseScopes: Array<string> = [];\n let expiresOn: Date | null = null;\n let extExpiresOn: Date | undefined;\n\n if (cacheRecord?.accessToken) {\n accessToken = cacheRecord.accessToken.secret;\n responseScopes = ScopeSet.fromString(cacheRecord.accessToken.target).asArray();\n expiresOn = new Date(Number(cacheRecord.accessToken.expiresOn) * 1000);\n extExpiresOn = new Date(Number(cacheRecord.accessToken.extendedExpiresOn) * 1000);\n }\n\n const uid = idTokenObj?.claims.oid || idTokenObj?.claims.sub || Constants.EMPTY_STRING;\n const tid = idTokenObj?.claims.tid || Constants.EMPTY_STRING;\n\n return {\n authority: authority ? authority.canonicalAuthority : Constants.EMPTY_STRING,\n uniqueId: uid,\n tenantId: tid,\n scopes: responseScopes,\n account: cacheRecord?.account ? cacheRecord.account.getAccountInfo() : null,\n idToken: idTokenObj ? idTokenObj.rawToken : Constants.EMPTY_STRING,\n idTokenClaims: idTokenObj ? idTokenObj.claims : {},\n accessToken: accessToken,\n fromCache: true,\n expiresOn: expiresOn,\n correlationId: request.correlationId || Constants.EMPTY_STRING,\n requestId: Constants.EMPTY_STRING,\n extExpiresOn: extExpiresOn,\n familyId: Constants.EMPTY_STRING,\n tokenType: cacheRecord?.accessToken?.tokenType || Constants.EMPTY_STRING,\n state: Constants.EMPTY_STRING,\n cloudGraphHostName: cacheRecord?.account?.cloudGraphHostName || Constants.EMPTY_STRING,\n msGraphHost: cacheRecord?.account?.msGraphHost || Constants.EMPTY_STRING,\n code: undefined,\n fromNativeBroker: false\n };\n }\n}\n\n"],"names":[],"mappings":";;;;;AAAA;;;;AAkBA;;;;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;;;;;;;;;IAWD,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,IAAM,OAAO,GAAG,IAAI,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAEjE,IAAI,WAAoC,CAAC;QACzC,IAAI,SAAgC,CAAC;QAErC,IAAI,OAAO,CAAC,OAAO,EAAE;YACjB,IAAM,kBAAkB,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;YACvI,WAAW,GAAG,IAAI,WAAW,CACzB,kBAAkB,EAClB,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,OAAO,CAAC,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,EAAE,UAAU,GAAG,UAAU,CAAC,MAAM,GAAG,EAAE;YAClD,WAAW,EAAE,WAAW;YACxB,SAAS,EAAE,IAAI;YACf,SAAS,EAAE,SAAS;YACpB,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,SAAS,CAAC,YAAY;YAC9D,SAAS,EAAE,SAAS,CAAC,YAAY;YACjC,YAAY,EAAE,YAAY;YAC1B,QAAQ,EAAE,SAAS,CAAC,YAAY;YAChC,SAAS,EAAE,OAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,0CAAE,SAAS,KAAI,SAAS,CAAC,YAAY;YACxE,KAAK,EAAE,SAAS,CAAC,YAAY;YAC7B,kBAAkB,EAAE,OAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,0CAAE,kBAAkB,KAAI,SAAS,CAAC,YAAY;YACtF,WAAW,EAAE,OAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,0CAAE,WAAW,KAAI,SAAS,CAAC,YAAY;YACxE,IAAI,EAAE,SAAS;YACf,gBAAgB,EAAE,KAAK;SAC1B,CAAC;KACL;IACL,iBAAC;AAAD,CAAC;;;;"}
|
|
@@ -128,6 +128,10 @@ export declare type BrowserSystemOptions = SystemOptions & {
|
|
|
128
128
|
* Options related to browser crypto APIs
|
|
129
129
|
*/
|
|
130
130
|
cryptoOptions?: CryptoOptions;
|
|
131
|
+
/**
|
|
132
|
+
* Sets the interval length in milliseconds for polling the location attribute in popup windows (default is 30ms)
|
|
133
|
+
*/
|
|
134
|
+
pollIntervalMilliseconds?: number;
|
|
131
135
|
};
|
|
132
136
|
export declare type CryptoOptions = {
|
|
133
137
|
/**
|
|
@@ -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,EAA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;AACH,oBAAY,aAAa,GAAG;IACxB;;OAEG;IACH,IAAI,EAAE,kBAAkB,CAAC;IACzB;;OAEG;IACH,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B;;OAEG;IACH,SAAS,CAAC,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,CAyE7M"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*! @azure/msal-browser v2.
|
|
1
|
+
/*! @azure/msal-browser v2.31.0 2022-11-07 */
|
|
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';
|
|
5
5
|
import { BrowserUtils } from '../utils/BrowserUtils.js';
|
|
6
|
-
import { BrowserCacheLocation } from '../utils/BrowserConstants.js';
|
|
6
|
+
import { BrowserConstants, BrowserCacheLocation } from '../utils/BrowserConstants.js';
|
|
7
7
|
import { NavigationClient } from '../navigation/NavigationClient.js';
|
|
8
8
|
|
|
9
9
|
/*
|
|
@@ -60,7 +60,7 @@ function buildConfiguration(_a, isBrowserEnvironment) {
|
|
|
60
60
|
// Default system options for browser
|
|
61
61
|
var DEFAULT_BROWSER_SYSTEM_OPTIONS = __assign(__assign({}, DEFAULT_SYSTEM_OPTIONS), { loggerOptions: DEFAULT_LOGGER_OPTIONS, networkClient: isBrowserEnvironment ? BrowserUtils.getBrowserNetworkClient() : StubbedNetworkModule, navigationClient: new NavigationClient(), loadFrameTimeout: 0,
|
|
62
62
|
// If loadFrameTimeout is provided, use that as default.
|
|
63
|
-
windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, cryptoOptions: {
|
|
63
|
+
windowHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_POPUP_TIMEOUT_MS, iframeHashTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.loadFrameTimeout) || DEFAULT_IFRAME_TIMEOUT_MS, navigateFrameWait: isBrowserEnvironment && BrowserUtils.detectIEOrEdge() ? 500 : 0, redirectNavigationTimeout: DEFAULT_REDIRECT_TIMEOUT_MS, asyncPopups: false, allowRedirectInIframe: false, allowNativeBroker: false, nativeBrokerHandshakeTimeout: (userInputSystem === null || userInputSystem === void 0 ? void 0 : userInputSystem.nativeBrokerHandshakeTimeout) || DEFAULT_NATIVE_BROKER_HANDSHAKE_TIMEOUT_MS, pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS, cryptoOptions: {
|
|
64
64
|
useMsrCrypto: false,
|
|
65
65
|
entropy: undefined
|
|
66
66
|
} });
|
|
@@ -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 * 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 * Options related to browser crypto APIs\n */\n cryptoOptions?: CryptoOptions;\n};\n\nexport type CryptoOptions = {\n \n /**\n * Enables the application to use the MSR Crypto interface, if available (and other interfaces are not)\n * @type {?boolean}\n */\n useMsrCrypto?: boolean;\n \n /**\n * Entropy to seed browser crypto API (needed for MSR Crypto). Must be cryptographically strong random numbers (e.g. crypto.randomBytes(48) from Node)\n * @type {?Uint8Array}\n */\n entropy?: Uint8Array;\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 cryptoOptions: {\n useMsrCrypto: false,\n entropy: undefined\n }\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;AAyL/D;;;;;;;;;SASgB,kBAAkB,CAAC,EAAqH,EAAE,oBAA6B;QAA5I,aAAa,UAAA,EAAS,cAAc,WAAA,EAAU,eAAe,YAAA,EAAa,kBAAkB,eAAA;;IAGnI,IAAM,oBAAoB,GAAiC;QACvD,QAAQ,EAAE,SAAS,CAAC,YAAY;QAChC,SAAS,EAAE,KAAG,SAAS,CAAC,iBAAmB;QAC3C,gBAAgB,EAAE,EAAE;QACpB,sBAAsB,EAAE,SAAS,CAAC,YAAY;QAC9C,iBAAiB,EAAE,SAAS,CAAC,YAAY;QACzC,WAAW,EAAE,SAAS,CAAC,YAAY;QACnC,qBAAqB,EAAE,SAAS,CAAC,YAAY;QAC7C,y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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, BrowserConstants } 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 * Options related to browser crypto APIs\n */\n cryptoOptions?: CryptoOptions;\n /**\n * Sets the interval length in milliseconds for polling the location attribute in popup windows (default is 30ms)\n */\n pollIntervalMilliseconds?: number;\n};\n\nexport type CryptoOptions = {\n \n /**\n * Enables the application to use the MSR Crypto interface, if available (and other interfaces are not)\n * @type {?boolean}\n */\n useMsrCrypto?: boolean;\n \n /**\n * Entropy to seed browser crypto API (needed for MSR Crypto). Must be cryptographically strong random numbers (e.g. crypto.randomBytes(48) from Node)\n * @type {?Uint8Array}\n */\n entropy?: Uint8Array;\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 pollIntervalMilliseconds: BrowserConstants.DEFAULT_POLL_INTERVAL_MS,\n cryptoOptions: {\n useMsrCrypto: false,\n entropy: undefined\n }\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;AA6L/D;;;;;;;;;SASgB,kBAAkB,CAAC,EAAqH,EAAE,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