Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to .NET8 #1337

Merged
merged 8 commits into from
Jun 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ jobs:
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
6.0.x
7.0.x
8.0.100-preview.5.23303.2

- run: dotnet --info

Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ jobs:
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
6.0.x
7.0.x
8.0.100-preview.5.23303.2

- run: dotnet --info

Expand Down
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

<PropertyGroup>
<MinVerAutoIncrement>minor</MinVerAutoIncrement>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<!--<WarningsNotAsErrors>9057</WarningsNotAsErrors>-->
<!--todo: enable again once all warnings are addressed-->
<!--<TreatWarningsAsErrors>True</TreatWarningsAsErrors>-->
</PropertyGroup>
</Project>
9 changes: 8 additions & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>

<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<!--<PropertyGroup Condition=" '$(TargetFramework)' == 'net6.0'">
<FrameworkVersion>6.0.0</FrameworkVersion>
<ExtensionsVersion>6.0.0</ExtensionsVersion>
<EntityFrameworkVersion>6.0.0</EntityFrameworkVersion>
Expand All @@ -12,6 +12,13 @@
<ExtensionsVersion>7.0.0</ExtensionsVersion>
<EntityFrameworkVersion>7.0.0</EntityFrameworkVersion>
<WilsonVersion>6.15.1</WilsonVersion>
</PropertyGroup>-->

