<PackageReference Include="Microsoft.Identity.Client" Version="4.83.3" />

Microsoft.Identity.Client.Instance.Discovery.InstanceDiscoveryManager

Priority order of metadata providers: If user provided metadata via WithInstanceDiscoveryMetadata use it exclusively. Otherwise: 1. Static cache (this is populated from the network) 2. Well-known cache if all environments present in the token cache are known (this is hard-coded into MSAL) 3. Cache stored in token cache (Not currently implemented) 5. AAD discovery endpoint 6. If going to the network fails with an error different than "invalid_instance" (i.e.authority validation failed), use the well-known instance metadata entry for the given authority 7. On failure, use the authority itself(i.e.preferred cache = preferred network = aliases = configured_authority) Spec: https://identitydivision.visualstudio.com/DevEx/_git/AuthLibrariesApiReview?path=%2FInstance%20Discovery%20Caching%2Fdesktop_web_caching.md
public InstanceDiscoveryManager(IHttpManager httpManager, InstanceDiscoveryResponse userProvidedInstanceDiscoveryResponse = null, Uri userProvidedInstanceDiscoveryUri = null)

public InstanceDiscoveryManager(IHttpManager httpManager, IUserMetadataProvider userMetadataProvider = null, Uri userProvidedInstanceDiscoveryUri = null, IKnownMetadataProvider knownMetadataProvider = null, INetworkCacheMetadataProvider networkCacheMetadataProvider = null, INetworkMetadataProvider networkMetadataProvider = null, IRegionDiscoveryProvider regionDiscoveryProvider = null)

public Task<InstanceDiscoveryMetadataEntry> GetMetadataEntryAsync(AuthorityInfo authorityInfo, RequestContext requestContext, bool forceValidation = false)

public Task<InstanceDiscoveryMetadataEntry> GetMetadataEntryTryAvoidNetworkAsync(AuthorityInfo authorityInfo, IEnumerable<string> existingEnvironmentsInCache, RequestContext requestContext)