Skip to content

Commit 6729bd2

Browse files
authored
Merge pull request #711 from Azure-Samples/jennyf/2.12.1
update to 2.12.1
2 parents 5cd9e78 + 069893e commit 6729bd2

File tree

40 files changed

+104
-99
lines changed

40 files changed

+104
-99
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ body:
1111
attributes:
1212
label: Microsoft.Identity.Web version
1313
description: "Please enter the latest version this issue can be reproduced in. "
14-
placeholder: "2.11.1"
14+
placeholder: "2.12.2"
1515
validations:
1616
required: true
1717

@@ -106,7 +106,7 @@ body:
106106
attributes:
107107
label: Regression
108108
description: "If this behavior worked before, please enter the last working version(s)."
109-
placeholder: "Id Web 2.11.1"
109+
placeholder: "Id Web 2.12.2"
110110

111111
- type: textarea
112112
attributes:

1-WebApp-OIDC/1-1-MyOrg/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
<PrivateAssets>all</PrivateAssets>
2525
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2626
</PackageReference>
27-
<PackageReference Include="Microsoft.Identity.Web" Version="2.11.1" />
28-
<PackageReference Include="Microsoft.Identity.Web.UI" Version="2.11.1" />
27+
<PackageReference Include="Microsoft.Identity.Web" Version="2.12.2" />
28+
<PackageReference Include="Microsoft.Identity.Web.UI" Version="2.12.2" />
2929
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.0.0" />
3030
</ItemGroup>
3131

1-WebApp-OIDC/1-2-AnyOrg/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

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

2525
</Project>

1-WebApp-OIDC/1-3-AnyOrgOrPersonal/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

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

2525
</Project>

1-WebApp-OIDC/1-4-Sovereign/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

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

2525
</Project>

1-WebApp-OIDC/1-5-B2C/WebApp-OpenIDConnect-DotNet.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</ItemGroup>
1919

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

2525
</Project>

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Microsoft.Extensions.Configuration;
77
using Microsoft.Extensions.Logging;
88
using Microsoft.Graph;
9+
using Microsoft.Graph.Models;
910
using Microsoft.Identity.Client;
1011
using Microsoft.Identity.Web;
1112
using System;
@@ -25,7 +26,7 @@ public class HomeController : Controller
2526

2627
private readonly MicrosoftIdentityConsentAndConditionalAccessHandler _consentHandler;
2728

28-
private string[] _graphScopes;
29+
private readonly string[] _graphScopes;
2930

3031
public HomeController(ILogger<HomeController> logger,
3132
IConfiguration configuration,
@@ -34,7 +35,7 @@ public HomeController(ILogger<HomeController> logger,
3435
{
3536
_logger = logger;
3637
_graphServiceClient = graphServiceClient;
37-
this._consentHandler = consentHandler;
38+
_consentHandler = consentHandler;
3839

3940
// Capture the Scopes for Graph that were used in the original request for an Access token (AT) for MS Graph as
4041
// they'd be needed again when requesting a fresh AT for Graph during claims challenge processing
@@ -54,7 +55,7 @@ public async Task<IActionResult> Profile()
5455

5556
try
5657
{
57-
currentUser = await _graphServiceClient.Me.Request().GetAsync();
58+
currentUser = await _graphServiceClient.Me.GetAsync();
5859
}
5960
// Catch CAE exception from Graph SDK
6061
catch (ServiceException svcex) when (svcex.Message.Contains("Continuous access evaluation resulted in claims challenge"))
@@ -75,7 +76,7 @@ public async Task<IActionResult> Profile()
7576
try
7677
{
7778
// Get user photo
78-
using (var photoStream = await _graphServiceClient.Me.Photo.Content.Request().GetAsync())
79+
using (var photoStream = await _graphServiceClient.Me.Photo.Content.GetAsync())
7980
{
8081
byte[] photoByte = ((MemoryStream)photoStream).ToArray();
8182
ViewData["Photo"] = Convert.ToBase64String(photoByte);

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"))

0 commit comments

Comments
 (0)