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
Copy file name to clipboardExpand all lines: 2-WebApp-graph-user/2-6-BFF-Proxy/README.md
+10-10
Original file line number
Diff line number
Diff line change
@@ -85,7 +85,7 @@ or download and extract the repository *.zip* file.
85
85
### Step 2: Navigate to project folder
86
86
87
87
```console
88
-
cd 2-WebApp-graph-user/2-6-BFF-Proxy/CallGraphBFF
88
+
cd 2-WebApp-graph-user/2-6-BFF-Proxy
89
89
```
90
90
91
91
### Step 3. Trust development certificates
@@ -183,7 +183,7 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
183
183
184
184
> In the steps below, "ClientID" is the same as "Application ID" or "AppId".
185
185
186
-
1. Open the `2-6-BFF-Proxy/CallGraphBFF/appsettings.json` file.
186
+
1. Open the `2-6-BFF-Proxy/appsettings.json` file.
187
187
1. Find the string `Enter_the_Tenant_Id_Here` and replace it with your Microsoft Entra tenant/directory ID.
188
188
1. Find the string `Enter_the_Application_Id_Here` and replace it with the application ID (clientId) of `CallGraphBFF` app copied from the Microsoft Entra admin center.
189
189
1. Find the string `Enter_the_Client_Secret_Here` and replace it with the generated secret that you saved during the creation of `CallGraphBFF` copied from the Microsoft Entra admin center.
@@ -193,7 +193,7 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
193
193
From your shell or command line, execute the following commands:
194
194
195
195
```console
196
-
cd 2-WebApp-graph-user/2-6-BFF-Proxy/CallGraphBFF
196
+
cd 2-WebApp-graph-user/2-6-BFF-Proxy/
197
197
dotnet run
198
198
```
199
199
@@ -227,7 +227,7 @@ To provide feedback on or suggest features for Microsoft Entra ID, visit [User V
227
227
228
228
### Login and logout
229
229
230
-
In [Program.cs](./CallGraphBFF/Program.cs), **Microsoft Identity Web** service is configured to obtain tokens to call downstream web APIs (here, Microsoft Graph):
230
+
In [Program.cs](./Program.cs), **Microsoft Identity Web** service is configured to obtain tokens to call downstream web APIs (here, Microsoft Graph):
231
231
232
232
```csharp
233
233
// Add Microsoft.Identity.Web services to the container.
On the frontend side, the React SPA uses the [AuthProvider HOC](./CallGraphBFF/ClientApp/src/AuthProvider.js), which makes a GET call to the `/api/auth/login` endpoint of the ASP.NET Core web app.
240
+
On the frontend side, the React SPA uses the [AuthProvider HOC](./ClientApp/src/AuthProvider.js), which makes a GET call to the `/api/auth/login` endpoint of the ASP.NET Core web app.
The controller in [AuthController.cs](./CallGraphBFF/Controllers/AuthController.cs) processes the request and initiates a token request against Microsoft Entra ID via the `Challenge()` method:
258
+
The controller in [AuthController.cs](./Controllers/AuthController.cs) processes the request and initiates a token request against Microsoft Entra ID via the `Challenge()` method:
259
259
260
260
```csharp
261
261
[HttpGet("login")]
@@ -274,7 +274,7 @@ Once the authentication is successful, the authentication state can be shared wi
274
274
275
275
### Cookie policies
276
276
277
-
The sample makes use of HTTP only, strict cookies to secure the calls between the frontend and the backend. The default ASP.NET Core authentication cookie behavior will attempt to redirect unauthenticated requests to the identity provider (in this case, Microsoft Entra ID). As this is not the desired behavior in BFF proxy architecture, custom cookie authenticated events is used to modify the default behavior (see [CustomCookieAuthenticationEvents.cs](./CallGraphBFF/Utils/CustomCookieAuthenticationEvents.cs)).
277
+
The sample makes use of HTTP only, strict cookies to secure the calls between the frontend and the backend. The default ASP.NET Core authentication cookie behavior will attempt to redirect unauthenticated requests to the identity provider (in this case, Microsoft Entra ID). As this is not the desired behavior in BFF proxy architecture, custom cookie authenticated events is used to modify the default behavior (see [CustomCookieAuthenticationEvents.cs](./Utils/CustomCookieAuthenticationEvents.cs)).
278
278
279
279
```csharp
280
280
// Configure cookie properties for ASP.NET Core cookie authentication.
@@ -298,7 +298,7 @@ Microsoft Graph is now CAE-enabled in Preview. This means that it can ask its cl
298
298
299
299
#### Declare the CAE capability in the configuration
300
300
301
-
This sample app declares that it's CAE-capable by adding the `ClientCapabilities` field to the configuration in [appsettings.json](./CallGraphBFF/appsettings.json):
301
+
This sample app declares that it's CAE-capable by adding the `ClientCapabilities` field to the configuration in [appsettings.json](./appsettings.json):
302
302
303
303
```json
304
304
{
@@ -362,7 +362,7 @@ For more details on what's inside the access token, clients should use the token
362
362
363
363
### Calling Microsoft Graph
364
364
365
-
To make bearer token calls to the Microsoft Graph API, **Microsoft.Identity.Web** makes use of the Microsoft Graph SDK internally. This is shown in [Program.cs](./CallGraphBFF/Program.cs):
365
+
To make bearer token calls to the Microsoft Graph API, **Microsoft.Identity.Web** makes use of the Microsoft Graph SDK internally. This is shown in [Program.cs](./Program.cs):
The service can then be injected into controllers to make Graph calls afterwards. See [ProfileController.cs](./CallGraphBFF/Controllers/ProfileController.cs) for more.
375
+
The service can then be injected into controllers to make Graph calls afterwards. See [ProfileController.cs](./Controllers/ProfileController.cs) for more.
0 commit comments