Skip to content

Commit 1148cbb

Browse files
improve docs for auto wireup (#849)
* improve docs for auto wireup * Update src/content/docs/bff/fundamentals/session/management/index.md * Update src/content/docs/bff/fundamentals/session/management/index.md * Update src/content/docs/bff/fundamentals/session/management/index.md --------- Co-authored-by: Maarten Balliauw <maarten.balliauw@duendesoftware.com>
1 parent 2083229 commit 1148cbb

File tree

3 files changed

+28
-6
lines changed

3 files changed

+28
-6
lines changed

src/content/docs/bff/fundamentals/blazor/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,6 @@ app.UseBff();
171171
app.UseAuthorization();
172172
app.UseAntiforgery();
173173

174-
// 👋 Add BFF User Session Management endpoints
175-
app.MapBffManagementEndpoints();
176-
177174
app.MapRazorPages();
178175

179176
app.MapControllers()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ builder.Services.AddBff(options =>
4747

4848
* ***AutomaticallyRegisterBffMiddleware*** (added in 4.0)
4949
When applying BFF V4 multiple frontends, a lot of middlewares get automatically added to the pipeline. For example, the frontend selection middleware, the authentication handlers, etc. If you don't want this automatic behavior, then you can turn it off and register these middlewares manually.
50+
5051

5152
* ***IndexHtmlClientName***
5253
If BFF is configured to automatically retrieve the index.html, then it needs a http client to do so. With this name you can automatically configure http client in the http client factory.

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

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,37 @@ builder.Services.AddBff(options =>
2828
};
2929
```
3030

31-
The management endpoints need to be mapped:
31+
Starting with BFF v4, the BFF automatically wires up the management endpoints. If you disable this behavior (using `AutomaticallyRegisterBffMiddleware`, this is how you can map the management endpoints:
3232

3333
```csharp
3434
// Program.cs
35-
app.MapBffManagementEndpoints();
35+
var app = builder.Build();
36+
37+
// Preprocessing pipeline, which would have been automatically added to start of the request the pipeline.
38+
app.UseBffPreProcessing();
39+
40+
// Your logic, such as:
41+
app.UseRouting();
42+
app.UseBff();
43+
44+
// post processing pipeline that would have been automatically added to the end of the request pipeline.
45+
app.UseBffPostProcessing();
46+
47+
app.Run();
48+
```
49+
50+
The *UsePreprocessing* method adds all handling for multiple frontend support. Alternatively, you can call these methods direct:
51+
``` csharp
52+
app.UseBffFrontendSelection();
53+
app.UseBffPathMapping();
54+
app.UseBffOpenIdCallbacks();~
3655
```
3756

38-
*MapBffManagementEndpoints* adds all BFF management endpoints. You can also map each endpoint individually by calling the various *MapBffManagementXxxEndpoint* methods, for example *endpoints.MapBffManagementLoginEndpoint()*.
57+
58+
`UseBffPostProcessing` adds all BFF management endpoints and handlers for proxying `index.html`. You can also map each endpoint individually by calling the various `MapBffManagementXxxEndpoint` methods, for example `endpoints.MapBffManagementLoginEndpoint()`.
3959

4060
The following pages describe the default behavior of the management endpoints. See the [extensibility](/bff/extensibility) section for information about how to customize the behavior of the endpoints.
61+
62+
:::note
63+
In V3 and below, only the method `MapBffManagementEndpoints` exists.
64+
:::

0 commit comments

Comments
 (0)