Skip to content

Commit

Permalink
Removed support for .NET versions lower than 6.0 (#1)
Browse files Browse the repository at this point in the history
* Renamed folder.

* Updated README

* Removed support for .NET versions lower than 6.0
  • Loading branch information
mgernand authored Oct 12, 2022
1 parent 0e4cf1e commit cd75f03
Show file tree
Hide file tree
Showing 60 changed files with 153 additions and 1,768 deletions.
63 changes: 0 additions & 63 deletions .gitattributes

This file was deleted.

69 changes: 0 additions & 69 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

65 changes: 65 additions & 0 deletions AspNetCore.Authentication.ApiKey.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".items", ".items", "{D7951782-F429-431D-8464-3E14BBBA7903}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{3C777BBB-7464-43FB-A046-EA465791AB0C}"
ProjectSection(SolutionItems) = preProject
samples\ApiKeySamplesClient.postman_collection.json = samples\ApiKeySamplesClient.postman_collection.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{A15FB7AB-5B7A-4428-BEBA-32DEE3C88C39}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{BCEF726B-D658-40C2-9099-7001BA519E71}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Authentication.ApiKey", "src\AspNetCore.Authentication.ApiKey\AspNetCore.Authentication.ApiKey.csproj", "{09D17A19-0406-487A-810A-24107AE767F8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AspNetCore.Authentication.ApiKey.Tests", "tests\AspNetCore.Authentication.ApiKey.Tests\AspNetCore.Authentication.ApiKey.Tests.csproj", "{5A9AAE35-66E9-408E-B763-C71F0C0751B2}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "SampleWebApi.Shared", "samples\SampleWebApi.Shared\SampleWebApi.Shared.shproj", "{E544FB20-29F3-41F5-A78E-6164F9C43B3C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleWebApi_6_0", "samples\SampleWebApi_6_0\SampleWebApi_6_0.csproj", "{13031DBF-54EA-4A64-A03B-88B4CED1D5F5}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{09D17A19-0406-487A-810A-24107AE767F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09D17A19-0406-487A-810A-24107AE767F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09D17A19-0406-487A-810A-24107AE767F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09D17A19-0406-487A-810A-24107AE767F8}.Release|Any CPU.Build.0 = Release|Any CPU
{5A9AAE35-66E9-408E-B763-C71F0C0751B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5A9AAE35-66E9-408E-B763-C71F0C0751B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5A9AAE35-66E9-408E-B763-C71F0C0751B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5A9AAE35-66E9-408E-B763-C71F0C0751B2}.Release|Any CPU.Build.0 = Release|Any CPU
{13031DBF-54EA-4A64-A03B-88B4CED1D5F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13031DBF-54EA-4A64-A03B-88B4CED1D5F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13031DBF-54EA-4A64-A03B-88B4CED1D5F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13031DBF-54EA-4A64-A03B-88B4CED1D5F5}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{09D17A19-0406-487A-810A-24107AE767F8} = {BCEF726B-D658-40C2-9099-7001BA519E71}
{5A9AAE35-66E9-408E-B763-C71F0C0751B2} = {A15FB7AB-5B7A-4428-BEBA-32DEE3C88C39}
{E544FB20-29F3-41F5-A78E-6164F9C43B3C} = {3C777BBB-7464-43FB-A046-EA465791AB0C}
{13031DBF-54EA-4A64-A03B-88B4CED1D5F5} = {3C777BBB-7464-43FB-A046-EA465791AB0C}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {70815049-1680-480A-BF5A-00536D6C9C20}
EndGlobalSection
GlobalSection(SharedMSBuildProjectFiles) = preSolution
samples\SampleWebApi.Shared\SampleWebApi.Shared.projitems*{13031dbf-54ea-4a64-a03b-88b4ced1d5f5}*SharedItemsImports = 5
samples\SampleWebApi.Shared\SampleWebApi.Shared.projitems*{e544fb20-29f3-41f5-a78e-6164f9c43b3c}*SharedItemsImports = 13
EndGlobalSection
EndGlobal
1 change: 0 additions & 1 deletion CONTRIBUTING.md

This file was deleted.

71 changes: 1 addition & 70 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,6 @@ Easy to use and very light weight Microsoft style API Key Authentication Impleme

[View On GitHub](https://github.com/mgernand/AspNetCore.Authentication.ApiKey)

<br/>

## .NET (Core) Frameworks Supported
.NET Framework 4.6.1 and/or NetStandard 2.0 onwards
Multi targeted: net6.0; net5.0; netcoreapp3.1; netcoreapp3.0; netstandard2.0; net461

<br/>

## Installing
Expand Down Expand Up @@ -43,7 +37,7 @@ Notes:

**Always use HTTPS (SSL Certificate) protocol in production when using API Key authentication.**

#### Startup.cs (ASP.NET Core 3.0 onwards)
#### Configuration

```C#
using AspNetCore.Authentication.ApiKey;
Expand Down Expand Up @@ -95,51 +89,6 @@ public class Startup
}
```

#### Startup.cs (ASP.NET Core 2.0 onwards)

```C#
using AspNetCore.Authentication.ApiKey;

public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
// It requires Realm to be set in the options if SuppressWWWAuthenticateHeader is not set.
// If an implementation of IApiKeyProvider interface is used as well as options.Events.OnValidateKey delegate is also set then this delegate will be used first.
services.AddAuthentication(ApiKeyDefaults.AuthenticationScheme)

// The below AddApiKeyInHeaderOrQueryParams without type parameter will require options.Events.OnValidateKey delegete to be set.
//.AddApiKeyInHeaderOrQueryParams(options =>
// The below AddApiKeyInHeaderOrQueryParams with type parameter will add the ApiKeyProvider to the dependency container.
.AddApiKeyInHeaderOrQueryParams<ApiKeyAuthenticationService>(options =>
{
options.Realm = "Sample Web API";
options.KeyName = "X-API-KEY";
});


services.AddMvc();

//// By default, authentication is not challenged for every request which is ASP.NET Core's default intended behaviour.
//// So to challenge authentication for every requests please use below option instead of above services.AddMvc().
//services.AddMvc(options =>
//{
// options.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()));
//});
}

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseAuthentication();
app.UseMvc();
}
}
```



#### ApiKeyAuthenticationService.cs
```C#
using AspNetCore.Authentication.ApiKey;
Expand Down Expand Up @@ -385,24 +334,6 @@ public void ConfigureServices(IServiceCollection services)
<br/>
<br/>

## Release Notes
| Version | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Notes |
|---------|-------|
|6.2.1 | <ul><li>Renamed interfaces to be consistent with the Basic library.</li></ul>
|6.1.0 | <ul><li>Added IApiKeyAuthenticationServiceFactory for creating IApiKeyAuthenticationService instances dynamically based on the scheme name.</li></ul> |
|6.0.1 | <ul><li>net6.0 support added</li><li>Information log on handler is changed to Debug log when IgnoreAuthenticationIfAllowAnonymous is enabled</li><li>Sample project added</li><li>Readme updated</li><li>Copyright year updated on License</li></ul> |
|5.1.0 | <ul><li>WWW-Authenticate challenge header now returns SchemeName as scheme part instead of ApiKeyOptions.KeyName</li><li>WWW-Authenticate challenge header now has 2 new parameters 'in' and 'key_name' in value part</li><li>ForLegacyUseKeyNameAsSchemeNameOnWWWAuthenticateHeader added to the ApiKeyOptions</li><li>In Authorization Header now able to use either SchemeName or ApiKeyOptions.KeyName when matching AuthorizationHeader Scheme</li><li>Visibility of all the handlers changed to public [#21](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/21)</li><li>Tests added</li><li>Readme updated</li><li>Copyright year updated on License</li></ul> |
|5.0.0 | <ul><li>Net 5.0 target framework added</li><li>IgnoreAuthenticationIfAllowAnonymous added to the ApiKeyOptions from netcoreapp3.0 onwards [#15](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/15)</li></ul> |
|3.1.1 | <ul><li>Ability to have ApiKey in Authorization header added</li><li>Fixed extensions methods to use correct handler [#13](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/13)</li><li>Fixed issue with resolving of IApiKeyProvider implementation when using multiple schemes [#12](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/12)</li></ul> |
|3.1.0 | <ul><li>Multitarget framework support added</li><li>Strong Name Key support added</li><li>Source Link support added</li><li>SuppressWWWAuthenticateHeader added to configure options</li><li>ForLegacyIgnoreExtraValidatedApiKeyCheck added to configure options</li><li>Events added to configure options</li></ul> |
|2.2.0 | <ul><li>API Key Authentication Implementation for ASP.NET Core. It can be setup so that it can accept API Key in Header, QueryParams or HeaderOrQueryParams.</li></ul> |

<br/>
<br/>

## References
- [ASP.NET Core Security documentation](https://docs.microsoft.com/en-us/aspnet/core/security)
- [aspnet/Security](https://github.com/dotnet/aspnetcore/tree/master/src/Security)

## License
[MIT License](https://github.com/mgernand/AspNetCore.Authentication.ApiKey/blob/master/LICENSE)
1 change: 0 additions & 1 deletion _config.yml

This file was deleted.

Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 0 additions & 52 deletions samples/SampleWebApi_2_0/Controllers/ValuesController.cs

This file was deleted.

18 changes: 0 additions & 18 deletions samples/SampleWebApi_2_0/Program.cs

This file was deleted.

Loading

0 comments on commit cd75f03

Please sign in to comment.