Skip to content

Commit 22a0b90

Browse files
committed
minor corrections
1 parent 54809a3 commit 22a0b90

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

2-WebApp-graph-user/2-6-BFF-Proxy/CallGraphBFF/ClientApp/src/components/Home.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export class Home extends Component {
4444
</ul>
4545
<p>To help you get started, we have also set up:</p>
4646
<ul>
47-
<li><strong>Client-side navigation</strong>. For example, click <em>Counter</em> then <em>Back</em> to return here.</li>
47+
<li><strong>Client-side navigation</strong>. For example, click <em>Profile</em>, then <em>Back</em> to return here.</li>
4848
<li><strong>Development server integration</strong>. In development mode, the development server from <code>create-react-app</code> runs in the background automatically, so your client-side resources are dynamically built on demand and the page refreshes when you modify any file.</li>
4949
<li><strong>Efficient production builds</strong>. In production mode, development-time features are disabled, and your <code>dotnet publish</code> configuration produces minified, efficiently bundled JavaScript files.</li>
5050
</ul>

2-WebApp-graph-user/2-6-BFF-Proxy/CallGraphBFF/Controllers/AuthController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
using Microsoft.AspNetCore.Authentication;
1+
using System.Security.Claims;
2+
using Microsoft.AspNetCore.Authentication;
23
using Microsoft.AspNetCore.Authentication.Cookies;
34
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
45
using Microsoft.AspNetCore.Authorization;
56
using Microsoft.AspNetCore.Mvc;
6-
using System.Security.Claims;
77

88
namespace TodoListBFF.Controllers;
99

2-WebApp-graph-user/2-6-BFF-Proxy/CallGraphBFF/Controllers/ProfileController.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
using Microsoft.AspNetCore.Mvc;
22
using Microsoft.AspNetCore.Authorization;
3-
using Microsoft.Graph;
43
using Microsoft.AspNetCore.Authentication.Cookies;
54
using Microsoft.Identity.Web;
65
using Microsoft.Identity.Client;
6+
using Microsoft.Graph;
77

88
namespace TodoListBFF.Controllers;
99

10-
[Authorize(AuthenticationSchemes = CookieAuthenticationDefaults.AuthenticationScheme)]
11-
[AuthorizeForScopes(Scopes = new string[] { "user.read" })]
10+
[Authorize]
1211
[Route("api/[controller]")]
1312
[ApiController]
1413
public class ProfileController : Controller
@@ -38,7 +37,7 @@ public async Task<ActionResult<User>> GetProfile()
3837
}
3938
catch (Exception ex)
4039
{
41-
return BadRequest("An error occurred while calling the downstream API\n" + ex.Message);
40+
return BadRequest(ex.Message);
4241
}
4342
}
4443
}

2-WebApp-graph-user/2-6-BFF-Proxy/CallGraphBFF/appsettings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// "CertificateDistinguishedName": "CN=CallGraphBFF"
1212
// }
1313
//],
14+
"ClientCapabilities": [ "CP1" ],
1415
"CallbackPath": "/api/auth/signin-oidc",
1516
"SignedOutCallbackPath": "/api/auth/signout-oidc"
1617
},

2-WebApp-graph-user/2-6-BFF-Proxy/README.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extensions:
3535

3636
## Overview
3737

38-
This sample demonstrates a ASP.NET Core web app calling Microsoft Graph.
38+
This sample demonstrates a React single-page application with an ASP.NET Core backend authenticating users and calling the Microsoft Graph API using the backend for frontend proxy pattern.
3939

4040
> :information_source: To learn how applications integrate with [Microsoft Graph](https://aka.ms/graph), consider going through the recorded session: [An introduction to Microsoft Graph for developers](https://www.youtube.com/watch?v=EBbnpFdB92A)
4141
@@ -171,20 +171,23 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
171171
From your shell or command line, execute the following commands:
172172

173173
```console
174-
cd 2-WebApp-graph-user/2-6-BFF-Proxy
174+
cd 2-WebApp-graph-user/2-6-BFF-Proxy/CallGraphBFF
175175
dotnet run
176176
```
177177

178178
## Explore the sample
179179

180-
> * Explain how to explore the sample.
181-
> * Insert a screenshot of the client application.
180+
1. Open your browser and navigate to `https://localhost:7000`.
181+
1. Select the **Login** button on the navigation bar to sign-in.
182+
1. Select the **Profile** button on the navigation bar to call Microsoft Graph.
183+
184+
![Screenshot Image](./ReadmeFiles/screenshot.png)
182185

183186
> :information_source: Did the sample not work for you as expected? Then please reach out to us using the [GitHub Issues](../../../../issues) page.
184187
185188
## We'd love your feedback!
186189

187-
Were we successful in addressing your learning objective? Consider taking a moment to [share your experience with us](Enter_Survey_Form_Link).
190+
Were we successful in addressing your learning objective? Consider taking a moment to [share your experience with us](https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR73pcsbpbxNJuZCMKN0lURpUNEFCQ0FSMFlPQTJURkJZMTRZWVJRNkdRMCQlQCN0PWcu).
188191

189192
## Troubleshooting
190193

@@ -225,8 +228,8 @@ Follow the link to [Publish with Visual Studio](https://docs.microsoft.com/visua
225228
#### Update the Azure AD app registration (CallGraphBFF)
226229

227230
1. Navigate back to to the [Azure portal](https://portal.azure.com).
228-
In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations (Preview)**.
229-
1. In the resulting screen, select the `callgraphbff` application.
231+
In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations**.
232+
1. In the resulting screen, select the `CallGraphBFF` application.
230233
1. In the app's registration screen, select **Authentication** in the menu.
231234
1. In the **Redirect URIs** section, update the reply URLs to match the site URL of your Azure deployment. For example:
232235
1. `https://callgraphbff.azurewebsites.net/api/auth/signin-oidc`

0 commit comments

Comments
 (0)