You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Duende.BFF (Backend for Frontend) supports multiple frontends in a single BFF host. This is useful for scenarios where you want to serve several SPAs or frontend apps from the same backend, each with their own authentication and API proxying configuration.
15
+
16
+
:::note
17
+
Multi-frontend support is available in Duende.BFF v4 and later. The v3 style wireup is not supported for this scenario.
## Setting Up A BFF Project for Multiple Frontends
26
+
27
+
### 1. Create A New ASP.NET Core Project
28
+
29
+
```sh
30
+
dotnet new web -n MyMultiBffApp
31
+
cd MyMultiBffApp
32
+
```
33
+
34
+
### 2. Add The Duende.BFF NuGet Package
35
+
36
+
```sh
37
+
dotnet add package Duende.BFF
38
+
```
39
+
40
+
### 3. OpenID Connect Configuration
41
+
42
+
Configure OpenID Connect authentication for your BFF host. This is similar to the single frontend setup, but applies to all frontends unless overridden per frontend.
// ...existing code for authentication, authorization, etc.
153
+
```
154
+
155
+
</TabItem>
156
+
</Tabs>
157
+
158
+
159
+
### 5. Remote API Proxying
160
+
161
+
You can configure remote API proxying in two ways:
162
+
163
+
-**Single YARP proxy for all frontends:**
164
+
You can set up a single YARP proxy for all frontends, as shown in the [Single Frontend Guide](/bff/getting-started/single-frontend#5-adding-remote-apis).
165
+
166
+
-**Direct proxying per frontend:**
167
+
You can configure remote APIs for each frontend individually:
This allows each frontend to have its own set of proxied remote APIs.
181
+
182
+
### 6. Server Side Sessions
183
+
184
+
Server side session configuration is the same as in the single frontend scenario. See the [Single Frontend Guide](/bff/getting-started/single-frontend#6-adding-server-side-sessions) for details.
0 commit comments