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 calls Microsoft Graph on behalf of signed-in user/2.1. using authorization code flow/AppCreationScripts/Cleanup.ps1
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -49,8 +49,8 @@ This function removes the Azure AD applications for the sample. These applicatio
49
49
# Removes the applications
50
50
Write-Host"Cleaning-up applications from tenant '$tenantName'"
Copy file name to clipboardExpand all lines: 2. WebApp calls Microsoft Graph on behalf of signed-in user/2.1. using authorization code flow/AppCreationScripts/Configure.ps1
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -178,17 +178,17 @@ Function ConfigureApplications
178
178
$user=Get-AzureADUser-ObjectId $creds.Account.Id
179
179
180
180
# Create the webApp AAD application
181
-
Write-Host"Creating the AAD application (WebApp)"
181
+
Write-Host"Creating the AAD application (WebApp-OpenIDConnect-DotNet-code-v2)"
182
182
# Get a 2 years application key for the webApp Application
Copy file name to clipboardExpand all lines: 2. WebApp calls Microsoft Graph on behalf of signed-in user/2.1. using authorization code flow/AppCreationScripts/sample.json
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"Sample": {
3
-
"Title": "An ASP.NET Core 2.x Web App which lets sign-in users with work and school or Microsoft personal accounts (and calls Microsoft Graph)",
3
+
"Title": "Using the Microsoft identity platform to call the Microsoft Graph API from an An ASP.NET Core 2.x Web App, on behalf of a user signing-in using their work and school or Microsoft personal account",
Copy file name to clipboardExpand all lines: 2. WebApp calls Microsoft Graph on behalf of signed-in user/2.1. using authorization code flow/README.md
+11-9Lines changed: 11 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -7,13 +7,14 @@ client: ASP.NET Core 2.x Web App
7
7
service: Microsoft Graph
8
8
endpoint: AAD v2.0
9
9
---
10
-
# Using the Microsoft identity platform to call the Microsoft Graph API from a Web App, on behalf of the signed-in user.
10
+
11
+
# Using the Microsoft identity platform to call the Microsoft Graph API from an An ASP.NET Core 2.x Web App, on behalf of a user signing-in using their work and school or Microsoft personal account
Starting from a .NET Core 2.2 MVC Web app that uses OpenID Connect to sign in users, this phase of the tutorial shows how to calls the Microsoft Graph me endpoint on behalf of the signed-in user. It leverages the ASP.NET Core OpenID Connect middleware and Microsoft Authentication Library for .NET (MSAL.NET). Their complexities where encapsultated into the `Microsoft.Identity.Web` reusable library project part of this tutorial. Once again the notion of ASP.NET services injected by dependency injection is heavily used.
17
+
Starting from a .NET Core 2.2 MVC Web app that uses OpenID Connect to sign in users, this phase of the tutorial shows how to call Microsoft Graph /me endpoint on behalf of the signed-in user. It leverages the ASP.NET Core OpenID Connect middleware and Microsoft Authentication Library for .NET (MSAL.NET). Their complexities where encapsultated into the `Microsoft.Identity.Web` reusable library project part of this tutorial. Once again the notion of ASP.NET services injected by dependency injection is heavily used.
17
18
18
19

19
20
@@ -27,9 +28,9 @@ To run this sample:
27
28
28
29
### Step 1: Register the sample with your Azure AD tenant
29
30
30
-
You first need to have [registered](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/aspnetcore2-2#step-1-register-the-sample-with-your-azure-ad-tenant) your app as described in [the first tutorial](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/aspnetcore2-2)
31
+
You first need to [register](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/aspnetcore2-2#step-1-register-the-sample-with-your-azure-ad-tenant) your app as described in [the first tutorial](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/aspnetcore2-2)
31
32
32
-
Then here are the extra steps:
33
+
Then follow the following extra set of steps:
33
34
34
35
1. From the **Certificates & secrets** page, for your app registration, in the **Client secrets** section, choose **New client secret**:
35
36
@@ -76,9 +77,9 @@ Go to the `"2. WebApp calls Microsoft Graph on behalf of signed-in use/2.1. usin
76
77
77
78
## About The code
78
79
79
-
Starting from the [previous phase of the tutorial](../../1.%20WebApp%20signs-in%20users%20with%20Microsoft%20Identity%20(OIDC)), the code was incrementally updated by following these steps:
80
+
Starting from the [previous phase of the tutorial](../../1.%20WebApp%20signs-in%20users%20with%20Microsoft%20Identity%20(OIDC)), the code was incrementally updated with the following steps:
80
81
81
-
### Update the `Startup.cs` file to enable TokenAcquisition MSAL.NET based service
82
+
### Update the `Startup.cs` file to enable TokenAcquisition by a MSAL.NET based service
82
83
83
84
After the following lines in the ConfigureServices(IServiceCollection services) method, replace `services.AddAzureAdV2Authentication(Configuration);`, by the following lines:
84
85
@@ -96,12 +97,12 @@ After the following lines in the ConfigureServices(IServiceCollection services)
-Decidewhichtokencacheimplementationtouse. Inthispartofthephase, we'll use a simple in memory token cache, but next steps will show you other implementations you can benefit from, including distributed token caches based on a SQL database, or a Redis cache.
101
102
102
103
### Add additional files to call Microsoft Graph
103
104
104
-
Addthe `Services\Microsoft-Graph-Rest\*.cs` files. ThisisanimplementationofacustomservicewhichencapsultesthecalltotheMicrosoftGraphmeendpoint. GivenanaccesstokentoaccesstheMicrosoftGraph, it's capable of getting the user information and the photo of the user.
105
+
Addthe `Services\Microsoft-Graph-Rest\*.cs` files. ThisisanimplementationofacustomservicewhichencapsultesthecalltotheMicrosoftGraph/meendpoint. GivenanaccesstokenforMicrosoftGraph, it's capable of getting the user information and the photo of the user.
105
106
106
107
```CSharp
107
108
publicinterfaceIGraphApiOperations
@@ -113,7 +114,7 @@ public interface IGraphApiOperations
113
114
114
115
### Update the `Startup.cs` file to enable the Microsoft Graph custom service
- [UseHttpClientFactorytoimplementresilientHTTPrequests](https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/implement-resilient-applications/use-httpclientfactory-to-implement-resilient-http-requests) used by the Graph custom service
0 commit comments