Skip to content

Commit

Permalink
Merge pull request #46 from RockSolidKnowledge/feature/sf/11696-updat…
Browse files Browse the repository at this point in the history
…e-samples

Update samples to .Net 8.0, OpenIddict 5.1 and IdentityServer 7.0.
  • Loading branch information
JoStevensRSK authored Jan 31, 2024
2 parents e97b3fc + 8f875fa commit c8d5565
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 130 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\LicenseKey.cs" Link="LicenseKey.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer" Version="6.0.0" />
<PackageReference Include="Rsk.Saml" Version="5.0.0" />
<PackageReference Include="Rsk.Saml.DuendeIdentityServer" Version="6.0.0" />

<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Duende.IdentityServer" Version="7.0.0" />
<PackageReference Include="Rsk.Saml" Version="9.0.0" />
<PackageReference Include="Rsk.Saml.DuendeIdentityServer" Version="9.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<None Update="idsrv3test.cer">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -25,7 +20,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>



</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public override void OnResultExecuting(ResultExecutingContext context)
// 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 @@ -36,19 +36,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
10 changes: 5 additions & 5 deletions DuendeIdentityServer/DuendeIdP/DuendeIdP.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>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

Expand All @@ -10,10 +10,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Duende.IdentityServer" Version="6.0.0" />
<PackageReference Include="Rsk.Saml" Version="5.0.0" />
<PackageReference Include="Rsk.Saml.DuendeIdentityServer" Version="6.0.0" />
<PackageReference Include="Duende.IdentityServer" Version="7.0.0" />
<PackageReference Include="Rsk.Saml" Version="9.0.0" />
<PackageReference Include="Rsk.Saml.DuendeIdentityServer" Version="9.0.0" />

<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
</ItemGroup>
</Project>
10 changes: 5 additions & 5 deletions DuendeIdentityServer/DuendeIdP/Pages/SecurityHeadersAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public override void OnResultExecuting(ResultExecutingContext context)
// 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 @@ -36,19 +36,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 DuendeIdentityServer/SLO/SamlOidcSLO/Common/Common.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>38ced442-cf32-4289-bb08-57d4a78831b3</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AspNetCore.ReCaptcha" Version="1.7.0" />
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="6.2.3" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.WsFederation" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="7.0.4" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="7.0.4" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="7.0.4" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="7.0.4" />
<PackageReference Include="AspNetCore.ReCaptcha" Version="1.8.1" />
<PackageReference Include="Duende.IdentityServer.EntityFramework" Version="7.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.WsFederation" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.DataProtection.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Caching.StackExchangeRedis" Version="8.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.90" />
<PackageReference Include="Rsk.Saml.DuendeIdentityServer" Version="7.0.3" />
<PackageReference Include="Rsk.Saml.DuendeIdentityServer.EntityFramework" Version="7.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="6.1.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.4" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.4.0" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="6.3.0" />
<PackageReference Include="System.ServiceModel.Http" Version="4.10.2" />
<PackageReference Include="System.ServiceModel.Primitives" Version="4.10.2" />
<PackageReference Include="Oracle.ManagedDataAccess.Core" Version="3.21.130" />
<PackageReference Include="Rsk.Saml.DuendeIdentityServer" Version="9.0.0" />
<PackageReference Include="Rsk.Saml.DuendeIdentityServer.EntityFramework" Version="9.0.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Serilog.Settings.Configuration" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.MSSqlServer" Version="6.5.1" />
<PackageReference Include="System.ServiceModel.Http" Version="8.0.0" />
<PackageReference Include="System.ServiceModel.Primitives" Version="8.0.0" />
</ItemGroup>
<ItemGroup>
<None Update="Resources\testclient.cer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ public override void OnResultExecuting(ResultExecutingContext context)
// 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 @@ -36,19 +36,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
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

app.Use(async (context, next) =>
{
context.Response.Headers.Add("X-Frame-Options", "SAMEORIGIN");
context.Response.Headers.Append("X-Frame-Options", "SAMEORIGIN");
await next();
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>WebClient</RootNamespace>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.13" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="6.22.0" />
<PackageReference Include="Rsk.Saml" Version="5.4.1" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.1" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="7.3.0" />
<PackageReference Include="Rsk.Saml" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>WebClient</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\..\..\LicenseKey.cs" Link="LicenseKey.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.1" />
<PackageReference Include="Rsk.Saml" Version="6.0.1" />
<PackageReference Include="Rsk.Saml" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<None Update="testclient.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>


</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,25 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>WebClient</RootNamespace>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\..\..\LicenseKey.cs" Link="LicenseKey.cs" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="6.0.1" />
<PackageReference Include="Rsk.Saml" Version="6.0.0-preview1" />
<PackageReference Include="Rsk.Saml" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.OpenIdConnect" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
<None Update="testclient.pfx">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
</Project>
39 changes: 16 additions & 23 deletions OpenIddict/OpenIddictIdP/OpenIddictIdP.csproj
Original file line number Diff line number Diff line change
@@ -1,35 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<CopyRefAssembliesToPublishDirectory>false</CopyRefAssembliesToPublishDirectory>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\..\LicenseKey.cs" Link="LicenseKey.cs" />
</ItemGroup>


<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="7.0.12" />
<PackageReference Include="Microsoft.Extensions.Http" Version="7.0.0" />
<PackageReference Include="Rsk.Saml.OpenIddict.AspNetCore.Identity" Version="8.0.0-preview1" />
<PackageReference Include="Rsk.Saml.OpenIddict.AspNetCore.Identity" Version="9.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Identity.UI" Version="8.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="7.0.12" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="7.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="7.0.12" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" PrivateAssets="all" Version="7.0.12" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.10" />
<PackageReference Include="OpenIddict.Quartz" Version="4.9.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.6.3" />
<PackageReference Include="Rsk.Saml.OpenIddict" Version="8.0.0-preview1" />
<PackageReference Include="Rsk.Saml.OpenIddict.EntityFrameworkCore" Version="8.0.0-preview1" />
<PackageReference Include="Rsk.Saml.OpenIddict.Quartz" Version="1.0.0" />
<PackageReference Include="OpenIddict.Quartz" Version="5.1.0" />
<PackageReference Include="Quartz.Extensions.Hosting" Version="3.8.0" />
<PackageReference Include="Rsk.Saml.OpenIddict" Version="9.0.0" />
<PackageReference Include="Rsk.Saml.OpenIddict.EntityFrameworkCore" Version="9.0.0" />
<PackageReference Include="Rsk.Saml.OpenIddict.Quartz" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
<None Update="Resources\idsrv3test.cer">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand All @@ -38,5 +32,4 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>

</Project>
</Project>
Loading

0 comments on commit c8d5565

Please sign in to comment.