diff --git a/src/Security/.gitignore b/src/Security/.gitignore
index d5717b3f3f..3d7e16e84a 100644
--- a/src/Security/.gitignore
+++ b/src/Security/.gitignore
@@ -30,3 +30,4 @@ project.lock.json
/.vs/
.vscode/
global.json
+BenchmarkDotNet.Artifacts/
diff --git a/src/Security/Directory.Build.targets b/src/Security/Directory.Build.targets
index 78626b773e..7e3f8df92e 100644
--- a/src/Security/Directory.Build.targets
+++ b/src/Security/Directory.Build.targets
@@ -1,10 +1,6 @@
- $(MicrosoftNETCoreApp20PackageVersion)
- $(MicrosoftNETCoreApp21PackageVersion)
- $(MicrosoftNETCoreApp22PackageVersion)
+ $(MicrosoftNETCoreAppPackageVersion)
$(NETStandardLibrary20PackageVersion)
-
- 99.9
diff --git a/src/Security/README.md b/src/Security/README.md
index e8e64c2936..66c2aa45e8 100644
--- a/src/Security/README.md
+++ b/src/Security/README.md
@@ -1,9 +1,7 @@
-ASP.NET Security
-========
+ASP.NET Security [Archived]
+===========================
-AppVeyor: [](https://ci.appveyor.com/project/aspnetci/Security/branch/dev)
-
-Travis: [](https://travis-ci.org/aspnet/Security)
+**This GitHub project has been archived.** Ongoing development on this project can be found in .
Contains the security and authorization middlewares for ASP.NET Core.
@@ -14,4 +12,4 @@ A list of community projects related to authentication and security for ASP.NET
ASP.NET Security will not include Basic Authentication middleware due to its potential insecurity and performance problems. If you host under IIS you can enable it via IIS configuration.
-This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.
+This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [AspNetCore](https://github.com/aspnet/AspNetCore) repo.
diff --git a/src/Security/Security.sln b/src/Security/Security.sln
index 3df759651b..240100e8c4 100644
--- a/src/Security/Security.sln
+++ b/src/Security/Security.sln
@@ -79,6 +79,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Authen
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WsFedSample", "samples\WsFedSample\WsFedSample.csproj", "{5EC2E398-E46A-430D-8E4B-E91C8FC3E800}"
EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks", "{55052FE3-F8C2-4E6C-97B0-C02ED1DBEA62}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Security.Performance", "benchmarks\Microsoft.AspNetCore.Security.Performance\Microsoft.AspNetCore.Security.Performance.csproj", "{556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -517,6 +521,22 @@ Global
{5EC2E398-E46A-430D-8E4B-E91C8FC3E800}.Release|x64.Build.0 = Release|Any CPU
{5EC2E398-E46A-430D-8E4B-E91C8FC3E800}.Release|x86.ActiveCfg = Release|Any CPU
{5EC2E398-E46A-430D-8E4B-E91C8FC3E800}.Release|x86.Build.0 = Release|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Debug|x64.Build.0 = Debug|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Debug|x86.Build.0 = Debug|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Release|x64.ActiveCfg = Release|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Release|x64.Build.0 = Release|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Release|x86.ActiveCfg = Release|Any CPU
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -549,6 +569,7 @@ Global
{24A28F5D-E5A9-4CA8-B0D2-924A1F8BE14E} = {F8C0AA27-F3FB-4286-8E4C-47EF86B539FF}
{B1FC6AAF-9BF2-4CDA-84A2-AA8BF7603F29} = {4D2B6A51-2F9F-44F5-8131-EA5CAC053652}
{5EC2E398-E46A-430D-8E4B-E91C8FC3E800} = {F8C0AA27-F3FB-4286-8E4C-47EF86B539FF}
+ {556C4FAA-F4B1-4EA9-8921-CB1DF7D94C2A} = {55052FE3-F8C2-4E6C-97B0-C02ED1DBEA62}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {ABF8089E-43D0-4010-84A7-7A9DCFE49357}
diff --git a/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/AuthorizationMiddlewareBenchmark.cs b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/AuthorizationMiddlewareBenchmark.cs
new file mode 100644
index 0000000000..90cb135de5
--- /dev/null
+++ b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/AuthorizationMiddlewareBenchmark.cs
@@ -0,0 +1,53 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading.Tasks;
+using BenchmarkDotNet.Attributes;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Http.Features;
+using Microsoft.Extensions.Options;
+
+namespace Microsoft.AspNetCore.Security
+{
+ public class AuthorizationMiddlewareBenchmark
+ {
+ private AuthorizationMiddleware _authorizationMiddleware;
+ private DefaultHttpContext _httpContextNoEndpoint;
+ private DefaultHttpContext _httpContextHasEndpoint;
+
+ [GlobalSetup]
+ public void Setup()
+ {
+ var policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions()));
+ _authorizationMiddleware = new AuthorizationMiddleware((context) => Task.CompletedTask, policyProvider);
+
+ _httpContextNoEndpoint = new DefaultHttpContext();
+
+ var feature = new EndpointFeature
+ {
+ Endpoint = new Endpoint((context) => Task.CompletedTask, EndpointMetadataCollection.Empty, "Test endpoint")
+ };
+ _httpContextHasEndpoint = new DefaultHttpContext();
+ _httpContextHasEndpoint.Features.Set(feature);
+ }
+
+ [Benchmark]
+ public Task Invoke_NoEndpoint_NoAuthorization()
+ {
+ return _authorizationMiddleware.Invoke(_httpContextNoEndpoint);
+ }
+
+ [Benchmark]
+ public Task Invoke_HasEndpoint_NoAuthorization()
+ {
+ return _authorizationMiddleware.Invoke(_httpContextHasEndpoint);
+ }
+
+ private class EndpointFeature : IEndpointFeature
+ {
+ public Endpoint Endpoint { get; set; }
+ }
+ }
+}
diff --git a/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/AuthorizationPolicyBenchmark.cs b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/AuthorizationPolicyBenchmark.cs
new file mode 100644
index 0000000000..86afdcd5ae
--- /dev/null
+++ b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/AuthorizationPolicyBenchmark.cs
@@ -0,0 +1,28 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Threading.Tasks;
+using BenchmarkDotNet.Attributes;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.Extensions.Options;
+
+namespace Microsoft.AspNetCore.Security
+{
+ public class AuthorizationPolicyBenchmark
+ {
+ private DefaultAuthorizationPolicyProvider _policyProvider;
+
+ [GlobalSetup]
+ public void Setup()
+ {
+ _policyProvider = new DefaultAuthorizationPolicyProvider(Options.Create(new AuthorizationOptions()));
+ }
+
+ [Benchmark]
+ public Task CombineAsync()
+ {
+ return AuthorizationPolicy.CombineAsync(_policyProvider, Array.Empty());
+ }
+ }
+}
diff --git a/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/Microsoft.AspNetCore.Security.Performance.csproj b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/Microsoft.AspNetCore.Security.Performance.csproj
new file mode 100644
index 0000000000..2f16dd6699
--- /dev/null
+++ b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/Microsoft.AspNetCore.Security.Performance.csproj
@@ -0,0 +1,24 @@
+
+
+
+ netcoreapp3.0
+ Exe
+ true
+ true
+ false
+ Microsoft.AspNetCore.Security
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/Properties/AssemblyInfo.cs b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000000..cfb0b19c2e
--- /dev/null
+++ b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/Properties/AssemblyInfo.cs
@@ -0,0 +1 @@
+[assembly: BenchmarkDotNet.Attributes.AspNetCoreBenchmark]
\ No newline at end of file
diff --git a/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/readme.md b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/readme.md
new file mode 100644
index 0000000000..cbe60261b3
--- /dev/null
+++ b/src/Security/benchmarks/Microsoft.AspNetCore.Security.Performance/readme.md
@@ -0,0 +1,16 @@
+Compile the solution in Release mode (so binaries are available in release)
+
+To run a specific benchmark add it as parameter.
+```
+dotnet run -c Release --framework
+```
+
+To run all benchmarks use '*' as the name.
+```
+dotnet run -c Release --framework *
+```
+
+If you run without any parameters, you'll be offered the list of all benchmarks and get to choose.
+```
+dotnet run -c Release --framework
+```
\ No newline at end of file
diff --git a/src/Security/build/dependencies.props b/src/Security/build/dependencies.props
index 0d1a80ebb6..163a3d4004 100644
--- a/src/Security/build/dependencies.props
+++ b/src/Security/build/dependencies.props
@@ -3,50 +3,54 @@
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
- 2.2.0-preview2-20181004.6
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 3.14.2
- 5.2.0
- 5.2.0
- 2.0.9
- 2.1.3
- 2.2.0-preview3-27001-02
+ 0.10.13
+ 3.0.0-build-20181114.5
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-preview-181113-11
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-alpha1-10742
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.0.0-preview-181113-11
+ 3.19.8
+ 5.3.0
+ 5.3.0
+ 3.0.0-preview1-26907-05
15.6.1
3.0.1
3.0.1
3.0.1
+ 4.10.0
2.0.3
11.0.2
- 5.2.0
+ 5.3.0
0.10.0
2.3.1
2.4.0
+
diff --git a/src/Security/build/repo.props b/src/Security/build/repo.props
index 077c753e69..4402da1d0d 100644
--- a/src/Security/build/repo.props
+++ b/src/Security/build/repo.props
@@ -1,19 +1,13 @@
-
-
-
Internal.AspNetCore.Universe.Lineup
- 2.2.0-*
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json
-
-
-
+
diff --git a/src/Security/samples/CookiePolicySample/CookiePolicySample.csproj b/src/Security/samples/CookiePolicySample/CookiePolicySample.csproj
index 48227eb07c..010edb018e 100644
--- a/src/Security/samples/CookiePolicySample/CookiePolicySample.csproj
+++ b/src/Security/samples/CookiePolicySample/CookiePolicySample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.2
+ netcoreapp3.0
diff --git a/src/Security/samples/CookieSample/CookieSample.csproj b/src/Security/samples/CookieSample/CookieSample.csproj
index 1029f18193..bc92d68a21 100644
--- a/src/Security/samples/CookieSample/CookieSample.csproj
+++ b/src/Security/samples/CookieSample/CookieSample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.2
+ netcoreapp3.0
diff --git a/src/Security/samples/CookieSessionSample/CookieSessionSample.csproj b/src/Security/samples/CookieSessionSample/CookieSessionSample.csproj
index 19bd043746..6230c98a53 100644
--- a/src/Security/samples/CookieSessionSample/CookieSessionSample.csproj
+++ b/src/Security/samples/CookieSessionSample/CookieSessionSample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.2
+ netcoreapp3.0
diff --git a/src/Security/samples/JwtBearerSample/JwtBearerSample.csproj b/src/Security/samples/JwtBearerSample/JwtBearerSample.csproj
index 3e0192a233..58bf5e2d97 100644
--- a/src/Security/samples/JwtBearerSample/JwtBearerSample.csproj
+++ b/src/Security/samples/JwtBearerSample/JwtBearerSample.csproj
@@ -1,7 +1,7 @@
- net461;netcoreapp2.2
+ netcoreapp3.0
aspnet5-JwtBearerSample-20151210102827
diff --git a/src/Security/samples/JwtBearerSample/wwwroot/index.html b/src/Security/samples/JwtBearerSample/wwwroot/index.html
index f71dccb693..4715ebd42a 100644
--- a/src/Security/samples/JwtBearerSample/wwwroot/index.html
+++ b/src/Security/samples/JwtBearerSample/wwwroot/index.html
@@ -64,5 +64,6 @@
+