How to Refresh a token using IHttpClientFactory
Looks like you need DelegatingHandler. In two words you can “intercept” your http request and add the Authorization header, then try to execute it and if token was not valid, refresh token and retry one more time. Something like: public class AuthenticationDelegatingHandler : DelegatingHandler { protected override async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) { var … Read more