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uH,IAC3BX,EAAiCY,IAAID,EAAM,GAC7C,2DC3EN,MAAME,EAAqB,CAEvBC,KAAM,OAENC,YAAa,oCAEbC,SAAU,gCAEVC,WAAY,iCAEZC,aAAc,mCAEdC,kBAAmB,0FCTvB,MAAMrK,EAAgB,CAClBsK,QAAS,EACTC,KAAM,EACNC,KAAM,EACNC,KAAM,0DCJV,MAAMzI,EAAe,CACjB0I,IAAK,MACLC,KAAM","sources":["webpack://iadviser/./node_modules/@azure/msal-common/dist/account/AccountInfo.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/account/AuthToken.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/account/CcsCredential.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/account/ClientInfo.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/account/TokenClaims.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/RegionDiscovery.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/Authority.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/OpenIdConfigResponse.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryResponse.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/AuthorityFactory.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/AuthorityMetadata.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/AuthorityOptions.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/AuthorityType.mjs","webpack://iadviser/./node_modules/@azure/msal-common/dist/authority/ProtocolMode.mjs"],"sourcesContent":["/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Returns true if tenantId matches the utid portion of homeAccountId\r\n * @param tenantId\r\n * @param homeAccountId\r\n * @returns\r\n */\r\nfunction tenantIdMatchesHomeTenant(tenantId, homeAccountId) {\r\n return (!!tenantId &&\r\n !!homeAccountId &&\r\n tenantId === homeAccountId.split(\".\")[1]);\r\n}\r\n/**\r\n * Build tenant profile\r\n * @param homeAccountId - Home account identifier for this account object\r\n * @param localAccountId - Local account identifer for this account object\r\n * @param tenantId - Full tenant or organizational id that this account belongs to\r\n * @param idTokenClaims - Claims from the ID token\r\n * @returns\r\n */\r\nfunction buildTenantProfile(homeAccountId, localAccountId, tenantId, idTokenClaims) {\r\n if (idTokenClaims) {\r\n const { oid, sub, tid, name, tfp, acr } = idTokenClaims;\r\n /**\r\n * Since there is no way to determine if the authority is AAD or B2C, we exhaust all the possible claims that can serve as tenant ID with the following precedence:\r\n * tid - TenantID claim that identifies the tenant that issued the token in AAD. Expected in all AAD ID tokens, not present in B2C ID Tokens.\r\n * tfp - Trust Framework Policy claim that identifies the policy that was used to authenticate the user. Functions as tenant for B2C scenarios.\r\n * acr - Authentication Context Class Reference claim used only with older B2C policies. Fallback in case tfp is not present, but likely won't be present anyway.\r\n */\r\n const tenantId = tid || tfp || acr || \"\";\r\n return {\r\n tenantId: tenantId,\r\n localAccountId: oid || sub || \"\",\r\n name: name,\r\n isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),\r\n };\r\n }\r\n else {\r\n return {\r\n tenantId,\r\n localAccountId,\r\n isHomeTenant: tenantIdMatchesHomeTenant(tenantId, homeAccountId),\r\n };\r\n }\r\n}\r\n/**\r\n * Replaces account info that varies by tenant profile sourced from the ID token claims passed in with the tenant-specific account info\r\n * @param baseAccountInfo\r\n * @param idTokenClaims\r\n * @returns\r\n */\r\nfunction updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenClaims, idTokenSecret) {\r\n let updatedAccountInfo = baseAccountInfo;\r\n // Tenant Profile overrides passed in account info\r\n if (tenantProfile) {\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { isHomeTenant, ...tenantProfileOverride } = tenantProfile;\r\n updatedAccountInfo = { ...baseAccountInfo, ...tenantProfileOverride };\r\n }\r\n // ID token claims override passed in account info and tenant profile\r\n if (idTokenClaims) {\r\n // Ignore isHomeTenant, loginHint, and sid which are part of tenant profile but not base account info\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n const { isHomeTenant, ...claimsSourcedTenantProfile } = buildTenantProfile(baseAccountInfo.homeAccountId, baseAccountInfo.localAccountId, baseAccountInfo.tenantId, idTokenClaims);\r\n updatedAccountInfo = {\r\n ...updatedAccountInfo,\r\n ...claimsSourcedTenantProfile,\r\n idTokenClaims: idTokenClaims,\r\n idToken: idTokenSecret,\r\n };\r\n return updatedAccountInfo;\r\n }\r\n return updatedAccountInfo;\r\n}\n\nexport { buildTenantProfile, tenantIdMatchesHomeTenant, updateAccountTenantProfileData };\n//# sourceMappingURL=AccountInfo.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { tokenParsingError, nullOrEmptyToken, maxAgeTranspired } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Extract token by decoding the rawToken\r\n *\r\n * @param encodedToken\r\n */\r\nfunction extractTokenClaims(encodedToken, base64Decode) {\r\n const jswPayload = getJWSPayload(encodedToken);\r\n // token will be decoded to get the username\r\n try {\r\n // base64Decode() should throw an error if there is an issue\r\n const base64Decoded = base64Decode(jswPayload);\r\n return JSON.parse(base64Decoded);\r\n }\r\n catch (err) {\r\n throw createClientAuthError(tokenParsingError);\r\n }\r\n}\r\n/**\r\n * decode a JWT\r\n *\r\n * @param authToken\r\n */\r\nfunction getJWSPayload(authToken) {\r\n if (!authToken) {\r\n throw createClientAuthError(nullOrEmptyToken);\r\n }\r\n const tokenPartsRegex = /^([^\\.\\s]*)\\.([^\\.\\s]+)\\.([^\\.\\s]*)$/;\r\n const matches = tokenPartsRegex.exec(authToken);\r\n if (!matches || matches.length < 4) {\r\n throw createClientAuthError(tokenParsingError);\r\n }\r\n /**\r\n * const crackedToken = {\r\n * header: matches[1],\r\n * JWSPayload: matches[2],\r\n * JWSSig: matches[3],\r\n * };\r\n */\r\n return matches[2];\r\n}\r\n/**\r\n * Determine if the token's max_age has transpired\r\n */\r\nfunction checkMaxAge(authTime, maxAge) {\r\n /*\r\n * per https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest\r\n * To force an immediate re-authentication: If an app requires that a user re-authenticate prior to access,\r\n * provide a value of 0 for the max_age parameter and the AS will force a fresh login.\r\n */\r\n const fiveMinuteSkew = 300000; // five minutes in milliseconds\r\n if (maxAge === 0 || Date.now() - fiveMinuteSkew > authTime + maxAge) {\r\n throw createClientAuthError(maxAgeTranspired);\r\n }\r\n}\n\nexport { checkMaxAge, extractTokenClaims, getJWSPayload };\n//# sourceMappingURL=AuthToken.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst CcsCredentialType = {\r\n HOME_ACCOUNT_ID: \"home_account_id\",\r\n UPN: \"UPN\",\r\n};\n\nexport { CcsCredentialType };\n//# sourceMappingURL=CcsCredential.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { Separators, Constants } from '../utils/Constants.mjs';\nimport { clientInfoEmptyError, clientInfoDecodingError } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Function to build a client info object from server clientInfo string\r\n * @param rawClientInfo\r\n * @param crypto\r\n */\r\nfunction buildClientInfo(rawClientInfo, base64Decode) {\r\n if (!rawClientInfo) {\r\n throw createClientAuthError(clientInfoEmptyError);\r\n }\r\n try {\r\n const decodedClientInfo = base64Decode(rawClientInfo);\r\n return JSON.parse(decodedClientInfo);\r\n }\r\n catch (e) {\r\n throw createClientAuthError(clientInfoDecodingError);\r\n }\r\n}\r\n/**\r\n * Function to build a client info object from cached homeAccountId string\r\n * @param homeAccountId\r\n */\r\nfunction buildClientInfoFromHomeAccountId(homeAccountId) {\r\n if (!homeAccountId) {\r\n throw createClientAuthError(clientInfoDecodingError);\r\n }\r\n const clientInfoParts = homeAccountId.split(Separators.CLIENT_INFO_SEPARATOR, 2);\r\n return {\r\n uid: clientInfoParts[0],\r\n utid: clientInfoParts.length < 2\r\n ? Constants.EMPTY_STRING\r\n : clientInfoParts[1],\r\n };\r\n}\n\nexport { buildClientInfo, buildClientInfoFromHomeAccountId };\n//# sourceMappingURL=ClientInfo.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Gets tenantId from available ID token claims to set as credential realm with the following precedence:\r\n * 1. tid - if the token is acquired from an Azure AD tenant tid will be present\r\n * 2. tfp - if the token is acquired from a modern B2C tenant tfp should be present\r\n * 3. acr - if the token is acquired from a legacy B2C tenant acr should be present\r\n * Downcased to match the realm case-insensitive comparison requirements\r\n * @param idTokenClaims\r\n * @returns\r\n */\r\nfunction getTenantIdFromIdTokenClaims(idTokenClaims) {\r\n if (idTokenClaims) {\r\n const tenantId = idTokenClaims.tid || idTokenClaims.tfp || idTokenClaims.acr;\r\n return tenantId || null;\r\n }\r\n return null;\r\n}\n\nexport { getTenantIdFromIdTokenClaims };\n//# sourceMappingURL=TokenClaims.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\nimport { Constants, ResponseCodes, RegionDiscoverySources } from '../utils/Constants.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nclass RegionDiscovery {\r\n constructor(networkInterface, logger, performanceClient, correlationId) {\r\n this.networkInterface = networkInterface;\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n this.correlationId = correlationId;\r\n }\r\n /**\r\n * Detect the region from the application's environment.\r\n *\r\n * @returns Promise\r\n */\r\n async detectRegion(environmentRegion, regionDiscoveryMetadata) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryDetectRegion, this.correlationId);\r\n // Initialize auto detected region with the region from the envrionment\r\n let autodetectedRegionName = environmentRegion;\r\n // Check if a region was detected from the environment, if not, attempt to get the region from IMDS\r\n if (!autodetectedRegionName) {\r\n const options = RegionDiscovery.IMDS_OPTIONS;\r\n try {\r\n const localIMDSVersionResponse = await invokeAsync(this.getRegionFromIMDS.bind(this), PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.logger, this.performanceClient, this.correlationId)(Constants.IMDS_VERSION, options);\r\n if (localIMDSVersionResponse.status ===\r\n ResponseCodes.httpSuccess) {\r\n autodetectedRegionName = localIMDSVersionResponse.body;\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.IMDS;\r\n }\r\n // If the response using the local IMDS version failed, try to fetch the current version of IMDS and retry.\r\n if (localIMDSVersionResponse.status ===\r\n ResponseCodes.httpBadRequest) {\r\n const currentIMDSVersion = await invokeAsync(this.getCurrentVersion.bind(this), PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.logger, this.performanceClient, this.correlationId)(options);\r\n if (!currentIMDSVersion) {\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n return null;\r\n }\r\n const currentIMDSVersionResponse = await invokeAsync(this.getRegionFromIMDS.bind(this), PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.logger, this.performanceClient, this.correlationId)(currentIMDSVersion, options);\r\n if (currentIMDSVersionResponse.status ===\r\n ResponseCodes.httpSuccess) {\r\n autodetectedRegionName =\r\n currentIMDSVersionResponse.body;\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.IMDS;\r\n }\r\n }\r\n }\r\n catch (e) {\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n return null;\r\n }\r\n }\r\n else {\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.ENVIRONMENT_VARIABLE;\r\n }\r\n // If no region was auto detected from the environment or from the IMDS endpoint, mark the attempt as a FAILED_AUTO_DETECTION\r\n if (!autodetectedRegionName) {\r\n regionDiscoveryMetadata.region_source =\r\n RegionDiscoverySources.FAILED_AUTO_DETECTION;\r\n }\r\n return autodetectedRegionName || null;\r\n }\r\n /**\r\n * Make the call to the IMDS endpoint\r\n *\r\n * @param imdsEndpointUrl\r\n * @returns Promise>\r\n */\r\n async getRegionFromIMDS(version, options) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetRegionFromIMDS, this.correlationId);\r\n return this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?api-version=${version}&format=text`, options, Constants.IMDS_TIMEOUT);\r\n }\r\n /**\r\n * Get the most recent version of the IMDS endpoint available\r\n *\r\n * @returns Promise\r\n */\r\n async getCurrentVersion(options) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.RegionDiscoveryGetCurrentVersion, this.correlationId);\r\n try {\r\n const response = await this.networkInterface.sendGetRequestAsync(`${Constants.IMDS_ENDPOINT}?format=json`, options);\r\n // When IMDS endpoint is called without the api version query param, bad request response comes back with latest version.\r\n if (response.status === ResponseCodes.httpBadRequest &&\r\n response.body &&\r\n response.body[\"newest-versions\"] &&\r\n response.body[\"newest-versions\"].length > 0) {\r\n return response.body[\"newest-versions\"][0];\r\n }\r\n return null;\r\n }\r\n catch (e) {\r\n return null;\r\n }\r\n }\r\n}\r\n// Options for the IMDS endpoint request\r\nRegionDiscovery.IMDS_OPTIONS = {\r\n headers: {\r\n Metadata: \"true\",\r\n },\r\n};\n\nexport { RegionDiscovery };\n//# sourceMappingURL=RegionDiscovery.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\nimport { AuthorityType } from './AuthorityType.mjs';\nimport { isOpenIdConfigResponse } from './OpenIdConfigResponse.mjs';\nimport { UrlString } from '../url/UrlString.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { Constants, AuthorityMetadataSource, RegionDiscoveryOutcomes, AADAuthorityConstants } from '../utils/Constants.mjs';\nimport { EndpointMetadata, getCloudDiscoveryMetadataFromHardcodedValues, getCloudDiscoveryMetadataFromNetworkResponse, InstanceDiscoveryMetadataAliases } from './AuthorityMetadata.mjs';\nimport { createClientConfigurationError } from '../error/ClientConfigurationError.mjs';\nimport { ProtocolMode } from './ProtocolMode.mjs';\nimport { AzureCloudInstance } from './AuthorityOptions.mjs';\nimport { isCloudInstanceDiscoveryResponse } from './CloudInstanceDiscoveryResponse.mjs';\nimport { isCloudInstanceDiscoveryErrorResponse } from './CloudInstanceDiscoveryErrorResponse.mjs';\nimport { RegionDiscovery } from './RegionDiscovery.mjs';\nimport { AuthError } from '../error/AuthError.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\nimport { generateAuthorityMetadataExpiresAt, updateAuthorityEndpointMetadata, isAuthorityMetadataExpired, updateCloudDiscoveryMetadata } from '../cache/utils/CacheHelpers.mjs';\nimport { endpointResolutionError, endSessionEndpointNotSupported, openIdConfigError } from '../error/ClientAuthErrorCodes.mjs';\nimport { invalidAuthorityMetadata, untrustedAuthority, invalidCloudDiscoveryMetadata } from '../error/ClientConfigurationErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * The authority class validates the authority URIs used by the user, and retrieves the OpenID Configuration Data from the\r\n * endpoint. It will store the pertinent config data in this object for use during token calls.\r\n * @internal\r\n */\r\nclass Authority {\r\n constructor(authority, networkInterface, cacheManager, authorityOptions, logger, correlationId, performanceClient, managedIdentity) {\r\n this.canonicalAuthority = authority;\r\n this._canonicalAuthority.validateAsUri();\r\n this.networkInterface = networkInterface;\r\n this.cacheManager = cacheManager;\r\n this.authorityOptions = authorityOptions;\r\n this.regionDiscoveryMetadata = {\r\n region_used: undefined,\r\n region_source: undefined,\r\n region_outcome: undefined,\r\n };\r\n this.logger = logger;\r\n this.performanceClient = performanceClient;\r\n this.correlationId = correlationId;\r\n this.managedIdentity = managedIdentity || false;\r\n this.regionDiscovery = new RegionDiscovery(networkInterface, this.logger, this.performanceClient, this.correlationId);\r\n }\r\n /**\r\n * Get {@link AuthorityType}\r\n * @param authorityUri {@link IUri}\r\n * @private\r\n */\r\n getAuthorityType(authorityUri) {\r\n // CIAM auth url pattern is being standardized as: .ciamlogin.com\r\n if (authorityUri.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {\r\n return AuthorityType.Ciam;\r\n }\r\n const pathSegments = authorityUri.PathSegments;\r\n if (pathSegments.length) {\r\n switch (pathSegments[0].toLowerCase()) {\r\n case Constants.ADFS:\r\n return AuthorityType.Adfs;\r\n case Constants.DSTS:\r\n return AuthorityType.Dsts;\r\n }\r\n }\r\n return AuthorityType.Default;\r\n }\r\n // See above for AuthorityType\r\n get authorityType() {\r\n return this.getAuthorityType(this.canonicalAuthorityUrlComponents);\r\n }\r\n /**\r\n * ProtocolMode enum representing the way endpoints are constructed.\r\n */\r\n get protocolMode() {\r\n return this.authorityOptions.protocolMode;\r\n }\r\n /**\r\n * Returns authorityOptions which can be used to reinstantiate a new authority instance\r\n */\r\n get options() {\r\n return this.authorityOptions;\r\n }\r\n /**\r\n * A URL that is the authority set by the developer\r\n */\r\n get canonicalAuthority() {\r\n return this._canonicalAuthority.urlString;\r\n }\r\n /**\r\n * Sets canonical authority.\r\n */\r\n set canonicalAuthority(url) {\r\n this._canonicalAuthority = new UrlString(url);\r\n this._canonicalAuthority.validateAsUri();\r\n this._canonicalAuthorityUrlComponents = null;\r\n }\r\n /**\r\n * Get authority components.\r\n */\r\n get canonicalAuthorityUrlComponents() {\r\n if (!this._canonicalAuthorityUrlComponents) {\r\n this._canonicalAuthorityUrlComponents =\r\n this._canonicalAuthority.getUrlComponents();\r\n }\r\n return this._canonicalAuthorityUrlComponents;\r\n }\r\n /**\r\n * Get hostname and port i.e. login.microsoftonline.com\r\n */\r\n get hostnameAndPort() {\r\n return this.canonicalAuthorityUrlComponents.HostNameAndPort.toLowerCase();\r\n }\r\n /**\r\n * Get tenant for authority.\r\n */\r\n get tenant() {\r\n return this.canonicalAuthorityUrlComponents.PathSegments[0];\r\n }\r\n /**\r\n * OAuth /authorize endpoint for requests\r\n */\r\n get authorizationEndpoint() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.authorization_endpoint);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * OAuth /token endpoint for requests\r\n */\r\n get tokenEndpoint() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.token_endpoint);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n get deviceCodeEndpoint() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.token_endpoint.replace(\"/token\", \"/devicecode\"));\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * OAuth logout endpoint for requests\r\n */\r\n get endSessionEndpoint() {\r\n if (this.discoveryComplete()) {\r\n // ROPC policies may not have end_session_endpoint set\r\n if (!this.metadata.end_session_endpoint) {\r\n throw createClientAuthError(endSessionEndpointNotSupported);\r\n }\r\n return this.replacePath(this.metadata.end_session_endpoint);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * OAuth issuer for requests\r\n */\r\n get selfSignedJwtAudience() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.issuer);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * Jwks_uri for token signing keys\r\n */\r\n get jwksUri() {\r\n if (this.discoveryComplete()) {\r\n return this.replacePath(this.metadata.jwks_uri);\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * Returns a flag indicating that tenant name can be replaced in authority {@link IUri}\r\n * @param authorityUri {@link IUri}\r\n * @private\r\n */\r\n canReplaceTenant(authorityUri) {\r\n return (authorityUri.PathSegments.length === 1 &&\r\n !Authority.reservedTenantDomains.has(authorityUri.PathSegments[0]) &&\r\n this.getAuthorityType(authorityUri) === AuthorityType.Default &&\r\n this.protocolMode === ProtocolMode.AAD);\r\n }\r\n /**\r\n * Replaces tenant in url path with current tenant. Defaults to common.\r\n * @param urlString\r\n */\r\n replaceTenant(urlString) {\r\n return urlString.replace(/{tenant}|{tenantid}/g, this.tenant);\r\n }\r\n /**\r\n * Replaces path such as tenant or policy with the current tenant or policy.\r\n * @param urlString\r\n */\r\n replacePath(urlString) {\r\n let endpoint = urlString;\r\n const cachedAuthorityUrl = new UrlString(this.metadata.canonical_authority);\r\n const cachedAuthorityUrlComponents = cachedAuthorityUrl.getUrlComponents();\r\n const cachedAuthorityParts = cachedAuthorityUrlComponents.PathSegments;\r\n const currentAuthorityParts = this.canonicalAuthorityUrlComponents.PathSegments;\r\n currentAuthorityParts.forEach((currentPart, index) => {\r\n let cachedPart = cachedAuthorityParts[index];\r\n if (index === 0 &&\r\n this.canReplaceTenant(cachedAuthorityUrlComponents)) {\r\n const tenantId = new UrlString(this.metadata.authorization_endpoint).getUrlComponents().PathSegments[0];\r\n /**\r\n * Check if AAD canonical authority contains tenant domain name, for example \"testdomain.onmicrosoft.com\",\r\n * by comparing its first path segment to the corresponding authorization endpoint path segment, which is\r\n * always resolved with tenant id by OIDC.\r\n */\r\n if (cachedPart !== tenantId) {\r\n this.logger.verbose(`Replacing tenant domain name ${cachedPart} with id ${tenantId}`);\r\n cachedPart = tenantId;\r\n }\r\n }\r\n if (currentPart !== cachedPart) {\r\n endpoint = endpoint.replace(`/${cachedPart}/`, `/${currentPart}/`);\r\n }\r\n });\r\n return this.replaceTenant(endpoint);\r\n }\r\n /**\r\n * The default open id configuration endpoint for any canonical authority.\r\n */\r\n get defaultOpenIdConfigurationEndpoint() {\r\n const canonicalAuthorityHost = this.hostnameAndPort;\r\n if (this.canonicalAuthority.endsWith(\"v2.0/\") ||\r\n this.authorityType === AuthorityType.Adfs ||\r\n (this.protocolMode !== ProtocolMode.AAD &&\r\n !this.isAliasOfKnownMicrosoftAuthority(canonicalAuthorityHost))) {\r\n return `${this.canonicalAuthority}.well-known/openid-configuration`;\r\n }\r\n return `${this.canonicalAuthority}v2.0/.well-known/openid-configuration`;\r\n }\r\n /**\r\n * Boolean that returns whether or not tenant discovery has been completed.\r\n */\r\n discoveryComplete() {\r\n return !!this.metadata;\r\n }\r\n /**\r\n * Perform endpoint discovery to discover aliases, preferred_cache, preferred_network\r\n * and the /authorize, /token and logout endpoints.\r\n */\r\n async resolveEndpointsAsync() {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityResolveEndpointsAsync, this.correlationId);\r\n const metadataEntity = this.getCurrentMetadataEntity();\r\n const cloudDiscoverySource = await invokeAsync(this.updateCloudDiscoveryMetadata.bind(this), PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.logger, this.performanceClient, this.correlationId)(metadataEntity);\r\n this.canonicalAuthority = this.canonicalAuthority.replace(this.hostnameAndPort, metadataEntity.preferred_network);\r\n const endpointSource = await invokeAsync(this.updateEndpointMetadata.bind(this), PerformanceEvents.AuthorityUpdateEndpointMetadata, this.logger, this.performanceClient, this.correlationId)(metadataEntity);\r\n this.updateCachedMetadata(metadataEntity, cloudDiscoverySource, {\r\n source: endpointSource,\r\n });\r\n this.performanceClient?.addFields({\r\n cloudDiscoverySource: cloudDiscoverySource,\r\n authorityEndpointSource: endpointSource,\r\n }, this.correlationId);\r\n }\r\n /**\r\n * Returns metadata entity from cache if it exists, otherwiser returns a new metadata entity built\r\n * from the configured canonical authority\r\n * @returns\r\n */\r\n getCurrentMetadataEntity() {\r\n let metadataEntity = this.cacheManager.getAuthorityMetadataByAlias(this.hostnameAndPort);\r\n if (!metadataEntity) {\r\n metadataEntity = {\r\n aliases: [],\r\n preferred_cache: this.hostnameAndPort,\r\n preferred_network: this.hostnameAndPort,\r\n canonical_authority: this.canonicalAuthority,\r\n authorization_endpoint: \"\",\r\n token_endpoint: \"\",\r\n end_session_endpoint: \"\",\r\n issuer: \"\",\r\n aliasesFromNetwork: false,\r\n endpointsFromNetwork: false,\r\n expiresAt: generateAuthorityMetadataExpiresAt(),\r\n jwks_uri: \"\",\r\n };\r\n }\r\n return metadataEntity;\r\n }\r\n /**\r\n * Updates cached metadata based on metadata source and sets the instance's metadata\r\n * property to the same value\r\n * @param metadataEntity\r\n * @param cloudDiscoverySource\r\n * @param endpointMetadataResult\r\n */\r\n updateCachedMetadata(metadataEntity, cloudDiscoverySource, endpointMetadataResult) {\r\n if (cloudDiscoverySource !== AuthorityMetadataSource.CACHE &&\r\n endpointMetadataResult?.source !== AuthorityMetadataSource.CACHE) {\r\n // Reset the expiration time unless both values came from a successful cache lookup\r\n metadataEntity.expiresAt =\r\n generateAuthorityMetadataExpiresAt();\r\n metadataEntity.canonical_authority = this.canonicalAuthority;\r\n }\r\n const cacheKey = this.cacheManager.generateAuthorityMetadataCacheKey(metadataEntity.preferred_cache);\r\n this.cacheManager.setAuthorityMetadata(cacheKey, metadataEntity);\r\n this.metadata = metadataEntity;\r\n }\r\n /**\r\n * Update AuthorityMetadataEntity with new endpoints and return where the information came from\r\n * @param metadataEntity\r\n */\r\n async updateEndpointMetadata(metadataEntity) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateEndpointMetadata, this.correlationId);\r\n const localMetadata = this.updateEndpointMetadataFromLocalSources(metadataEntity);\r\n // Further update may be required for hardcoded metadata if regional metadata is preferred\r\n if (localMetadata) {\r\n if (localMetadata.source ===\r\n AuthorityMetadataSource.HARDCODED_VALUES) {\r\n // If the user prefers to use an azure region replace the global endpoints with regional information.\r\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {\r\n if (localMetadata.metadata) {\r\n const hardcodedMetadata = await invokeAsync(this.updateMetadataWithRegionalInformation.bind(this), PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.logger, this.performanceClient, this.correlationId)(localMetadata.metadata);\r\n updateAuthorityEndpointMetadata(metadataEntity, hardcodedMetadata, false);\r\n metadataEntity.canonical_authority =\r\n this.canonicalAuthority;\r\n }\r\n }\r\n }\r\n return localMetadata.source;\r\n }\r\n // Get metadata from network if local sources aren't available\r\n let metadata = await invokeAsync(this.getEndpointMetadataFromNetwork.bind(this), PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.logger, this.performanceClient, this.correlationId)();\r\n if (metadata) {\r\n // If the user prefers to use an azure region replace the global endpoints with regional information.\r\n if (this.authorityOptions.azureRegionConfiguration?.azureRegion) {\r\n metadata = await invokeAsync(this.updateMetadataWithRegionalInformation.bind(this), PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.logger, this.performanceClient, this.correlationId)(metadata);\r\n }\r\n updateAuthorityEndpointMetadata(metadataEntity, metadata, true);\r\n return AuthorityMetadataSource.NETWORK;\r\n }\r\n else {\r\n // Metadata could not be obtained from the config, cache, network or hardcoded values\r\n throw createClientAuthError(openIdConfigError, this.defaultOpenIdConfigurationEndpoint);\r\n }\r\n }\r\n /**\r\n * Updates endpoint metadata from local sources and returns where the information was retrieved from and the metadata config\r\n * response if the source is hardcoded metadata\r\n * @param metadataEntity\r\n * @returns\r\n */\r\n updateEndpointMetadataFromLocalSources(metadataEntity) {\r\n this.logger.verbose(\"Attempting to get endpoint metadata from authority configuration\");\r\n const configMetadata = this.getEndpointMetadataFromConfig();\r\n if (configMetadata) {\r\n this.logger.verbose(\"Found endpoint metadata in authority configuration\");\r\n updateAuthorityEndpointMetadata(metadataEntity, configMetadata, false);\r\n return {\r\n source: AuthorityMetadataSource.CONFIG,\r\n };\r\n }\r\n this.logger.verbose(\"Did not find endpoint metadata in the config... Attempting to get endpoint metadata from the hardcoded values.\");\r\n // skipAuthorityMetadataCache is used to bypass hardcoded authority metadata and force a network metadata cache lookup and network metadata request if no cached response is available.\r\n if (this.authorityOptions.skipAuthorityMetadataCache) {\r\n this.logger.verbose(\"Skipping hardcoded metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get endpoint metadata from the network metadata cache.\");\r\n }\r\n else {\r\n const hardcodedMetadata = this.getEndpointMetadataFromHardcodedValues();\r\n if (hardcodedMetadata) {\r\n updateAuthorityEndpointMetadata(metadataEntity, hardcodedMetadata, false);\r\n return {\r\n source: AuthorityMetadataSource.HARDCODED_VALUES,\r\n metadata: hardcodedMetadata,\r\n };\r\n }\r\n else {\r\n this.logger.verbose(\"Did not find endpoint metadata in hardcoded values... Attempting to get endpoint metadata from the network metadata cache.\");\r\n }\r\n }\r\n // Check cached metadata entity expiration status\r\n const metadataEntityExpired = isAuthorityMetadataExpired(metadataEntity);\r\n if (this.isAuthoritySameType(metadataEntity) &&\r\n metadataEntity.endpointsFromNetwork &&\r\n !metadataEntityExpired) {\r\n // No need to update\r\n this.logger.verbose(\"Found endpoint metadata in the cache.\");\r\n return { source: AuthorityMetadataSource.CACHE };\r\n }\r\n else if (metadataEntityExpired) {\r\n this.logger.verbose(\"The metadata entity is expired.\");\r\n }\r\n return null;\r\n }\r\n /**\r\n * Compares the number of url components after the domain to determine if the cached\r\n * authority metadata can be used for the requested authority. Protects against same domain different\r\n * authority such as login.microsoftonline.com/tenant and login.microsoftonline.com/tfp/tenant/policy\r\n * @param metadataEntity\r\n */\r\n isAuthoritySameType(metadataEntity) {\r\n const cachedAuthorityUrl = new UrlString(metadataEntity.canonical_authority);\r\n const cachedParts = cachedAuthorityUrl.getUrlComponents().PathSegments;\r\n return (cachedParts.length ===\r\n this.canonicalAuthorityUrlComponents.PathSegments.length);\r\n }\r\n /**\r\n * Parse authorityMetadata config option\r\n */\r\n getEndpointMetadataFromConfig() {\r\n if (this.authorityOptions.authorityMetadata) {\r\n try {\r\n return JSON.parse(this.authorityOptions.authorityMetadata);\r\n }\r\n catch (e) {\r\n throw createClientConfigurationError(invalidAuthorityMetadata);\r\n }\r\n }\r\n return null;\r\n }\r\n /**\r\n * Gets OAuth endpoints from the given OpenID configuration endpoint.\r\n *\r\n * @param hasHardcodedMetadata boolean\r\n */\r\n async getEndpointMetadataFromNetwork() {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork, this.correlationId);\r\n const options = {};\r\n /*\r\n * TODO: Add a timeout if the authority exists in our library's\r\n * hardcoded list of metadata\r\n */\r\n const openIdConfigurationEndpoint = this.defaultOpenIdConfigurationEndpoint;\r\n this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: attempting to retrieve OAuth endpoints from ${openIdConfigurationEndpoint}`);\r\n try {\r\n const response = await this.networkInterface.sendGetRequestAsync(openIdConfigurationEndpoint, options);\r\n const isValidResponse = isOpenIdConfigResponse(response.body);\r\n if (isValidResponse) {\r\n return response.body;\r\n }\r\n else {\r\n this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: could not parse response as OpenID configuration`);\r\n return null;\r\n }\r\n }\r\n catch (e) {\r\n this.logger.verbose(`Authority.getEndpointMetadataFromNetwork: ${e}`);\r\n return null;\r\n }\r\n }\r\n /**\r\n * Get OAuth endpoints for common authorities.\r\n */\r\n getEndpointMetadataFromHardcodedValues() {\r\n if (this.hostnameAndPort in EndpointMetadata) {\r\n return EndpointMetadata[this.hostnameAndPort];\r\n }\r\n return null;\r\n }\r\n /**\r\n * Update the retrieved metadata with regional information.\r\n * User selected Azure region will be used if configured.\r\n */\r\n async updateMetadataWithRegionalInformation(metadata) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation, this.correlationId);\r\n const userConfiguredAzureRegion = this.authorityOptions.azureRegionConfiguration?.azureRegion;\r\n if (userConfiguredAzureRegion) {\r\n if (userConfiguredAzureRegion !==\r\n Constants.AZURE_REGION_AUTO_DISCOVER_FLAG) {\r\n this.regionDiscoveryMetadata.region_outcome =\r\n RegionDiscoveryOutcomes.CONFIGURED_NO_AUTO_DETECTION;\r\n this.regionDiscoveryMetadata.region_used =\r\n userConfiguredAzureRegion;\r\n return Authority.replaceWithRegionalInformation(metadata, userConfiguredAzureRegion);\r\n }\r\n const autodetectedRegionName = await invokeAsync(this.regionDiscovery.detectRegion.bind(this.regionDiscovery), PerformanceEvents.RegionDiscoveryDetectRegion, this.logger, this.performanceClient, this.correlationId)(this.authorityOptions.azureRegionConfiguration\r\n ?.environmentRegion, this.regionDiscoveryMetadata);\r\n if (autodetectedRegionName) {\r\n this.regionDiscoveryMetadata.region_outcome =\r\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_SUCCESSFUL;\r\n this.regionDiscoveryMetadata.region_used =\r\n autodetectedRegionName;\r\n return Authority.replaceWithRegionalInformation(metadata, autodetectedRegionName);\r\n }\r\n this.regionDiscoveryMetadata.region_outcome =\r\n RegionDiscoveryOutcomes.AUTO_DETECTION_REQUESTED_FAILED;\r\n }\r\n return metadata;\r\n }\r\n /**\r\n * Updates the AuthorityMetadataEntity with new aliases, preferred_network and preferred_cache\r\n * and returns where the information was retrieved from\r\n * @param metadataEntity\r\n * @returns AuthorityMetadataSource\r\n */\r\n async updateCloudDiscoveryMetadata(metadataEntity) {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata, this.correlationId);\r\n const localMetadataSource = this.updateCloudDiscoveryMetadataFromLocalSources(metadataEntity);\r\n if (localMetadataSource) {\r\n return localMetadataSource;\r\n }\r\n // Fallback to network as metadata source\r\n const metadata = await invokeAsync(this.getCloudDiscoveryMetadataFromNetwork.bind(this), PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.logger, this.performanceClient, this.correlationId)();\r\n if (metadata) {\r\n updateCloudDiscoveryMetadata(metadataEntity, metadata, true);\r\n return AuthorityMetadataSource.NETWORK;\r\n }\r\n // Metadata could not be obtained from the config, cache, network or hardcoded values\r\n throw createClientConfigurationError(untrustedAuthority);\r\n }\r\n updateCloudDiscoveryMetadataFromLocalSources(metadataEntity) {\r\n this.logger.verbose(\"Attempting to get cloud discovery metadata from authority configuration\");\r\n this.logger.verbosePii(`Known Authorities: ${this.authorityOptions.knownAuthorities ||\r\n Constants.NOT_APPLICABLE}`);\r\n this.logger.verbosePii(`Authority Metadata: ${this.authorityOptions.authorityMetadata ||\r\n Constants.NOT_APPLICABLE}`);\r\n this.logger.verbosePii(`Canonical Authority: ${metadataEntity.canonical_authority || Constants.NOT_APPLICABLE}`);\r\n const metadata = this.getCloudDiscoveryMetadataFromConfig();\r\n if (metadata) {\r\n this.logger.verbose(\"Found cloud discovery metadata in authority configuration\");\r\n updateCloudDiscoveryMetadata(metadataEntity, metadata, false);\r\n return AuthorityMetadataSource.CONFIG;\r\n }\r\n // If the cached metadata came from config but that config was not passed to this instance, we must go to hardcoded values\r\n this.logger.verbose(\"Did not find cloud discovery metadata in the config... Attempting to get cloud discovery metadata from the hardcoded values.\");\r\n if (this.options.skipAuthorityMetadataCache) {\r\n this.logger.verbose(\"Skipping hardcoded cloud discovery metadata cache since skipAuthorityMetadataCache is set to true. Attempting to get cloud discovery metadata from the network metadata cache.\");\r\n }\r\n else {\r\n const hardcodedMetadata = getCloudDiscoveryMetadataFromHardcodedValues(this.hostnameAndPort);\r\n if (hardcodedMetadata) {\r\n this.logger.verbose(\"Found cloud discovery metadata from hardcoded values.\");\r\n updateCloudDiscoveryMetadata(metadataEntity, hardcodedMetadata, false);\r\n return AuthorityMetadataSource.HARDCODED_VALUES;\r\n }\r\n this.logger.verbose(\"Did not find cloud discovery metadata in hardcoded values... Attempting to get cloud discovery metadata from the network metadata cache.\");\r\n }\r\n const metadataEntityExpired = isAuthorityMetadataExpired(metadataEntity);\r\n if (this.isAuthoritySameType(metadataEntity) &&\r\n metadataEntity.aliasesFromNetwork &&\r\n !metadataEntityExpired) {\r\n this.logger.verbose(\"Found cloud discovery metadata in the cache.\");\r\n // No need to update\r\n return AuthorityMetadataSource.CACHE;\r\n }\r\n else if (metadataEntityExpired) {\r\n this.logger.verbose(\"The metadata entity is expired.\");\r\n }\r\n return null;\r\n }\r\n /**\r\n * Parse cloudDiscoveryMetadata config or check knownAuthorities\r\n */\r\n getCloudDiscoveryMetadataFromConfig() {\r\n // CIAM does not support cloud discovery metadata\r\n if (this.authorityType === AuthorityType.Ciam) {\r\n this.logger.verbose(\"CIAM authorities do not support cloud discovery metadata, generate the aliases from authority host.\");\r\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n // Check if network response was provided in config\r\n if (this.authorityOptions.cloudDiscoveryMetadata) {\r\n this.logger.verbose(\"The cloud discovery metadata has been provided as a network response, in the config.\");\r\n try {\r\n this.logger.verbose(\"Attempting to parse the cloud discovery metadata.\");\r\n const parsedResponse = JSON.parse(this.authorityOptions.cloudDiscoveryMetadata);\r\n const metadata = getCloudDiscoveryMetadataFromNetworkResponse(parsedResponse.metadata, this.hostnameAndPort);\r\n this.logger.verbose(\"Parsed the cloud discovery metadata.\");\r\n if (metadata) {\r\n this.logger.verbose(\"There is returnable metadata attached to the parsed cloud discovery metadata.\");\r\n return metadata;\r\n }\r\n else {\r\n this.logger.verbose(\"There is no metadata attached to the parsed cloud discovery metadata.\");\r\n }\r\n }\r\n catch (e) {\r\n this.logger.verbose(\"Unable to parse the cloud discovery metadata. Throwing Invalid Cloud Discovery Metadata Error.\");\r\n throw createClientConfigurationError(invalidCloudDiscoveryMetadata);\r\n }\r\n }\r\n // If cloudDiscoveryMetadata is empty or does not contain the host, check knownAuthorities\r\n if (this.isInKnownAuthorities()) {\r\n this.logger.verbose(\"The host is included in knownAuthorities. Creating new cloud discovery metadata from the host.\");\r\n return Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n return null;\r\n }\r\n /**\r\n * Called to get metadata from network if CloudDiscoveryMetadata was not populated by config\r\n *\r\n * @param hasHardcodedMetadata boolean\r\n */\r\n async getCloudDiscoveryMetadataFromNetwork() {\r\n this.performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork, this.correlationId);\r\n const instanceDiscoveryEndpoint = `${Constants.AAD_INSTANCE_DISCOVERY_ENDPT}${this.canonicalAuthority}oauth2/v2.0/authorize`;\r\n const options = {};\r\n /*\r\n * TODO: Add a timeout if the authority exists in our library's\r\n * hardcoded list of metadata\r\n */\r\n let match = null;\r\n try {\r\n const response = await this.networkInterface.sendGetRequestAsync(instanceDiscoveryEndpoint, options);\r\n let typedResponseBody;\r\n let metadata;\r\n if (isCloudInstanceDiscoveryResponse(response.body)) {\r\n typedResponseBody =\r\n response.body;\r\n metadata = typedResponseBody.metadata;\r\n this.logger.verbosePii(`tenant_discovery_endpoint is: ${typedResponseBody.tenant_discovery_endpoint}`);\r\n }\r\n else if (isCloudInstanceDiscoveryErrorResponse(response.body)) {\r\n this.logger.warning(`A CloudInstanceDiscoveryErrorResponse was returned. The cloud instance discovery network request's status code is: ${response.status}`);\r\n typedResponseBody =\r\n response.body;\r\n if (typedResponseBody.error === Constants.INVALID_INSTANCE) {\r\n this.logger.error(\"The CloudInstanceDiscoveryErrorResponse error is invalid_instance.\");\r\n return null;\r\n }\r\n this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error is ${typedResponseBody.error}`);\r\n this.logger.warning(`The CloudInstanceDiscoveryErrorResponse error description is ${typedResponseBody.error_description}`);\r\n this.logger.warning(\"Setting the value of the CloudInstanceDiscoveryMetadata (returned from the network) to []\");\r\n metadata = [];\r\n }\r\n else {\r\n this.logger.error(\"AAD did not return a CloudInstanceDiscoveryResponse or CloudInstanceDiscoveryErrorResponse\");\r\n return null;\r\n }\r\n this.logger.verbose(\"Attempting to find a match between the developer's authority and the CloudInstanceDiscoveryMetadata returned from the network request.\");\r\n match = getCloudDiscoveryMetadataFromNetworkResponse(metadata, this.hostnameAndPort);\r\n }\r\n catch (error) {\r\n if (error instanceof AuthError) {\r\n this.logger.error(`There was a network error while attempting to get the cloud discovery instance metadata.\\nError: ${error.errorCode}\\nError Description: ${error.errorMessage}`);\r\n }\r\n else {\r\n const typedError = error;\r\n this.logger.error(`A non-MSALJS error was thrown while attempting to get the cloud instance discovery metadata.\\nError: ${typedError.name}\\nError Description: ${typedError.message}`);\r\n }\r\n return null;\r\n }\r\n // Custom Domain scenario, host is trusted because Instance Discovery call succeeded\r\n if (!match) {\r\n this.logger.warning(\"The developer's authority was not found within the CloudInstanceDiscoveryMetadata returned from the network request.\");\r\n this.logger.verbose(\"Creating custom Authority for custom domain scenario.\");\r\n match = Authority.createCloudDiscoveryMetadataFromHost(this.hostnameAndPort);\r\n }\r\n return match;\r\n }\r\n /**\r\n * Helper function to determine if this host is included in the knownAuthorities config option\r\n */\r\n isInKnownAuthorities() {\r\n const matches = this.authorityOptions.knownAuthorities.filter((authority) => {\r\n return (authority &&\r\n UrlString.getDomainFromUrl(authority).toLowerCase() ===\r\n this.hostnameAndPort);\r\n });\r\n return matches.length > 0;\r\n }\r\n /**\r\n * helper function to populate the authority based on azureCloudOptions\r\n * @param authorityString\r\n * @param azureCloudOptions\r\n */\r\n static generateAuthority(authorityString, azureCloudOptions) {\r\n let authorityAzureCloudInstance;\r\n if (azureCloudOptions &&\r\n azureCloudOptions.azureCloudInstance !== AzureCloudInstance.None) {\r\n const tenant = azureCloudOptions.tenant\r\n ? azureCloudOptions.tenant\r\n : Constants.DEFAULT_COMMON_TENANT;\r\n authorityAzureCloudInstance = `${azureCloudOptions.azureCloudInstance}/${tenant}/`;\r\n }\r\n return authorityAzureCloudInstance\r\n ? authorityAzureCloudInstance\r\n : authorityString;\r\n }\r\n /**\r\n * Creates cloud discovery metadata object from a given host\r\n * @param host\r\n */\r\n static createCloudDiscoveryMetadataFromHost(host) {\r\n return {\r\n preferred_network: host,\r\n preferred_cache: host,\r\n aliases: [host],\r\n };\r\n }\r\n /**\r\n * helper function to generate environment from authority object\r\n */\r\n getPreferredCache() {\r\n if (this.managedIdentity) {\r\n return Constants.DEFAULT_AUTHORITY_HOST;\r\n }\r\n else if (this.discoveryComplete()) {\r\n return this.metadata.preferred_cache;\r\n }\r\n else {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n }\r\n /**\r\n * Returns whether or not the provided host is an alias of this authority instance\r\n * @param host\r\n */\r\n isAlias(host) {\r\n return this.metadata.aliases.indexOf(host) > -1;\r\n }\r\n /**\r\n * Returns whether or not the provided host is an alias of a known Microsoft authority for purposes of endpoint discovery\r\n * @param host\r\n */\r\n isAliasOfKnownMicrosoftAuthority(host) {\r\n return InstanceDiscoveryMetadataAliases.has(host);\r\n }\r\n /**\r\n * Checks whether the provided host is that of a public cloud authority\r\n *\r\n * @param authority string\r\n * @returns bool\r\n */\r\n static isPublicCloudAuthority(host) {\r\n return Constants.KNOWN_PUBLIC_CLOUDS.indexOf(host) >= 0;\r\n }\r\n /**\r\n * Rebuild the authority string with the region\r\n *\r\n * @param host string\r\n * @param region string\r\n */\r\n static buildRegionalAuthorityString(host, region, queryString) {\r\n // Create and validate a Url string object with the initial authority string\r\n const authorityUrlInstance = new UrlString(host);\r\n authorityUrlInstance.validateAsUri();\r\n const authorityUrlParts = authorityUrlInstance.getUrlComponents();\r\n let hostNameAndPort = `${region}.${authorityUrlParts.HostNameAndPort}`;\r\n if (this.isPublicCloudAuthority(authorityUrlParts.HostNameAndPort)) {\r\n hostNameAndPort = `${region}.${Constants.REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX}`;\r\n }\r\n // Include the query string portion of the url\r\n const url = UrlString.constructAuthorityUriFromObject({\r\n ...authorityUrlInstance.getUrlComponents(),\r\n HostNameAndPort: hostNameAndPort,\r\n }).urlString;\r\n // Add the query string if a query string was provided\r\n if (queryString)\r\n return `${url}?${queryString}`;\r\n return url;\r\n }\r\n /**\r\n * Replace the endpoints in the metadata object with their regional equivalents.\r\n *\r\n * @param metadata OpenIdConfigResponse\r\n * @param azureRegion string\r\n */\r\n static replaceWithRegionalInformation(metadata, azureRegion) {\r\n const regionalMetadata = { ...metadata };\r\n regionalMetadata.authorization_endpoint =\r\n Authority.buildRegionalAuthorityString(regionalMetadata.authorization_endpoint, azureRegion);\r\n regionalMetadata.token_endpoint =\r\n Authority.buildRegionalAuthorityString(regionalMetadata.token_endpoint, azureRegion);\r\n if (regionalMetadata.end_session_endpoint) {\r\n regionalMetadata.end_session_endpoint =\r\n Authority.buildRegionalAuthorityString(regionalMetadata.end_session_endpoint, azureRegion);\r\n }\r\n return regionalMetadata;\r\n }\r\n /**\r\n * Transform CIAM_AUTHORIY as per the below rules:\r\n * If no path segments found and it is a CIAM authority (hostname ends with .ciamlogin.com), then transform it\r\n *\r\n * NOTE: The transformation path should go away once STS supports CIAM with the format: `tenantIdorDomain.ciamlogin.com`\r\n * `ciamlogin.com` can also change in the future and we should accommodate the same\r\n *\r\n * @param authority\r\n */\r\n static transformCIAMAuthority(authority) {\r\n let ciamAuthority = authority;\r\n const authorityUrl = new UrlString(authority);\r\n const authorityUrlComponents = authorityUrl.getUrlComponents();\r\n // check if transformation is needed\r\n if (authorityUrlComponents.PathSegments.length === 0 &&\r\n authorityUrlComponents.HostNameAndPort.endsWith(Constants.CIAM_AUTH_URL)) {\r\n const tenantIdOrDomain = authorityUrlComponents.HostNameAndPort.split(\".\")[0];\r\n ciamAuthority = `${ciamAuthority}${tenantIdOrDomain}${Constants.AAD_TENANT_DOMAIN_SUFFIX}`;\r\n }\r\n return ciamAuthority;\r\n }\r\n}\r\n// Reserved tenant domain names that will not be replaced with tenant id\r\nAuthority.reservedTenantDomains = new Set([\r\n \"{tenant}\",\r\n \"{tenantid}\",\r\n AADAuthorityConstants.COMMON,\r\n AADAuthorityConstants.CONSUMERS,\r\n AADAuthorityConstants.ORGANIZATIONS,\r\n]);\r\n/**\r\n * Extract tenantId from authority\r\n */\r\nfunction getTenantFromAuthorityString(authority) {\r\n const authorityUrl = new UrlString(authority);\r\n const authorityUrlComponents = authorityUrl.getUrlComponents();\r\n /**\r\n * For credential matching purposes, tenantId is the last path segment of the authority URL:\r\n * AAD Authority - domain/tenantId -> Credentials are cached with realm = tenantId\r\n * B2C Authority - domain/{tenantId}?/.../policy -> Credentials are cached with realm = policy\r\n * tenantId is downcased because B2C policies can have mixed case but tfp claim is downcased\r\n *\r\n * Note that we may not have any path segments in certain OIDC scenarios.\r\n */\r\n const tenantId = authorityUrlComponents.PathSegments.slice(-1)[0]?.toLowerCase();\r\n switch (tenantId) {\r\n case AADAuthorityConstants.COMMON:\r\n case AADAuthorityConstants.ORGANIZATIONS:\r\n case AADAuthorityConstants.CONSUMERS:\r\n return undefined;\r\n default:\r\n return tenantId;\r\n }\r\n}\r\nfunction formatAuthorityUri(authorityUri) {\r\n return authorityUri.endsWith(Constants.FORWARD_SLASH)\r\n ? authorityUri\r\n : `${authorityUri}${Constants.FORWARD_SLASH}`;\r\n}\r\nfunction buildStaticAuthorityOptions(authOptions) {\r\n const rawCloudDiscoveryMetadata = authOptions.cloudDiscoveryMetadata;\r\n let cloudDiscoveryMetadata = undefined;\r\n if (rawCloudDiscoveryMetadata) {\r\n try {\r\n cloudDiscoveryMetadata = JSON.parse(rawCloudDiscoveryMetadata);\r\n }\r\n catch (e) {\r\n throw createClientConfigurationError(invalidCloudDiscoveryMetadata);\r\n }\r\n }\r\n return {\r\n canonicalAuthority: authOptions.authority\r\n ? formatAuthorityUri(authOptions.authority)\r\n : undefined,\r\n knownAuthorities: authOptions.knownAuthorities,\r\n cloudDiscoveryMetadata: cloudDiscoveryMetadata,\r\n };\r\n}\n\nexport { Authority, buildStaticAuthorityOptions, formatAuthorityUri, getTenantFromAuthorityString };\n//# sourceMappingURL=Authority.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isOpenIdConfigResponse(response) {\r\n return (response.hasOwnProperty(\"authorization_endpoint\") &&\r\n response.hasOwnProperty(\"token_endpoint\") &&\r\n response.hasOwnProperty(\"issuer\") &&\r\n response.hasOwnProperty(\"jwks_uri\"));\r\n}\n\nexport { isOpenIdConfigResponse };\n//# sourceMappingURL=OpenIdConfigResponse.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isCloudInstanceDiscoveryResponse(response) {\r\n return (response.hasOwnProperty(\"tenant_discovery_endpoint\") &&\r\n response.hasOwnProperty(\"metadata\"));\r\n}\n\nexport { isCloudInstanceDiscoveryResponse };\n//# sourceMappingURL=CloudInstanceDiscoveryResponse.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nfunction isCloudInstanceDiscoveryErrorResponse(response) {\r\n return (response.hasOwnProperty(\"error\") &&\r\n response.hasOwnProperty(\"error_description\"));\r\n}\n\nexport { isCloudInstanceDiscoveryErrorResponse };\n//# sourceMappingURL=CloudInstanceDiscoveryErrorResponse.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\nimport { Authority, formatAuthorityUri } from './Authority.mjs';\nimport { createClientAuthError } from '../error/ClientAuthError.mjs';\nimport { PerformanceEvents } from '../telemetry/performance/PerformanceEvent.mjs';\nimport { invokeAsync } from '../utils/FunctionWrappers.mjs';\nimport { endpointResolutionError } from '../error/ClientAuthErrorCodes.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Create an authority object of the correct type based on the url\r\n * Performs basic authority validation - checks to see if the authority is of a valid type (i.e. aad, b2c, adfs)\r\n *\r\n * Also performs endpoint discovery.\r\n *\r\n * @param authorityUri\r\n * @param networkClient\r\n * @param protocolMode\r\n * @internal\r\n */\r\nasync function createDiscoveredInstance(authorityUri, networkClient, cacheManager, authorityOptions, logger, correlationId, performanceClient) {\r\n performanceClient?.addQueueMeasurement(PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance, correlationId);\r\n const authorityUriFinal = Authority.transformCIAMAuthority(formatAuthorityUri(authorityUri));\r\n // Initialize authority and perform discovery endpoint check.\r\n const acquireTokenAuthority = new Authority(authorityUriFinal, networkClient, cacheManager, authorityOptions, logger, correlationId, performanceClient);\r\n try {\r\n await invokeAsync(acquireTokenAuthority.resolveEndpointsAsync.bind(acquireTokenAuthority), PerformanceEvents.AuthorityResolveEndpointsAsync, logger, performanceClient, correlationId)();\r\n return acquireTokenAuthority;\r\n }\r\n catch (e) {\r\n throw createClientAuthError(endpointResolutionError);\r\n }\r\n}\n\nexport { createDiscoveredInstance };\n//# sourceMappingURL=AuthorityFactory.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\nimport { UrlString } from '../url/UrlString.mjs';\nimport { AuthorityMetadataSource } from '../utils/Constants.mjs';\n\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst rawMetdataJSON = {\r\n endpointMetadata: {\r\n \"login.microsoftonline.com\": {\r\n token_endpoint: \"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/token\",\r\n jwks_uri: \"https://login.microsoftonline.com/{tenantid}/discovery/v2.0/keys\",\r\n issuer: \"https://login.microsoftonline.com/{tenantid}/v2.0\",\r\n authorization_endpoint: \"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/authorize\",\r\n end_session_endpoint: \"https://login.microsoftonline.com/{tenantid}/oauth2/v2.0/logout\",\r\n },\r\n \"login.chinacloudapi.cn\": {\r\n token_endpoint: \"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/token\",\r\n jwks_uri: \"https://login.chinacloudapi.cn/{tenantid}/discovery/v2.0/keys\",\r\n issuer: \"https://login.partner.microsoftonline.cn/{tenantid}/v2.0\",\r\n authorization_endpoint: \"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/authorize\",\r\n end_session_endpoint: \"https://login.chinacloudapi.cn/{tenantid}/oauth2/v2.0/logout\",\r\n },\r\n \"login.microsoftonline.us\": {\r\n token_endpoint: \"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/token\",\r\n jwks_uri: \"https://login.microsoftonline.us/{tenantid}/discovery/v2.0/keys\",\r\n issuer: \"https://login.microsoftonline.us/{tenantid}/v2.0\",\r\n authorization_endpoint: \"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/authorize\",\r\n end_session_endpoint: \"https://login.microsoftonline.us/{tenantid}/oauth2/v2.0/logout\",\r\n },\r\n },\r\n instanceDiscoveryMetadata: {\r\n tenant_discovery_endpoint: \"https://{canonicalAuthority}/v2.0/.well-known/openid-configuration\",\r\n metadata: [\r\n {\r\n preferred_network: \"login.microsoftonline.com\",\r\n preferred_cache: \"login.windows.net\",\r\n aliases: [\r\n \"login.microsoftonline.com\",\r\n \"login.windows.net\",\r\n \"login.microsoft.com\",\r\n \"sts.windows.net\",\r\n ],\r\n },\r\n {\r\n preferred_network: \"login.partner.microsoftonline.cn\",\r\n preferred_cache: \"login.partner.microsoftonline.cn\",\r\n aliases: [\r\n \"login.partner.microsoftonline.cn\",\r\n \"login.chinacloudapi.cn\",\r\n ],\r\n },\r\n {\r\n preferred_network: \"login.microsoftonline.de\",\r\n preferred_cache: \"login.microsoftonline.de\",\r\n aliases: [\"login.microsoftonline.de\"],\r\n },\r\n {\r\n preferred_network: \"login.microsoftonline.us\",\r\n preferred_cache: \"login.microsoftonline.us\",\r\n aliases: [\r\n \"login.microsoftonline.us\",\r\n \"login.usgovcloudapi.net\",\r\n ],\r\n },\r\n {\r\n preferred_network: \"login-us.microsoftonline.com\",\r\n preferred_cache: \"login-us.microsoftonline.com\",\r\n aliases: [\"login-us.microsoftonline.com\"],\r\n },\r\n ],\r\n },\r\n};\r\nconst EndpointMetadata = rawMetdataJSON.endpointMetadata;\r\nconst InstanceDiscoveryMetadata = rawMetdataJSON.instanceDiscoveryMetadata;\r\nconst InstanceDiscoveryMetadataAliases = new Set();\r\nInstanceDiscoveryMetadata.metadata.forEach((metadataEntry) => {\r\n metadataEntry.aliases.forEach((alias) => {\r\n InstanceDiscoveryMetadataAliases.add(alias);\r\n });\r\n});\r\n/**\r\n * Attempts to get an aliases array from the static authority metadata sources based on the canonical authority host\r\n * @param staticAuthorityOptions\r\n * @param logger\r\n * @returns\r\n */\r\nfunction getAliasesFromStaticSources(staticAuthorityOptions, logger) {\r\n let staticAliases;\r\n const canonicalAuthority = staticAuthorityOptions.canonicalAuthority;\r\n if (canonicalAuthority) {\r\n const authorityHost = new UrlString(canonicalAuthority).getUrlComponents().HostNameAndPort;\r\n staticAliases =\r\n getAliasesFromMetadata(authorityHost, staticAuthorityOptions.cloudDiscoveryMetadata?.metadata, AuthorityMetadataSource.CONFIG, logger) ||\r\n getAliasesFromMetadata(authorityHost, InstanceDiscoveryMetadata.metadata, AuthorityMetadataSource.HARDCODED_VALUES, logger) ||\r\n staticAuthorityOptions.knownAuthorities;\r\n }\r\n return staticAliases || [];\r\n}\r\n/**\r\n * Returns aliases for from the raw cloud discovery metadata passed in\r\n * @param authorityHost\r\n * @param rawCloudDiscoveryMetadata\r\n * @returns\r\n */\r\nfunction getAliasesFromMetadata(authorityHost, cloudDiscoveryMetadata, source, logger) {\r\n logger?.trace(`getAliasesFromMetadata called with source: ${source}`);\r\n if (authorityHost && cloudDiscoveryMetadata) {\r\n const metadata = getCloudDiscoveryMetadataFromNetworkResponse(cloudDiscoveryMetadata, authorityHost);\r\n if (metadata) {\r\n logger?.trace(`getAliasesFromMetadata: found cloud discovery metadata in ${source}, returning aliases`);\r\n return metadata.aliases;\r\n }\r\n else {\r\n logger?.trace(`getAliasesFromMetadata: did not find cloud discovery metadata in ${source}`);\r\n }\r\n }\r\n return null;\r\n}\r\n/**\r\n * Get cloud discovery metadata for common authorities\r\n */\r\nfunction getCloudDiscoveryMetadataFromHardcodedValues(authorityHost) {\r\n const metadata = getCloudDiscoveryMetadataFromNetworkResponse(InstanceDiscoveryMetadata.metadata, authorityHost);\r\n return metadata;\r\n}\r\n/**\r\n * Searches instance discovery network response for the entry that contains the host in the aliases list\r\n * @param response\r\n * @param authority\r\n */\r\nfunction getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {\r\n for (let i = 0; i < response.length; i++) {\r\n const metadata = response[i];\r\n if (metadata.aliases.includes(authorityHost)) {\r\n return metadata;\r\n }\r\n }\r\n return null;\r\n}\n\nexport { EndpointMetadata, InstanceDiscoveryMetadata, InstanceDiscoveryMetadataAliases, getAliasesFromMetadata, getAliasesFromStaticSources, getCloudDiscoveryMetadataFromHardcodedValues, getCloudDiscoveryMetadataFromNetworkResponse, rawMetdataJSON };\n//# sourceMappingURL=AuthorityMetadata.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\nconst AzureCloudInstance = {\r\n // AzureCloudInstance is not specified.\r\n None: \"none\",\r\n // Microsoft Azure public cloud\r\n AzurePublic: \"https://login.microsoftonline.com\",\r\n // Microsoft PPE\r\n AzurePpe: \"https://login.windows-ppe.net\",\r\n // Microsoft Chinese national/regional cloud\r\n AzureChina: \"https://login.chinacloudapi.cn\",\r\n // Microsoft German national/regional cloud (\"Black Forest\")\r\n AzureGermany: \"https://login.microsoftonline.de\",\r\n // US Government cloud\r\n AzureUsGovernment: \"https://login.microsoftonline.us\",\r\n};\n\nexport { AzureCloudInstance };\n//# sourceMappingURL=AuthorityOptions.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Authority types supported by MSAL.\r\n */\r\nconst AuthorityType = {\r\n Default: 0,\r\n Adfs: 1,\r\n Dsts: 2,\r\n Ciam: 3,\r\n};\n\nexport { AuthorityType };\n//# sourceMappingURL=AuthorityType.mjs.map\n","/*! @azure/msal-common v14.14.2 2024-08-28 */\n'use strict';\n/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n/**\r\n * Protocol modes supported by MSAL.\r\n */\r\nconst ProtocolMode = {\r\n AAD: \"AAD\",\r\n OIDC: \"OIDC\",\r\n};\n\nexport { ProtocolMode };\n//# sourceMappingURL=ProtocolMode.mjs.map\n"],"names":["tenantIdMatchesHomeTenant","tenantId","homeAccountId","split","buildTenantProfile","localAccountId","idTokenClaims","oid","sub","tid","name","tfp","acr","isHomeTenant","updateAccountTenantProfileData","baseAccountInfo","tenantProfile","idTokenSecret","updatedAccountInfo","tenantProfileOverride","claimsSourcedTenantProfile","idToken","extractTokenClaims","encodedToken","base64Decode","jswPayload","authToken","matches","exec","length","getJWSPayload","base64Decoded","JSON","parse","err","checkMaxAge","authTime","maxAge","Date","now","CcsCredentialType","HOME_ACCOUNT_ID","UPN","buildClientInfo","rawClientInfo","decodedClientInfo","e","buildClientInfoFromHomeAccountId","clientInfoParts","uid","utid","getTenantIdFromIdTokenClaims","RegionDiscovery","constructor","networkInterface","logger","performanceClient","correlationId","this","async","environmentRegion","regionDiscoveryMetadata","addQueueMeasurement","PerformanceEvent","autodetectedRegionName","region_source","options","IMDS_OPTIONS","localIMDSVersionResponse","i","getRegionFromIMDS","bind","Constants","status","body","currentIMDSVersion","getCurrentVersion","currentIMDSVersionResponse","version","sendGetRequestAsync","response","headers","Metadata","Authority","authority","cacheManager","authorityOptions","managedIdentity","canonicalAuthority","_canonicalAuthority","validateAsUri","region_used","undefined","region_outcome","regionDiscovery","getAuthorityType","authorityUri","HostNameAndPort","endsWith","AuthorityType","pathSegments","PathSegments","toLowerCase","authorityType","canonicalAuthorityUrlComponents","protocolMode","urlString","url","UrlString","_canonicalAuthorityUrlComponents","getUrlComponents","hostnameAndPort","tenant","authorizationEndpoint","discoveryComplete","replacePath","metadata","authorization_endpoint","tokenEndpoint","token_endpoint","deviceCodeEndpoint","replace","endSessionEndpoint","end_session_endpoint","selfSignedJwtAudience","issuer","jwksUri","jwks_uri","canReplaceTenant","reservedTenantDomains","has","ProtocolMode","replaceTenant","endpoint","cachedAuthorityUrlComponents","canonical_authority","cachedAuthorityParts","forEach","currentPart","index","cachedPart","verbose","defaultOpenIdConfigurationEndpoint","canonicalAuthorityHost","isAliasOfKnownMicrosoftAuthority","metadataEntity","getCurrentMetadataEntity","cloudDiscoverySource","updateCloudDiscoveryMetadata","preferred_network","endpointSource","updateEndpointMetadata","updateCachedMetadata","source","addFields","authorityEndpointSource","getAuthorityMetadataByAlias","aliases","preferred_cache","aliasesFromNetwork","endpointsFromNetwork","expiresAt","endpointMetadataResult","cacheKey","generateAuthorityMetadataCacheKey","setAuthorityMetadata","localMetadata","updateEndpointMetadataFromLocalSources","azureRegionConfiguration","azureRegion","hardcodedMetadata","updateMetadataWithRegionalInformation","getEndpointMetadataFromNetwork","configMetadata","getEndpointMetadataFromConfig","skipAuthorityMetadataCache","getEndpointMetadataFromHardcodedValues","metadataEntityExpired","isAuthoritySameType","authorityMetadata","openIdConfigurationEndpoint","isValidResponse","hasOwnProperty","isOpenIdConfigResponse","userConfiguredAzureRegion","replaceWithRegionalInformation","detectRegion","localMetadataSource","updateCloudDiscoveryMetadataFromLocalSources","getCloudDiscoveryMetadataFromNetwork","verbosePii","knownAuthorities","getCloudDiscoveryMetadataFromConfig","createCloudDiscoveryMetadataFromHost","cloudDiscoveryMetadata","parsedResponse","isInKnownAuthorities","instanceDiscoveryEndpoint","match","typedResponseBody","isCloudInstanceDiscoveryResponse","tenant_discovery_endpoint","isCloudInstanceDiscoveryErrorResponse","error","warning","error_description","AuthError","errorCode","errorMessage","typedError","message","filter","static","authorityString","azureCloudOptions","authorityAzureCloudInstance","azureCloudInstance","host","getPreferredCache","isAlias","indexOf","region","queryString","authorityUrlInstance","authorityUrlParts","hostNameAndPort","isPublicCloudAuthority","regionalMetadata","buildRegionalAuthorityString","ciamAuthority","authorityUrlComponents","getTenantFromAuthorityString","slice","formatAuthorityUri","buildStaticAuthorityOptions","authOptions","rawCloudDiscoveryMetadata","Set","createDiscoveredInstance","networkClient","authorityUriFinal","acquireTokenAuthority","resolveEndpointsAsync","EndpointMetadata","InstanceDiscoveryMetadata","InstanceDiscoveryMetadataAliases","getAliasesFromStaticSources","staticAuthorityOptions","staticAliases","authorityHost","getAliasesFromMetadata","trace","getCloudDiscoveryMetadataFromNetworkResponse","getCloudDiscoveryMetadataFromHardcodedValues","includes","metadataEntry","alias","add","AzureCloudInstance","None","AzurePublic","AzurePpe","AzureChina","AzureGermany","AzureUsGovernment","Default","Adfs","Dsts","Ciam","AAD","OIDC"],"sourceRoot":""}