Skip to content

Commit 8ea0e72

Browse files
authored
Merge pull request #64 from damienbod/net9
Support .NET 9
2 parents dc8915e + 02d8fd6 commit 8ea0e72

17 files changed

+48
-43
lines changed

.github/workflows/dotnet.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ jobs:
1212
runs-on: ubuntu-latest
1313

1414
steps:
15-
- uses: actions/checkout@v3
15+
- uses: actions/checkout@v4
1616

1717
- name: Setup .NET
18-
uses: actions/setup-dotnet@v3
18+
uses: actions/setup-dotnet@v4
1919
with:
20-
dotnet-version: 8.0.*
20+
dotnet-version: 9.0.*
2121

2222
- name: Build Blazor template
2323
run: dotnet build ./BlazorBffOpenIdConnect/

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ jobs:
1313
fetch-depth: 0
1414

1515
- name: Setup .NET
16-
uses: actions/setup-dotnet@v3
16+
uses: actions/setup-dotnet@v4
1717
with:
18-
dotnet-version: 8.0.*
18+
dotnet-version: 9.0.*
1919

2020
- name: Build Blazor template
2121
run: dotnet build ./BlazorBffOpenIdConnect/

BlazorBffOpenIDConnect.Template.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<Authors>damienbod</Authors>
88
<Description>This template provides a simple Blazor template with BFF server authentication WASM hosted.</Description>
99
<PackageTags>dotnet-new;templates;Blazor;BFF;WASM;ASP.NET Core;AspNetCore;OpenIDConnect;OAuth2</PackageTags>
10-
<TargetFramework>net8.0</TargetFramework>
10+
<TargetFramework>net9.0</TargetFramework>
1111
<Summary>This template provides a simple Blazor template with BFF server authentication WASM hosted</Summary>
1212
<IncludeContentInPack>true</IncludeContentInPack>
1313
<IncludeBuildOutput>false</IncludeBuildOutput>
@@ -16,10 +16,10 @@
1616
<NoDefaultExcludes>true</NoDefaultExcludes>
1717
<PackageIcon>icon.png</PackageIcon>
1818
<PackageProjectUrl>https://github.com/damienbod/Blazor.BFF.OpenIDConnect.Template</PackageProjectUrl>
19-
<Copyright>2023 damienbod</Copyright>
19+
<Copyright>2024 damienbod</Copyright>
2020
<PackageReadmeFile>README-NUGET.md</PackageReadmeFile>
2121
<RepositoryUrl>https://github.com/damienbod/Blazor.BFF.OpenIDConnect.Template</RepositoryUrl>
22-
<PackageReleaseNotes>New template, support for HTTP port parameter</PackageReleaseNotes>
22+
<PackageReleaseNotes>Support .NET 9</PackageReleaseNotes>
2323
<PackageLicenseFile>LICENSE</PackageLicenseFile>
2424
</PropertyGroup>
2525

BlazorBffOpenIdConnect/Client/BlazorBffOpenIDConnect.Client.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<NoDefaultLaunchSettingsFile>true</NoDefaultLaunchSettingsFile>
66
<Nullable>enable</Nullable>
77
<ImplicitUsings>enable</ImplicitUsings>
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.8" />
12-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.8" PrivateAssets="all" />
13-
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
14-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="8.0.8" />
11+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="9.0.0" />
12+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="9.0.0" PrivateAssets="all" />
13+
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0" />
14+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="9.0.0" />
1515
</ItemGroup>
1616

1717
<ItemGroup>
Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
1-
global using System.Net;
2-
global using System.Net.Http.Headers;
3-
global using System.Net.Http.Json;
4-
global using System.Security.Claims;
5-
6-
global using BlazorBffOpenIDConnect.Client;
1+
global using BlazorBffOpenIDConnect.Client;
72
global using BlazorBffOpenIDConnect.Client.Services;
83
global using BlazorBffOpenIDConnect.Shared.Authorization;
94
global using BlazorBffOpenIDConnect.Shared.Defaults;
10-
115
global using Microsoft.AspNetCore.Components;
126
global using Microsoft.AspNetCore.Components.Authorization;
137
global using Microsoft.AspNetCore.Components.WebAssembly.Hosting;
148
global using Microsoft.Extensions.DependencyInjection.Extensions;
159
global using Microsoft.JSInterop;
10+
global using System.Net;
11+
global using System.Net.Http.Headers;
12+
global using System.Net.Http.Json;
13+
global using System.Security.Claims;

