Skip to content

Commit aaea788

Browse files
authored
Merge pull request #678 from DuendeSoftware/mb/no-more-ci
DI -> (ASP.NET Core) service provider
2 parents b82bfbd + 5c99b95 commit aaea788

44 files changed

Lines changed: 89 additions & 94 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/content/docs/accesstokenmanagement/advanced/client-credentials.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The most common way to use the access token management for machine to machine co
1212

1313
## Client options
1414

15-
You can add token client definitions to your host while configuring the DI container, e.g.:
15+
You can add token client definitions to your host while configuring the ASP.NET Core service provider, e.g.:
1616

1717
```cs
1818
services.AddClientCredentialsTokenManagement()
@@ -53,7 +53,7 @@ services.Configure<ClientCredentialsClient>("invoices", client =>
5353
});
5454
```
5555

56-
Or use the `IConfigureNamedOptions` if you need access to the DI container during registration, e.g.:
56+
Or use the `IConfigureNamedOptions` if you need access to the ASP.NET Core service provider during registration, e.g.:
5757

5858
```cs
5959
public class ClientCredentialsClientConfigureOptions : IConfigureNamedOptions<ClientCredentialsClient>

src/content/docs/accesstokenmanagement/advanced/user-tokens.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The most common way to use the access token management for interactive web appli
1212

1313
## General options
1414

15-
You can pass in some global options when registering token management in DI.
15+
You can pass in some global options when registering token management in the ASP.NET Core service provider.
1616

1717
* `ChallengeScheme` - by default the OIDC configuration is inferred from the default challenge scheme. This is recommended approach. If for some reason your OIDC handler is not the default challenge scheme, you can set the scheme name on the options
1818
* `UseChallengeSchemeScopedTokens` - the general assumption is that you only have one OIDC handler configured. If that is not the case, token management needs to maintain multiple sets of token artefacts simultaneously. You can opt in to that feature using this setting.

src/content/docs/accesstokenmanagement/blazor-server.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Fortunately, Duende.AccessTokenManagement provides a straightforward solution to
2121

2222
Since the tokens cannot be managed in the authentication session, you need to store them somewhere else. The options include an in-memory data structure, a distributed cache like redis, or a database. Duende.AccessTokenManagement describes this store for tokens with the *IUserTokenStore* interface. In non-blazor scenarios, the default implementation that stores the tokens in the session is used. In your Blazor server application, you'll need to decide where you want to store the tokens and implement the store interface.
2323

24-
The store interface is very simple. `StoreTokenAsync` adds a token to the store for a particular user, `GetTokenAsync` retrieves the user's token, and *ClearTokenAsync* clears the tokens stored for a particular user. A sample implementation that stores the tokens in memory can be found in the *ServerSideTokenStore* in the [*BlazorServer* sample](https://github.com/DuendeSoftware/foss/tree/main/access-token-management/samples/BlazorServer).
24+
The store interface is straightforward. `StoreTokenAsync` adds a token to the store for a particular user, `GetTokenAsync` retrieves the user's token, and *ClearTokenAsync* clears the tokens stored for a particular user. A sample implementation that stores the tokens in memory can be found in the *ServerSideTokenStore* in the [*BlazorServer* sample](https://github.com/DuendeSoftware/foss/tree/main/access-token-management/samples/BlazorServer).
2525

26-
Register your token store in the DI container and tell Duende.AccessTokenManagement to integrate with Blazor by calling `AddBlazorServerAccessTokenManagement<TTokenStore>`:
26+
Register your token store in the ASP.NET Core service provider and tell Duende.AccessTokenManagement to integrate with Blazor by calling `AddBlazorServerAccessTokenManagement<TTokenStore>`:
2727

2828
```cs
2929
builder.Services.AddOpenIdConnectAccessTokenManagement()
@@ -64,7 +64,7 @@ Once registered and initialized, Duende.AccessTokenManagement will keep the stor
6464

6565
## Retrieving And Using Tokens
6666

67-
If you've registered your token store with `AddBlazorServerAccessTokenManagement`, Duende.AccessTokenManagement will register the services necessary to attach tokens to outgoing HTTP requests automatically, using the same API as a non-blazor application. You inject an HTTP client factory and resolve named HTTP clients where ever you need to make HTTP requests, and you register the HTTP client's that use access tokens in the DI system with our extension method:
67+
If you've registered your token store with `AddBlazorServerAccessTokenManagement`, Duende.AccessTokenManagement will register the services necessary to attach tokens to outgoing HTTP requests automatically, using the same API as a non-blazor application. You inject an HTTP client factory and resolve named HTTP clients where ever you need to make HTTP requests, and you register the HTTP client's that use access tokens in the ASP.NET Core service provider with our extension method:
6868

