Skip to content

Commit 99cf7ca

Browse files
Apply suggestions from code review
Co-authored-by: Maarten Balliauw <[email protected]>
1 parent 05fcf1b commit 99cf7ca

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/content/docs/accesstokenmanagement/workers.mdx

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ The access tokens need to be requested and [cached](/accesstokenmanagement/advan
1717

1818
The actual business code should not need to be aware of this.
1919

20-
Have a look for the [Worker project in the samples folder](https://github.com/DuendeSoftware/foss/tree/main/access-token-management/samples/) for running code.
20+
Take a look at the [`Worker` project in the samples folder](https://github.com/DuendeSoftware/foss/tree/main/access-token-management/samples/) for example code.
2121

22-
For more information, also please see the [advanced topic on client credentials](accesstokenmanagement/advanced/client-credentials/).
22+
For more information, see the [advanced topic on client credentials](accesstokenmanagement/advanced/client-credentials/).
2323

2424

2525
## Usage
2626

27-
First, you'll need to add `Duende.AccessTokenManagement` to your solution.
27+
First, you'll need to add the `Duende.AccessTokenManagement` package to your solution.
2828

29-
There are two fundamental ways to interact with token management:
30-
1. **Automatic** <Badge text="recommended"/>: You request a http client from the IHTTPClientFactory. This http client automatically requests, optionally renews and attaches the access tokens on each request.
29+
Next, there are two fundamental ways to interact with token management:
30+
1. **Automatic** <Badge text="recommended"/>: You request an `HttpClient` from the `IHttpClientFactory`. This HTTP client automatically requests, optionally renews and attaches the access tokens on each request.
3131
2. **Manually** <Badge text="advanced"/>: You request an access token, which you can then use to (for example) authenticate with services. You are responsible for attaching the access token to requests.
3232

3333
### Adding Duende.AccessTokenManagement
@@ -40,10 +40,6 @@ dotnet add package Duende.AccessTokenManagement
4040

4141
You can add the necessary services to the ASP.NET Core service provider by calling `AddClientCredentialsTokenManagement()`. After that you can add one or more named client definitions by calling `AddClient`.
4242

43-
:::note
44-
The way you interact with `Duende.AccessTokenManagement` has changed in version 4.
45-
:::
46-
4743
{/* prettier-ignore */}
4844
<Tabs syncKey="atm-workers">
4945
{/* prettier-ignore */}
@@ -107,7 +103,7 @@ You can add the necessary services to the ASP.NET Core service provider by calli
107103

108104
You can register HTTP clients with the factory that will automatically use the above client definitions to request and use access tokens.
109105

110-
The following code registers an HTTP client called `invoices` to automatically use the `invoice.client` definition:
106+
The following code registers an `HttpClient` called `invoices` which automatically uses the `invoice.client` definition:
111107

112108
{/* prettier-ignore */}
113109
<Tabs syncKey="atm-workers">
@@ -191,7 +187,9 @@ The following code registers an HTTP client called `invoices` to automatically u
191187
}
192188
```
193189

194-
**remark** The clients in the factory have a message handler attached to them that automatically re-tries the request in case of a `401` response code. The request get re-sent with a newly requested access token. If this still results in a `401`, the response is returned to the caller.
190+
:::note
191+
The clients in the HTTP client factory have a message handler attached to them that automatically retries the request in case of a `401` response code. The request get resent with a newly requested access token. If this still results in a `401`, the response is returned to the caller.
192+
:::
195193

196194
### Manual
197195

0 commit comments

Comments
 (0)