BlazorBffOpenIdConnect/Client/Services/AntiforgeryHttpClientFactory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace BlazorBffOpenIDConnect.Client.Services;
22

3-
public class AntiforgeryHttpClientFactory(IHttpClientFactory httpClientFactory, IJSRuntime jSRuntime)
3+
public class AntiforgeryHttpClientFactory(IHttpClientFactory httpClientFactory, IJSRuntime jSRuntime)
44
: IAntiforgeryHttpClientFactory
55
{
66
public async Task<HttpClient> CreateClientAsync(string clientName = AuthDefaults.AuthorizedClientName)

BlazorBffOpenIdConnect/Client/Services/AuthorizedHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace BlazorBffOpenIDConnect.Client.Services;
22

33
// orig src https://github.com/berhir/BlazorWebAssemblyCookieAuth
4-
public class AuthorizedHandler(HostAuthenticationStateProvider authenticationStateProvider)
4+
public class AuthorizedHandler(HostAuthenticationStateProvider authenticationStateProvider)
55
: DelegatingHandler
66
{
77
protected override async Task<HttpResponseMessage> SendAsync(

BlazorBffOpenIdConnect/Client/Services/HostAuthenticationStateProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
namespace BlazorBffOpenIDConnect.Client.Services;
22

33
// orig src https://github.com/berhir/BlazorWebAssemblyCookieAuth
4-
public class HostAuthenticationStateProvider(NavigationManager navigation, HttpClient client, ILogger<HostAuthenticationStateProvider> logger)
4+
public class HostAuthenticationStateProvider(NavigationManager navigation, HttpClient client, ILogger<HostAuthenticationStateProvider> logger)
55
: AuthenticationStateProvider
66
{
77
private static readonly TimeSpan userCacheRefreshInterval = TimeSpan.FromSeconds(60);
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net9.0</TargetFramework>
55
<Nullable>enable</Nullable>
66
<ImplicitUsings>enable</ImplicitUsings>
77
</PropertyGroup>
@@ -12,10 +12,10 @@
1212
</ItemGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="8.0.8" />
16-
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.8" NoWarn="NU1605" />
17-
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.0.0-preview.1" />
18-
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders.TagHelpers" Version="1.0.0-preview.1" />
15+
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Server" Version="9.0.0" />
16+
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="9.0.0" NoWarn="NU1605" />
17+
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="1.0.0-preview.2" />
18+
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders.TagHelpers" Version="1.0.0-preview.2" />
1919
</ItemGroup>
2020

2121
</Project>
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
1-
global using System.Diagnostics;
2-
global using System.Security.Claims;
3-
4-
global using BlazorBffOpenIDConnect.Server;
1+
global using BlazorBffOpenIDConnect.Server;
52
global using BlazorBffOpenIDConnect.Server.Services;
63
global using BlazorBffOpenIDConnect.Shared.Authorization;
74
global using BlazorBffOpenIDConnect.Shared.Defaults;
8-
95
global using Microsoft.AspNetCore.Authentication;
106
global using Microsoft.AspNetCore.Authentication.Cookies;
117
global using Microsoft.AspNetCore.Authentication.OpenIdConnect;
@@ -14,4 +10,6 @@
1410
global using Microsoft.AspNetCore.Mvc;
1511
global using Microsoft.AspNetCore.Mvc.RazorPages;
1612
global using Microsoft.IdentityModel.Protocols.OpenIdConnect;
13+
global using System.Diagnostics;
14+
global using System.Security.Claims;
1715

0 commit comments

Comments
 (0)