6969
```cs
7070
builder.Services.AddUserAccessTokenHttpClient("demoApiClient", configureClient: client =>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public async Task<IActionResult> CallApi()
176176

177177
### HTTP Client Factory
178178

179-
Last but not least, if you registered clients with the factory, you can simply 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.
179+
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.
180180

181181
```cs
182182
public async Task<IActionResult> CallApi()

src/content/docs/accesstokenmanagement/workers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Have a look for the `Worker` project in the [samples folder](https://github.com/
1919

2020
Start by adding a reference to the `Duende.AccessTokenManagement` NuGet package to your application.
2121

22-
You can add the necessary services to the DI system by calling `AddClientCredentialsTokenManagement()`. After that you can add one or more named client definitions by calling `AddClient`.
22+
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`.
2323

2424
```cs
2525
// default cache

src/content/docs/bff/architecture/ui-hosting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ development time. Visual Studio includes SPA templates that start up a SPA and p
4747
Samples of Duende.BFF that take this approach using [React](/bff/samples#reactjs-frontend)
4848
and [Angular](/bff/samples#angular-frontend) are available.
4949

50-
Microsoft's templates are easy-to-use at dev time from Visual Studio. They allow you to simply run the solution, and the
50+
Microsoft's templates are easy-to-use at dev time from Visual Studio. They allow you to run the solution, and the
5151
template proxies requests to the front end for you. At deploy time, that proxy is removed and the static assets of the
5252
site are served by the static file middleware.
5353

src/content/docs/bff/fundamentals/options.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ builder.Services.AddBff(options =>
9797
* ***EnableSessionCleanup***
9898

9999
Indicates if expired server side sessions should be cleaned up.
100-
This requires an implementation of IUserSessionStoreCleanup to be registered in the DI system.
100+
This requires an implementation of IUserSessionStoreCleanup to be registered in the ASP.NET Core service provider.
101101
Defaults to *false*.
102102

103103
* ***SessionCleanupInterval***

src/content/docs/bff/fundamentals/session/management/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Duende.BFF adds endpoints for performing typical session-management operations s
1616

1717
In addition, Duende.BFF adds an implementation of the OpenID Connect back-channel notification endpoint to overcome the restrictions of third party cookies in front-channel notification in modern browsers.
1818

19-
You enable the endpoints by adding the relevant services into the DI container:
19+
You enable the endpoints by adding the relevant services into the ASP.NET Core service provider:
2020

2121
```csharp
2222
// Program.cs

src/content/docs/bff/fundamentals/session/management/silent-login.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ The expected usage pattern is that the application code loads in the browser and
2121

2222
This non-interactive design relies upon the use of an *iframe* to make the silent login request.
2323
The result of the silent login request in the *iframe* will then use *postMessage* to notify the parent window of the outcome.
24-
If the result is that a session has been established, then the application logic can either re-trigger a call to the *User Endpoint*, or simply reload the entire page (depending on the preferred design). If the result is that a session has not been established, then the application redirects to the login endpoint to log the user in interactively.
24+
If the result is that a session has been established, then the application logic can either re-trigger a call to the *User Endpoint*, or reload the entire page (depending on the preferred design). If the result is that a session has not been established, then the application redirects to the login endpoint to log the user in interactively.
2525

2626
To trigger the silent login, the application code must have an *iframe* and then set its *src* to the silent login endpoint.
2727
For example in your HTML:

src/content/docs/bff/fundamentals/session/server-side-sessions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ builder.Services.AddBff(options => {
6161
.AddServerSideSessions();
6262
```
6363

64-
This requires an implementation of [*IUserSessionStoreCleanup*](/bff/extensibility/sessions#user-session-store-cleanup) in the DI system.
64+
This requires an implementation of [*IUserSessionStoreCleanup*](/bff/extensibility/sessions#user-session-store-cleanup) in the ASP.NET Core service provider.
6565

6666
If using Entity Framework Core, then the *IUserSessionStoreCleanup* implementation is provided for you when you use *AddEntityFrameworkServerSideSessions*.
6767
Just enable session cleanup:

0 commit comments

Comments
 (0)