<PropertyGroup Condition=" '$(TargetFramework)' == 'net8.0'">
<FrameworkVersion>8.0.0-preview.5.23302.2</FrameworkVersion>
<ExtensionsVersion>8.0.0-preview.5.23280.8</ExtensionsVersion>
<EntityFrameworkVersion>8.0.0-preview.5.23280.1</EntityFrameworkVersion>
<WilsonVersion>6.15.1</WilsonVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
49 changes: 17 additions & 32 deletions Duende.IdentityServer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetIdentityDb", "migrati
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IdentityServerDb", "migrations\IdentityServerDb\IdentityServerDb.csproj", "{99CC3909-D62A-4744-B6AD-89CC272975F3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Host.Main7", "hosts\main7\Host.Main7.csproj", "{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Host.Configuration", "hosts\Configuration\Host.Configuration.csproj", "{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Host.Configuration", "hosts\Configuration\Host.Configuration.csproj", "{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Duende.IdentityServer.Configuration", "src\Configuration\Duende.IdentityServer.Configuration.csproj", "{C0AE6878-A605-4EA9-8439-2EBB1EF09AAA}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Duende.IdentityServer.Configuration", "src\Configuration\Duende.IdentityServer.Configuration.csproj", "{C0AE6878-A605-4EA9-8439-2EBB1EF09AAA}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Duende.IdentityServer.Configuration.EntityFramework", "src\Configuration.EntityFramework\Duende.IdentityServer.Configuration.EntityFramework.csproj", "{754825F1-5386-4343-A3AA-41D31B66179C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Duende.IdentityServer.Configuration.EntityFramework", "src\Configuration.EntityFramework\Duende.IdentityServer.Configuration.EntityFramework.csproj", "{754825F1-5386-4343-A3AA-41D31B66179C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Configuration.IntegrationTests", "test\Configuration.IntegrationTests\Configuration.IntegrationTests.csproj", "{5882A7DB-BD70-481C-A249-3A422652AFD6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Configuration.IntegrationTests", "test\Configuration.IntegrationTests\Configuration.IntegrationTests.csproj", "{5882A7DB-BD70-481C-A249-3A422652AFD6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -241,18 +239,18 @@ Global
{99CC3909-D62A-4744-B6AD-89CC272975F3}.Release|x64.Build.0 = Release|Any CPU
{99CC3909-D62A-4744-B6AD-89CC272975F3}.Release|x86.ActiveCfg = Release|Any CPU
{99CC3909-D62A-4744-B6AD-89CC272975F3}.Release|x86.Build.0 = Release|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Debug|x64.ActiveCfg = Debug|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Debug|x64.Build.0 = Debug|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Debug|x86.ActiveCfg = Debug|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Debug|x86.Build.0 = Debug|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Release|Any CPU.Build.0 = Release|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Release|x64.ActiveCfg = Release|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Release|x64.Build.0 = Release|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Release|x86.ActiveCfg = Release|Any CPU
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C}.Release|x86.Build.0 = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|x64.ActiveCfg = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|x64.Build.0 = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|x86.ActiveCfg = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|x86.Build.0 = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|Any CPU.Build.0 = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|x64.ActiveCfg = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|x64.Build.0 = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|x86.ActiveCfg = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|x86.Build.0 = Release|Any CPU
{C0AE6878-A605-4EA9-8439-2EBB1EF09AAA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C0AE6878-A605-4EA9-8439-2EBB1EF09AAA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C0AE6878-A605-4EA9-8439-2EBB1EF09AAA}.Debug|x64.ActiveCfg = Debug|Any CPU
Expand Down Expand Up @@ -289,18 +287,6 @@ Global
{5882A7DB-BD70-481C-A249-3A422652AFD6}.Release|x64.Build.0 = Release|Any CPU
{5882A7DB-BD70-481C-A249-3A422652AFD6}.Release|x86.ActiveCfg = Release|Any CPU
{5882A7DB-BD70-481C-A249-3A422652AFD6}.Release|x86.Build.0 = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|x64.ActiveCfg = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|x64.Build.0 = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|x86.ActiveCfg = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Debug|x86.Build.0 = Debug|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|Any CPU.Build.0 = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|x64.ActiveCfg = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|x64.Build.0 = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|x86.ActiveCfg = Release|Any CPU
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -321,11 +307,10 @@ Global
{C53603DE-CAF5-4AEB-A424-C1C72356BB17} = {82C80BEB-73A0-4B96-83A4-7C69792CF010}
{77E74EC9-2D1D-40E6-AD02-39F848B51B78} = {49E98D89-5E7E-46BD-86D0-AB33039A5F28}
{99CC3909-D62A-4744-B6AD-89CC272975F3} = {49E98D89-5E7E-46BD-86D0-AB33039A5F28}
{43CF5C83-BD02-49F7-8DB7-FBF7583D668C} = {82C80BEB-73A0-4B96-83A4-7C69792CF010}
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F} = {82C80BEB-73A0-4B96-83A4-7C69792CF010}
{C0AE6878-A605-4EA9-8439-2EBB1EF09AAA} = {D5E9E8E5-4050-4B9A-9F1F-15FA3BDB0684}
{754825F1-5386-4343-A3AA-41D31B66179C} = {D5E9E8E5-4050-4B9A-9F1F-15FA3BDB0684}
{5882A7DB-BD70-481C-A249-3A422652AFD6} = {DF26567D-46BB-4720-8610-EC3D6AB9793C}
{E6EC07BC-1F4E-43BC-ADBB-4ACA0D26920F} = {82C80BEB-73A0-4B96-83A4-7C69792CF010}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FDB095BE-A04A-4440-ACA0-EDD7CF9CFD64}
Expand Down
2 changes: 1 addition & 1 deletion build/build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100-preview.5.23303.2",
"rollForward": "latestMajor",
"allowPrerelease": false
"allowPrerelease": true
}
}
2 changes: 1 addition & 1 deletion hosts/AspNetIdentity/Host.AspNetIdentity.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>IdentityServerHost</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
8 changes: 4 additions & 4 deletions hosts/AspNetIdentity/Pages/Account/Login/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ public async Task<IActionResult> OnPost()

if (ModelState.IsValid)
{
var result = await _signInManager.PasswordSignInAsync(Input.Username, Input.Password, Input.RememberLogin, lockoutOnFailure: true);
var result = await _signInManager.PasswordSignInAsync(Input.Username!, Input.Password!, Input.RememberLogin, lockoutOnFailure: true);
if (result.Succeeded)
{
var user = await _userManager.FindByNameAsync(Input.Username);
await _events.RaiseAsync(new UserLoginSuccessEvent(user.UserName, user.Id, user.UserName, clientId: context?.Client.ClientId));
var user = await _userManager.FindByNameAsync(Input.Username!);
await _events.RaiseAsync(new UserLoginSuccessEvent(user!.UserName, user.Id, user.UserName, clientId: context?.Client.ClientId));

if (context != null)
{
Expand Down Expand Up @@ -197,7 +197,7 @@ private async Task BuildModelAsync(string? returnUrl)
if (client != null)
{
allowLocal = client.EnableLocalLogin;
if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Any())
if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Count != 0)
{
providers = providers.Where(provider =>
provider.AuthenticationScheme != null &&
Expand Down
3 changes: 2 additions & 1 deletion hosts/AspNetIdentity/Pages/ExternalLogin/Callback.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public async Task<IActionResult> OnGet()
return Redirect(returnUrl);
}

[System.Diagnostics.CodeAnalysis.SuppressMessage("Performance", "CA1851:Possible multiple enumerations of 'IEnumerable' collection", Justification = "<Pending>")]
private async Task<ApplicationUser> AutoProvisionUserAsync(string provider, string providerUserId, IEnumerable<Claim> claims)
{
var sub = Guid.NewGuid().ToString();
Expand Down Expand Up @@ -162,7 +163,7 @@ private async Task<ApplicationUser> AutoProvisionUserAsync(string provider, stri
var identityResult = await _userManager.CreateAsync(user);
if (!identityResult.Succeeded) throw new InvalidOperationException(identityResult.Errors.First().Description);

if (filtered.Any())
if (filtered.Count != 0)
{
identityResult = await _userManager.AddClaimsAsync(user, filtered);
if (!identityResult.Succeeded) throw new InvalidOperationException(identityResult.Errors.First().Description);
Expand Down
15 changes: 6 additions & 9 deletions hosts/AspNetIdentity/Pages/SecurityHeadersAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,21 @@ public sealed class SecurityHeadersAttribute : ActionFilterAttribute
{
public override void OnResultExecuting(ResultExecutingContext context)
{
if(context == null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context, nameof(context));

var result = context.Result;
if (result is PageResult)
{
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Type-Options"))
{
context.HttpContext.Response.Headers.Add("X-Content-Type-Options", "nosniff");
context.HttpContext.Response.Headers.Append("X-Content-Type-Options", "nosniff");
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
if (!context.HttpContext.Response.Headers.ContainsKey("X-Frame-Options"))
{
context.HttpContext.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
context.HttpContext.Response.Headers.Append("X-Frame-Options", "SAMEORIGIN");
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
Expand All @@ -40,19 +37,19 @@ public override void OnResultExecuting(ResultExecutingContext context)
// once for standards compliant browsers
if (!context.HttpContext.Response.Headers.ContainsKey("Content-Security-Policy"))
{
context.HttpContext.Response.Headers.Add("Content-Security-Policy", csp);
context.HttpContext.Response.Headers.Append("Content-Security-Policy", csp);
}
// and once again for IE
if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Security-Policy"))
{
context.HttpContext.Response.Headers.Add("X-Content-Security-Policy", csp);
context.HttpContext.Response.Headers.Append("X-Content-Security-Policy", csp);
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
var referrer_policy = "no-referrer";
if (!context.HttpContext.Response.Headers.ContainsKey("Referrer-Policy"))
{
context.HttpContext.Response.Headers.Add("Referrer-Policy", referrer_policy);
context.HttpContext.Response.Headers.Append("Referrer-Policy", referrer_policy);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion hosts/Configuration/CustomClientRegistrationProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace IdentityServerHost;

internal class CustomClientRegistrationProcessor : DynamicClientRegistrationRequestProcessor
internal sealed class CustomClientRegistrationProcessor : DynamicClientRegistrationRequestProcessor
{
private readonly ICollection<Client> _clients;

Expand Down
2 changes: 1 addition & 1 deletion hosts/Configuration/Host.Configuration.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<AspNetCoreHostingModel>InProcess</AspNetCoreHostingModel>
<RootNamespace>IdentityServerHost</RootNamespace>
<UserSecretsId>e60c119c-8b86-4016-9d44-80e25948dbba</UserSecretsId>
Expand Down
2 changes: 1 addition & 1 deletion hosts/Configuration/Pages/Account/Login/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private async Task BuildModelAsync(string? returnUrl)
if (client != null)
{
allowLocal = client.EnableLocalLogin;
if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Any())
if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Count > 0)
{
providers = providers.Where(provider => client.IdentityProviderRestrictions.Contains(provider.AuthenticationScheme)).ToList();
}
Expand Down
15 changes: 6 additions & 9 deletions hosts/Configuration/Pages/SecurityHeadersAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,21 @@ public sealed class SecurityHeadersAttribute : ActionFilterAttribute
{
public override void OnResultExecuting(ResultExecutingContext context)
{
if(context == null)
{
throw new ArgumentNullException(nameof(context));
}
ArgumentNullException.ThrowIfNull(context, nameof(context));

var result = context.Result;
if (result is PageResult)
{
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options
if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Type-Options"))
{
context.HttpContext.Response.Headers.Add("X-Content-Type-Options", "nosniff");
context.HttpContext.Response.Headers.Append("X-Content-Type-Options", "nosniff");
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options
if (!context.HttpContext.Response.Headers.ContainsKey("X-Frame-Options"))
{
context.HttpContext.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
context.HttpContext.Response.Headers.Append("X-Frame-Options", "SAMEORIGIN");
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
Expand All @@ -40,19 +37,19 @@ public override void OnResultExecuting(ResultExecutingContext context)
// once for standards compliant browsers
if (!context.HttpContext.Response.Headers.ContainsKey("Content-Security-Policy"))
{
context.HttpContext.Response.Headers.Add("Content-Security-Policy", csp);
context.HttpContext.Response.Headers.Append("Content-Security-Policy", csp);
}
// and once again for IE
if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Security-Policy"))
{
context.HttpContext.Response.Headers.Add("X-Content-Security-Policy", csp);
context.HttpContext.Response.Headers.Append("X-Content-Security-Policy", csp);
}

// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy
var referrer_policy = "no-referrer";
if (!context.HttpContext.Response.Headers.ContainsKey("Referrer-Policy"))
{
context.HttpContext.Response.Headers.Add("Referrer-Policy", referrer_policy);
context.HttpContext.Response.Headers.Append("Referrer-Policy", referrer_policy);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion hosts/EntityFramework/Host.EntityFramework.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>IdentityServerHost</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion hosts/EntityFramework/Pages/Account/Login/Index.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ private async Task BuildModelAsync(string? returnUrl)
if (client != null)
{
allowLocal = client.EnableLocalLogin;
if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Any())
if (client.IdentityProviderRestrictions != null && client.IdentityProviderRestrictions.Count != 0)
{
providers = providers.Where(provider => client.IdentityProviderRestrictions.Contains(provider.AuthenticationScheme)).ToList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public async Task<IEnumerable<ApiScopeSummaryModel>> GetAllAsync(string? filter
{
Name = scope.Name,
DisplayName = scope.DisplayName,
UserClaims = scope.UserClaims.Any() ? scope.UserClaims.Select(x => x.Type).Aggregate((a, b) => $"{a} {b}") : null,
UserClaims = scope.UserClaims.Count != 0 ? scope.UserClaims.Select(x => x.Type).Aggregate((a, b) => $"{a} {b}") : null,
};
}

Expand Down Expand Up @@ -106,11 +106,11 @@ public async Task UpdateAsync(ApiScopeModel model)
var claimsToAdd = claims.Except(currentClaims).ToArray();
var claimsToRemove = currentClaims.Except(claims).ToArray();

if (claimsToRemove.Any())
if (claimsToRemove.Length != 0)
{
scope.UserClaims.RemoveAll(x => claimsToRemove.Contains(x.Type));
}
if (claimsToAdd.Any())
if (claimsToAdd.Length != 0)
{
scope.UserClaims.AddRange(claimsToAdd.Select(x => new ApiScopeClaim
{
Expand Down
Loading