AddDefaultAccessTokenResiliency in AccessTokenManagement 4 question #378
Replies: 1 comment 2 replies
|
When you use You can however include both HTTP message handlers when registering your own HTTP client: services.AddHttpClient<CatalogClient>(client =>
{
client.BaseAddress = new Uri("https://apis.company.com/catalog/");
})
.AddDefaultAccessTokenResiliency()
.AddClientCredentialsTokenHandler(ClientCredentialsClientName.Parse("catalog.client"));The resiliency handler is not required for the protocol to work, but it adds a retry when you encounter a The note on our documentation page only applies when the default resiliency handler has been configured. We will update the documentation to be more specific. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi
I noticed that in AccessTokenManagement 4 in the implementation of
AddClientCredentialsHttpClientthere's a new call toAddDefaultAccessTokenResiliency(I think it's new, correct me if this had existed earlier).But I won't always use AddClientCredentialsHttpClient. For example, if I want to configure a typed http client, I will use
AddHttpClient(...).AddClientCredentialsTokenHandler(). That invocation won't haveAddDefaultAccessTokenResiliencyunless I remember to add it myself.So my question is 1) how important that AddDefaultAccessTokenResiliency is? Is it required for the protocol to work? Or is it nice to have? What am I losing if I don't add it? The documentation does not seem to mention anything about it.
And 2) the documentation page here https://docs.duendesoftware.com/accesstokenmanagement/workers/#automatic-token-management-using-http-factory shows a typed client configuration without resiliency and has this note:
Is this note true without AddDefaultAccessTokenResiliency?
All reactions