Skip to content

Commit 9da6177

Browse files
authored
Update ProjectTemplates to Id Web 2.12.2 + MS Graph v5 support (#48863)
1 parent 681cb8e commit 9da6177

File tree

11 files changed

+27
-15
lines changed

11 files changed

+27
-15
lines changed

eng/Versions.props

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@
296296
<DuendeIdentityServerStorageVersion>6.0.4</DuendeIdentityServerStorageVersion>
297297
<DuendeIdentityServerEntityFrameworkStorageVersion>6.0.4</DuendeIdentityServerEntityFrameworkStorageVersion>
298298
<MessagePackVersion>2.5.108</MessagePackVersion>
299-
<MicrosoftIdentityWebVersion>2.10.0</MicrosoftIdentityWebVersion>
300-
<MicrosoftIdentityWebMicrosoftGraphVersion>2.10.0</MicrosoftIdentityWebMicrosoftGraphVersion>
301-
<MicrosoftIdentityWebUIVersion>2.10.0</MicrosoftIdentityWebUIVersion>
302-
<MicrosoftIdentityWebDownstreamApiVersion>2.10.0</MicrosoftIdentityWebDownstreamApiVersion>
299+
<MicrosoftIdentityWebVersion>2.12.2</MicrosoftIdentityWebVersion>
300+
<MicrosoftIdentityWebGraphServiceClientVersion>2.12.2</MicrosoftIdentityWebGraphServiceClientVersion>
301+
<MicrosoftIdentityWebUIVersion>2.12.2</MicrosoftIdentityWebUIVersion>
302+
<MicrosoftIdentityWebDownstreamApiVersion>2.12.2</MicrosoftIdentityWebDownstreamApiVersion>
303303
<MessagePackAnalyzerVersion>$(MessagePackVersion)</MessagePackAnalyzerVersion>
304304
<MoqVersion>4.10.0</MoqVersion>
305305
<MonoCecilVersion>0.11.2</MonoCecilVersion>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"profiles": {
3+
"Components.WasmMinimal": {
4+
"commandName": "Project",
5+
"launchBrowser": true,
6+
"environmentVariables": {
7+
"ASPNETCORE_ENVIRONMENT": "Development"
8+
},
9+
"applicationUrl": "https://localhost:53674;http://localhost:53675"
10+
}
11+
}
12+
}

src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
MicrosoftExtensionsHostingVersion=$(MicrosoftExtensionsHostingVersion);
2121
MicrosoftExtensionsHttpVersion=$(MicrosoftExtensionsHttpVersion);
2222
MicrosoftIdentityWebVersion=$(MicrosoftIdentityWebVersion);
23-
MicrosoftIdentityWebMicrosoftGraphVersion=$(MicrosoftIdentityWebMicrosoftGraphVersion);
23+
MicrosoftIdentityWebGraphServiceClientVersion=$(MicrosoftIdentityWebGraphServiceClientVersion);
2424
MicrosoftIdentityWebUIVersion=$(MicrosoftIdentityWebUIVersion);
2525
MicrosoftIdentityWebDownstreamApiVersion=$(MicrosoftIdentityWebDownstreamApiVersion);
2626
MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion);

src/ProjectTemplates/Web.ProjectTemplates/RazorPagesWeb-CSharp.csproj.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="${MicrosoftAspNetCoreAuthenticationNegotiateVersion}" Condition="'$(WindowsAuth)' == 'True'" />
2828
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="${MicrosoftAspNetCoreAuthenticationOpenIdConnectVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" NoWarn="NU1605" />
2929
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
30-
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="${MicrosoftIdentityWebMicrosoftGraphVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
30+
<PackageReference Include="Microsoft.Identity.Web.GraphServiceClient" Version="${MicrosoftIdentityWebGraphServiceClientVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
3131
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
3232
<PackageReference Include="Microsoft.Identity.Web.DownstreamApi" Version="${MicrosoftIdentityWebDownstreamApiVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
3333
</ItemGroup>

