Skip to content

Commit 069893e

Browse files
committed
merge conflicts
2 parents dc3f71c + 7c3fefd commit 069893e

File tree

24 files changed

+64
-60
lines changed

24 files changed

+64
-60
lines changed

2-WebApp-graph-user/2-1-Call-MSGraph/README-incremental-instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The two new lines of code:
122122
123123
### Add additional files to call Microsoft Graph
124124

125-
Add the `Microsoft.Identity.Web.MicrosoftGraph` package, to use [Microsoft Graph SDK](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/overview.md).
125+
Add the `Microsoft.Identity.Web.GraphServiceClient` package, to use [Microsoft Graph SDK](https://github.com/microsoftgraph/msgraph-sdk-dotnet/blob/dev/docs/overview.md).
126126
127127
### Update the `Startup.cs` file to enable the Microsoft Graph custom service
128128

@@ -160,13 +160,13 @@ public HomeController(ILogger<HomeController> logger,
160160
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
161161
public async Task<IActionResult> Profile()
162162
{
163-
var me = await _graphServiceClient.Me.Request().GetAsync();
163+
var me = await _graphServiceClient.Me.GetAsync();
164164
ViewData["Me"] = me;
165165

166166
try
167167
{
168168
// Get user photo
169-
using (var photoStream = await _graphServiceClient.Me.Photo.Content.Request().GetAsync())
169+
using (var photoStream = await _graphServiceClient.Me.Photo.Content.GetAsync())
170170
{
171171
byte[] photoByte = ((MemoryStream)photoStream).ToArray();
172172
ViewData["Photo"] = Convert.ToBase64String(photoByte);
@@ -290,15 +290,15 @@ To process the CAE challenge from Microsoft Graph, the controller actions need t
290290
1. Catch a Microsoft Graph SDK's `ServiceException` and extract the required `claims`. This is done by wrapping the call to Microsoft Graph into a try/catch block that processes the challenge:
291291

292292
```CSharp
293-
currentUser = await _graphServiceClient.Me.Request().GetAsync();
293+
currentUser = await _graphServiceClient.Me.GetAsync();
294294
```
295295

296296
1. Then redirect the user back to Azure AD with the new requested `claims`. Azure AD will use this `claims` payload to discern what or if any additional processing is required, example being the user needs to sign-in again or do multi-factor authentication.
297297

298298
```CSharp
299299
try
300300
{
301-
currentUser = await _graphServiceClient.Me.Request().GetAsync();
301+
currentUser = await _graphServiceClient.Me.GetAsync();
302302
}
303303
// Catch CAE exception from Graph SDK
304304
catch (ServiceException svcex) when (svcex.Message.Contains("Continuous access evaluation resulted in claims challenge"))

2-WebApp-graph-user/2-1-Call-MSGraph/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
193193
194194
## About The code
195195

196-
1. In this aspnetcore web project, first the packages `Microsoft.Identity.Web`, `Microsoft.Identity.Web.UI` and `Microsoft.Identity.Web.MicrosoftGraph` were added from NuGet. These libraries are used to simplify the process of signing-in a user and acquiring tokens for Microsoft Graph.
196+
1. In this aspnetcore web project, first the packages `Microsoft.Identity.Web`, `Microsoft.Identity.Web.UI` and `Microsoft.Identity.Web.GraphServiceClient` were added from NuGet. These libraries are used to simplify the process of signing-in a user and acquiring tokens for Microsoft Graph.
197197

198198
2. Starting with the **Startup.cs** file :
199199

@@ -242,13 +242,13 @@ Open the project in your IDE (like Visual Studio or Visual Studio Code) to confi
242242
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
243243
public async Task<IActionResult> Profile()
244244
{
245-
var me = await _graphServiceClient.Me.Request().GetAsync();
245+
var me = await _graphServiceClient.Me.GetAsync();
246246
ViewData["Me"] = me;
247247

248248
try
249249
{
250250
// Get user photo
251-
using (var photoStream = await _graphServiceClient.Me.Photo.Content.Request().GetAsync())
251+
using (var photoStream = await _graphServiceClient.Me.Photo.Content.GetAsync())
252252
{
253253
byte[] photoByte = ((MemoryStream)photoStream).ToArray();
254254
ViewData["Photo"] = Convert.ToBase64String(photoByte);
@@ -509,13 +509,13 @@ To process the CAE challenge from Microsoft Graph, the controller actions need t
509509
1. The process to handle CAE challenges from MS Graph comprises of the following steps:
510510
1. Catch a Microsoft Graph SDK's `ServiceException` and extract the required `claims`. This is done by wrapping the call to Microsoft Graph into a try/catch block that processes the challenge:
511511
```CSharp
512-
currentUser = await _graphServiceClient.Me.Request().GetAsync();
512+
currentUser = await _graphServiceClient.Me.GetAsync();
513513
```
514514
1. Then redirect the user back to Azure AD with the new requested `claims`. Azure AD will use this `claims` payload to discern what or if any additional processing is required, example being the user needs to sign-in again or do multi-factor authentication.
515515
```CSharp
516516
try
517517
{
518-
currentUser = await _graphServiceClient.Me.Request().GetAsync();
518+
currentUser = await _graphServiceClient.Me.GetAsync();
519519
}
520520
// Catch CAE exception from Graph SDK
521521
catch (ServiceException svcex) when (svcex.Message.Contains("Continuous access evaluation resulted in claims challenge"))

2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/CAE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ To process the CAE challenge from Microsoft Graph, the controller actions need t
2929
1. The process to handle CAE challenges from MS Graph comprises of the following steps:
3030
1. Catch a Microsoft Graph SDK's `ServiceException` and extract the required `claims`. This is done by wrapping the call to Microsoft Graph into a try/catch block that processes the challenge:
3131
```CSharp
32-
currentUser = await _graphServiceClient.Me.Request().GetAsync();
32+
currentUser = await _graphServiceClient.Me.GetAsync();
3333
```
3434
1. Then redirect the user back to Azure AD with the new requested `claims`. Azure AD will use this `claims` payload to discern what or if any additional processing is required, example being the user needs to sign-in again or do multi-factor authentication.
3535
```CSharp
3636
try
3737
{
38-
currentUser = await _graphServiceClient.Me.Request().GetAsync();
38+
currentUser = await _graphServiceClient.Me.GetAsync();
3939
}
4040
// Catch CAE exception from Graph SDK
4141
catch (ServiceException svcex) when (svcex.Message.Contains("Continuous access evaluation resulted in claims challenge"))

2-WebApp-graph-user/2-1-Call-MSGraph/ReadmeFiles/ExploreSample.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
## About The code
1212

13-
1. In this aspnetcore web project, first the packages `Microsoft.Identity.Web`, `Microsoft.Identity.Web.UI` and `Microsoft.Identity.Web.MicrosoftGraph` were added from NuGet. These libraries are used to simplify the process of signing-in a user and acquiring tokens for Microsoft Graph.
13+
1. In this aspnetcore web project, first the packages `Microsoft.Identity.Web`, `Microsoft.Identity.Web.UI` and `Microsoft.Identity.Web.GraphServiceClient` were added from NuGet. These libraries are used to simplify the process of signing-in a user and acquiring tokens for Microsoft Graph.
1414

1515
2. Starting with the **Startup.cs** file :
1616

@@ -60,13 +60,13 @@
6060
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
6161
public async Task<IActionResult> Profile()
6262
{
63-
var me = await _graphServiceClient.Me.Request().GetAsync();
63+
var me = await _graphServiceClient.Me.GetAsync();
6464
ViewData["Me"] = me;
6565

6666
try
6767
{
6868
// Get user photo
69-
using (var photoStream = await _graphServiceClient.Me.Photo.Content.Request().GetAsync())
69+
using (var photoStream = await _graphServiceClient.Me.Photo.Content.GetAsync())
7070
{
7171
byte[] photoByte = ((MemoryStream)photoStream).ToArray();
7272
ViewData["Photo"] = Convert.ToBase64String(photoByte);

2-WebApp-graph-user/2-2-TokenCache/Controllers/HomeController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public HomeController(ILogger<HomeController> logger,
3232
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
3333
public async Task<IActionResult> Index()
3434
{
35-
var user = await _graphServiceClient.Me.Request().GetAsync();
35+
var user = await _graphServiceClient.Me.GetAsync();
3636
ViewData["ApiResult"] = user.DisplayName;
3737
var encodedCachedTimeUTC = await _cache.GetAsync("cachedTimeUTC");
3838

@@ -42,13 +42,13 @@ public async Task<IActionResult> Index()
4242
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
4343
public async Task<IActionResult> Profile()
4444
{
45-
var me = await _graphServiceClient.Me.Request().GetAsync();
45+
var me = await _graphServiceClient.Me.GetAsync();
4646
ViewData["Me"] = me;
4747

4848
try
4949
{
5050
// Get user photo
51-
using (var photoStream = await _graphServiceClient.Me.Photo.Content.Request().GetAsync())
51+
using (var photoStream = await _graphServiceClient.Me.Photo.Content.GetAsync())
5252
{
5353
byte[] photoByte = ((MemoryStream)photoStream).ToArray();
5454
ViewData["Photo"] = Convert.ToBase64String(photoByte);

2-WebApp-graph-user/2-2-TokenCache/Views/Home/Profile.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</td>
2727
</tr>
2828
@{
29-
var me = ViewData["me"] as Microsoft.Graph.User;
29+
var me = ViewData["me"] as Microsoft.Graph.Models.User;
3030
var properties = me.GetType().GetProperties();
3131
foreach (var child in properties)
3232
{

2-WebApp-graph-user/2-2-TokenCache/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="3.1.8" />
2323
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.0" />
2424
<PackageReference Include="Microsoft.Identity.Web.UI" Version="2.12.2" />
25-
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="2.12.2" />
25+
<PackageReference Include="Microsoft.Identity.Web.GraphServiceClient" Version="2.12.2" />
2626
</ItemGroup>
2727

2828

2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Controllers/HomeController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public HomeController(ILogger<HomeController> logger,
2828
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
2929
public async Task<IActionResult> Index()
3030
{
31-
var user = await _graphServiceClient.Me.Request().GetAsync();
31+
var user = await _graphServiceClient.Me.GetAsync();
3232
ViewData["ApiResult"] = user.DisplayName;
3333

3434
return View();
@@ -37,13 +37,13 @@ public async Task<IActionResult> Index()
3737
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
3838
public async Task<IActionResult> Profile()
3939
{
40-
var me = await _graphServiceClient.Me.Request().GetAsync();
40+
var me = await _graphServiceClient.Me.GetAsync();
4141
ViewData["Me"] = me;
4242

4343
try
4444
{
4545
// Get user photo
46-
using (var photoStream = await _graphServiceClient.Me.Photo.Content.Request().GetAsync())
46+
using (var photoStream = await _graphServiceClient.Me.Photo.Content.GetAsync())
4747
{
4848
byte[] photoByte = ((MemoryStream)photoStream).ToArray();
4949
ViewData["Photo"] = Convert.ToBase64String(photoByte);

2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/Views/Home/Profile.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
</td>
2727
</tr>
2828
@{
29-
var me = ViewData["me"] as Microsoft.Graph.User;
29+
var me = ViewData["me"] as Microsoft.Graph.Models.User;
3030
var properties = me.GetType().GetProperties();
3131
foreach (var child in properties)
3232
{

2-WebApp-graph-user/2-4-Sovereign-Call-MSGraph/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
<ItemGroup>
2121
<PackageReference Include="Microsoft.Identity.Web.UI" Version="2.12.2" />
22-
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="2.12.2" />
22+
<PackageReference Include="Microsoft.Identity.Web.GraphServiceClient" Version="2.12.2" />
2323
</ItemGroup>
2424

2525
</Project>

0 commit comments

Comments
 (0)