[EDIT by guardrex to add the metadata]
This is a follow-up to dotnet/aspnetcore#59440.
Please update the Blazor documentation guidance for using HttpClient and IHttpClientFactory to cover the pattern for accessing scoped services (like AuthenticationStateProvider) from a DelegatingHandler.
The current documentation doesn't address the handler scope isolation issue where handlers created by IHttpClientFactory run in a separate DI scope that doesn't share services with the Blazor circuit.
A sample implementation using Keyed DI is available at: https://github.com/javiercn/blazor-httpclientfactory-sample
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
[EDIT by guardrex to add the metadata]
This is a follow-up to dotnet/aspnetcore#59440.
Please update the Blazor documentation guidance for using
HttpClientandIHttpClientFactoryto cover the pattern for accessing scoped services (likeAuthenticationStateProvider) from aDelegatingHandler.The current documentation doesn't address the handler scope isolation issue where handlers created by
IHttpClientFactoryrun in a separate DI scope that doesn't share services with the Blazor circuit.A sample implementation using Keyed DI is available at: https://github.com/javiercn/blazor-httpclientfactory-sample
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.