src/ProjectTemplates/Web.ProjectTemplates/StarterWeb-CSharp.csproj.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<PackageReference Include="Microsoft.AspNetCore.Authentication.Negotiate" Version="${MicrosoftAspNetCoreAuthenticationNegotiateVersion}" Condition="'$(WindowsAuth)' == 'True'" />
2828
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="${MicrosoftAspNetCoreAuthenticationOpenIdConnectVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" NoWarn="NU1605" />
2929
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
30-
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="${MicrosoftIdentityWebMicrosoftGraphVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
30+
<PackageReference Include="Microsoft.Identity.Web.GraphServiceClient" Version="${MicrosoftIdentityWebGraphServiceClientVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
3131
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
3232
<PackageReference Include="Microsoft.Identity.Web.DownstreamApi" Version="${MicrosoftIdentityWebDownstreamApiVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
3333
</ItemGroup>

src/ProjectTemplates/Web.ProjectTemplates/WebApi-CSharp.csproj.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="${MicrosoftAspNetCoreAuthenticationOpenIdConnectVersion}" Condition="'$(OrganizationalAuth)' == 'True' OR '$(IndividualB2CAuth)' == 'True'" />
1818
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="${MicrosoftAspNetCoreOpenApiVersion}" Condition="'$(EnableOpenAPI)' == 'True'" />
1919
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebVersion}" Condition="'$(OrganizationalAuth)' == 'True' OR '$(IndividualB2CAuth)' == 'True'"/>
20-
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="${MicrosoftIdentityWebMicrosoftGraphVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
20+
<PackageReference Include="Microsoft.Identity.Web.GraphServiceClient" Version="${MicrosoftIdentityWebGraphServiceClientVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
2121
<PackageReference Include="Microsoft.Identity.Web.DownstreamApi" Version="${MicrosoftIdentityWebDownstreamApiVersion}" Condition="'$(OrganizationalAuth)' == 'True' OR '$(IndividualB2CAuth)' == 'True'"/>
2222
<PackageReference Include="Swashbuckle.AspNetCore" Version="${SwashbuckleAspNetCoreVersion}" Condition="'$(EnableOpenAPI)' == 'True'" />
2323
</ItemGroup>

src/ProjectTemplates/Web.ProjectTemplates/content/RazorPagesWeb-CSharp/Pages/Index.cshtml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@ public IndexModel(ILogger<IndexModel> logger,
5656

5757
public async Task OnGet()
5858
{
59-
var user = await _graphServiceClient.Me.Request().GetAsync();
59+
var user = await _graphServiceClient.Me.GetAsync();
6060

61-
ViewData["ApiResult"] = user.DisplayName;
61+
ViewData["ApiResult"] = user?.DisplayName;
6262
}
6363
#else
6464
public IndexModel(ILogger<IndexModel> logger)

src/ProjectTemplates/Web.ProjectTemplates/content/StarterWeb-CSharp/Controllers/HomeController.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public HomeController(ILogger<HomeController> logger,
6363
[AuthorizeForScopes(ScopeKeySection = "DownstreamApi:Scopes")]
6464
public async Task<IActionResult> Index()
6565
{
66-
var user = await _graphServiceClient.Me.Request().GetAsync();
67-
ViewData["ApiResult"] = user.DisplayName;
66+
var user = await _graphServiceClient.Me.GetAsync();
67+
ViewData["ApiResult"] = user?.DisplayName;
6868

6969
return View();
7070
}

src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Controllers/WeatherForecastController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public WeatherForecastController(ILogger<WeatherForecastController> logger,
9090
#endif
9191
public async Task<IEnumerable<WeatherForecast>> Get()
9292
{
93-
var user = await _graphServiceClient.Me.Request().GetAsync();
93+
var user = await _graphServiceClient.Me.GetAsync();
9494

9595
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
9696
{

src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Program.Main.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ public static void Main(string[] args)
133133
{
134134
httpContext.VerifyUserHasAnyAcceptedScope(scopeRequiredByApi);
135135

136-
var user = await graphServiceClient.Me.Request().GetAsync();
136+
var user = await graphServiceClient.Me.GetAsync();
137137

138138
var forecast = Enumerable.Range(1, 5).Select(index =>
139139
new WeatherForecast

src/ProjectTemplates/Web.ProjectTemplates/content/WebApi-CSharp/Program.MinimalAPIs.OrgOrIndividualB2CAuth.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
{
101101
httpContext.VerifyUserHasAnyAcceptedScope(scopeRequiredByApi);
102102

103-
var user = await graphServiceClient.Me.Request().GetAsync();
103+
var user = await graphServiceClient.Me.GetAsync();
104104

105105
var forecast = Enumerable.Range(1, 5).Select(index =>
106106
new WeatherForecast

0 commit comments

Comments
 (0)