Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/content/docs/bff/fundamentals/blazor/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ app.UseBff();
app.UseAuthorization();
app.UseAntiforgery();

// Add the BFF management endpoints, such as login, logout, etc.
// This has to be added after 'UseAuthorization()'
app.MapBffManagementEndpoints();

// ... <snip> ...
```

Expand Down
1 change: 1 addition & 0 deletions src/content/docs/bff/fundamentals/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ builder.Services.AddBff(options =>

* ***AutomaticallyRegisterBffMiddleware*** (added in 4.0)
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.


* ***IndexHtmlClientName***
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.
Expand Down
30 changes: 27 additions & 3 deletions src/content/docs/bff/fundamentals/session/management/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,37 @@ builder.Services.AddBff(options =>
};
```

The management endpoints need to be mapped:
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:

```csharp
// Program.cs
app.MapBffManagementEndpoints();
var app = builder.Build();

// Preprocessing pipeline, which would have been automatically added to start of the request the pipeline.
app.UseBffPreProcessing();

// Your logic, such as:
app.UseRouting();
app.UseBff();

// post processing pipeline that would have been automatically added to the end of the request pipeline.
app.UseBffPostProcessing();

app.Run();
```

The *UsePreprocessing* method adds all handling for multiple frontend support. Alternatively, you can call these methods direct:
``` csharp
app.UseBffFrontendSelection();
app.UseBffPathMapping();
app.UseBffOpenIdCallbacks();~
```

*MapBffManagementEndpoints* adds all BFF management endpoints. You can also map each endpoint individually by calling the various *MapBffManagementXxxEndpoint* methods, for example *endpoints.MapBffManagementLoginEndpoint()*.

`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()`.

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.

:::note
In V3 and below, only the method `MapBffManagementEndpoints` exists.
:::