Skip to content

Commit 5100489

Browse files
Wrap long Markdown lines in access token management docs
Split long lines into shorter ones to enhance readability and maintain consistency across the documentation. This change does not alter the content but improves formatting for easier collaboration and review.
1 parent adf54d6 commit 5100489

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

src/content/docs/accesstokenmanagement/web-apps.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ redirect_from:
99
- /foss/accesstokenmanagement/web_apps/
1010
---
1111

12-
The `Duende.AccessTokenManagement` library automates all the tasks around access token lifetime management for user-centric web applications.
12+
The `Duende.AccessTokenManagement` library automates all the tasks around access token lifetime management for
13+
user-centric web applications.
1314

1415
To use this library, start by adding the library to your .NET projects.
1516

@@ -21,14 +22,16 @@ While many of the details can be customized, by default the following is assumed
2122

2223
* ASP.NET Core web application
2324
* cookie authentication handler for session management
24-
* OpenID Connect authentication handler for authentication and access token requests against an OpenID Connect compliant token service
25+
* OpenID Connect authentication handler for authentication and access token requests against an OpenID Connect compliant
26+
token service
2527
* the token service returns a refresh token
2628

2729
## Setup
2830

29-
30-
31-
By default, the token management library will use the ASP.NET Core default authentication scheme for token storage (this is typically the cookie handler and its authentication session), and the default challenge scheme for deriving token client configuration for refreshing tokens or requesting client credential tokens (this is typically the OpenID Connect handler pointing to your trusted authority).
31+
By default, the token management library will use the ASP.NET Core default authentication scheme for token storage (this
32+
is typically the cookie handler and its authentication session), and the default challenge scheme for deriving token
33+
client configuration for refreshing tokens or requesting client credential tokens (this is typically the OpenID Connect
34+
handler pointing to your trusted authority).
3235

3336
```csharp
3437
// Program.cs
@@ -89,7 +92,9 @@ builder.Services.AddOpenIdConnectAccessTokenManagement();
8992

9093
### HTTP Client Factory
9194

92-
Similar to the worker service support, you can register HTTP clients that automatically send the access token of the current user when making API calls. The message handler plumbing associated with those HTTP clients will try to make sure, the access token is always valid and not expired.
95+
Similar to the worker service support, you can register HTTP clients that automatically send the access token of the
96+
current user when making API calls. The message handler plumbing associated with those HTTP clients will try to make
97+
sure, the access token is always valid and not expired.
9398

9499
```csharp
95100
// Program.cs
@@ -110,7 +115,9 @@ builder.Services.AddHttpClient<InvoiceClient>(client =>
110115
.AddUserAccessTokenHandler();
111116
```
112117

113-
Of course, the ASP.NET Core web application host could also do machine to machine API calls that are independent of a user. In this case all the token client configuration can be inferred from the OpenID Connect handler configuration. The following registers an HTTP client that uses a client credentials token for outgoing calls:
118+
Of course, the ASP.NET Core web application host could also do machine to machine API calls that are independent of a
119+
user. In this case all the token client configuration can be inferred from the OpenID Connect handler configuration. The
120+
following registers an HTTP client that uses a client credentials token for outgoing calls:
114121

115122
```csharp
116123
// registers HTTP client that uses the managed client access token
@@ -170,8 +177,10 @@ public class HomeController : Controller
170177

171178
There are three extension methods on the HTTP context that simplify interaction with the token management service:
172179

173-
* `GetUserAccessTokenAsync` - returns an access token representing the user. If the current access token is expired, it will be refreshed.
174-
* `GetClientAccessTokenAsync` - returns an access token representing the client. If the current access token is expired, a new one will be requested
180+
* `GetUserAccessTokenAsync` - returns an access token representing the user. If the current access token is expired, it
181+
will be refreshed.
182+
* `GetClientAccessTokenAsync` - returns an access token representing the client. If the current access token is expired,
183+
a new one will be requested
175184
* `RevokeRefreshTokenAsync` - revokes the refresh token
176185

177186
```csharp
@@ -189,7 +198,9 @@ public async Task<IActionResult> CallApi()
189198

190199
### HTTP Client Factory
191200

192-
Last but not least, if you registered clients with the factory, you can use them. They will try to make sure that a current access token is always sent along. If that is not possible, ultimately a 401 will be returned to the calling code.
201+
Last but not least, if you registered clients with the factory, you can use them. They will try to make sure that a
202+
current access token is always sent along. If that is not possible, ultimately a 401 will be returned to the calling
203+
code.
193204

194205
```csharp
195206
public async Task<IActionResult> CallApi()

0 commit comments

Comments
 (0)