{"id":26400590,"url":"https://github.com/mihirdilip/aspnetcore-authentication-apikey","last_synced_at":"2025-05-16T03:02:11.691Z","repository":{"id":38854836,"uuid":"227888780","full_name":"mihirdilip/aspnetcore-authentication-apikey","owner":"mihirdilip","description":"Easy to use and very light weight Microsoft style API Key Authentication Implementation for ASP.NET Core. It can be setup so that it can accept API Key in Header, Authorization Header, QueryParams or HeaderOrQueryParams.","archived":false,"fork":false,"pushed_at":"2024-06-29T17:20:52.000Z","size":143,"stargazers_count":300,"open_issues_count":4,"forks_count":44,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-08T09:42:11.808Z","etag":null,"topics":["api-key-authentication","apikey","apikey-authentication","apikeyauthentication","asp-net-core","asp-net-core-apikey-authentication","asp-net-core-authentication","aspnetcore","aspnetcore-apikey-authentication","aspnetcore-authentication","authentication","authentication-scheme","net50","netstandard","netstandard20","security"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mihirdilip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-13T17:17:09.000Z","updated_at":"2025-04-17T09:05:04.000Z","dependencies_parsed_at":"2023-11-23T00:20:54.976Z","dependency_job_id":"f488d8d7-b24c-4f7d-a182-2f16306910d8","html_url":"https://github.com/mihirdilip/aspnetcore-authentication-apikey","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihirdilip%2Faspnetcore-authentication-apikey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihirdilip%2Faspnetcore-authentication-apikey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihirdilip%2Faspnetcore-authentication-apikey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mihirdilip%2Faspnetcore-authentication-apikey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mihirdilip","download_url":"https://codeload.github.com/mihirdilip/aspnetcore-authentication-apikey/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459077,"owners_count":22074604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-key-authentication","apikey","apikey-authentication","apikeyauthentication","asp-net-core","asp-net-core-apikey-authentication","asp-net-core-authentication","aspnetcore","aspnetcore-apikey-authentication","aspnetcore-authentication","authentication","authentication-scheme","net50","netstandard","netstandard20","security"],"created_at":"2025-03-17T14:27:04.313Z","updated_at":"2025-05-16T03:02:11.673Z","avatar_url":"https://github.com/mihirdilip.png","language":"C#","funding_links":[],"categories":["C# #"],"sub_categories":[],"readme":"# AspNetCore.Authentication.ApiKey\nEasy to use and very light weight Microsoft style API Key Authentication Implementation for ASP.NET Core. It can be setup so that it can accept API Key either in Header, Authorization Header, QueryParams, HeaderOrQueryParams or RouteValues.\n\n[View On GitHub](https://github.com/mihirdilip/aspnetcore-authentication-apikey)\n\n\u003cbr/\u003e\n\n## .NET (Core) Frameworks Supported  \n.NET Framework 4.6.1 and/or NetStandard 2.0 onwards  \nMulti targeted: net8.0; net7.0; net6.0; net5.0; netcoreapp3.1; netcoreapp3.0; netstandard2.0; net461\n\n\u003cbr/\u003e \n\n## Installing\nThis library is published on NuGet. So the NuGet package can be installed directly to your project if you wish to use it without making any custom changes to the code.\n\nDownload directly from [AspNetCore.Authentication.ApiKey](https://www.nuget.org/packages/AspNetCore.Authentication.ApiKey).\n\nOr by running the below command on your project.\n\n```\nPM\u003e Install-Package AspNetCore.Authentication.ApiKey\n```\n\n\u003cbr/\u003e\n\n## Example Usage\n\nSamples are available under [samples directory](samples).\n\nSetting it up is quite simple. You will need basic working knowledge of ASP.NET Core 2.0 or newer to get started using this library.\n\nThere are 2 different ways of using this library to do it's job. Both ways can be mixed if required.  \n1] Using the implementation of *IApiKeyProvider*  \n2] Using *ApiKeyOptions.Events* (OnValidateKey delegate) which is same approach you will find on Microsoft's authentication libraries\n\nNotes:\n- It requires Realm to be set in the options if SuppressWWWAuthenticateHeader is not set.\n- 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.\n\n**Always use HTTPS (SSL Certificate) protocol in production when using API Key authentication.**\n\n#### Startup.cs (ASP.NET Core 3.0 onwards)\n\n```C#\nusing AspNetCore.Authentication.ApiKey;\npublic class Startup\n{\n\tpublic void ConfigureServices(IServiceCollection services)\n\t{\n\t\t// It requires Realm to be set in the options if SuppressWWWAuthenticateHeader is not set.\n\t\t// 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.\n\n\t\tservices.AddAuthentication(ApiKeyDefaults.AuthenticationScheme)\n\n\t\t\t// The below AddApiKeyInHeaderOrQueryParams without type parameter will require options.Events.OnValidateKey delegete to be set.\n\t\t\t//.AddApiKeyInHeaderOrQueryParams(options =\u003e\n\n\t\t\t// The below AddApiKeyInHeaderOrQueryParams with type parameter will add the ApiKeyProvider to the dependency container. \n\t\t\t.AddApiKeyInHeaderOrQueryParams\u003cApiKeyProvider\u003e(options =\u003e\n\t\t\t{\n\t\t\t\toptions.Realm = \"Sample Web API\";\n\t\t\t\toptions.KeyName = \"X-API-KEY\";\n\t\t\t});\n\n\t\tservices.AddControllers();\n\n\t\t//// By default, authentication is not challenged for every request which is ASP.NET Core's default intended behaviour.\n\t\t//// So to challenge authentication for every requests please use below FallbackPolicy option.\n\t\t//services.AddAuthorization(options =\u003e\n\t\t//{\n\t\t//\toptions.FallbackPolicy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();\n\t\t//});\n\t}\n\n\tpublic void Configure(IApplicationBuilder app, IHostingEnvironment env)\n\t{\n\t\tapp.UseHttpsRedirection();\n\n\t\t// The below order of pipeline chain is important!\n\t\tapp.UseRouting();\n\n\t\tapp.UseAuthentication();\n\t\tapp.UseAuthorization();\n\n\t\tapp.UseEndpoints(endpoints =\u003e\n\t\t{\n\t\t\tendpoints.MapControllers();\n\t\t});\n\t}\n}\n```\n\n#### Startup.cs (ASP.NET Core 2.0 onwards)\n\n```C#\nusing AspNetCore.Authentication.ApiKey;\npublic class Startup\n{\n\tpublic void ConfigureServices(IServiceCollection services)\n\t{\n\t\t// It requires Realm to be set in the options if SuppressWWWAuthenticateHeader is not set.\n\t\t// 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.\n\n\t\tservices.AddAuthentication(ApiKeyDefaults.AuthenticationScheme)\n\n\t\t\t// The below AddApiKeyInHeaderOrQueryParams without type parameter will require options.Events.OnValidateKey delegete to be set.\n\t\t\t//.AddApiKeyInHeaderOrQueryParams(options =\u003e\n\n\t\t\t// The below AddApiKeyInHeaderOrQueryParams with type parameter will add the ApiKeyProvider to the dependency container. \n\t\t\t.AddApiKeyInHeaderOrQueryParams\u003cApiKeyProvider\u003e(options =\u003e\n\t\t\t{\n\t\t\t\toptions.Realm = \"Sample Web API\";\n\t\t\t\toptions.KeyName = \"X-API-KEY\";\n\t\t\t});\n\n\n\t\tservices.AddMvc();\n\n\t\t//// By default, authentication is not challenged for every request which is ASP.NET Core's default intended behaviour.\n\t\t//// So to challenge authentication for every requests please use below option instead of above services.AddMvc().\n\t\t//services.AddMvc(options =\u003e \n\t\t//{\n\t\t//\toptions.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()));\n\t\t//});\n\t}\n\n\tpublic void Configure(IApplicationBuilder app, IHostingEnvironment env)\n\t{\n\t\tapp.UseAuthentication();\n\t\tapp.UseMvc();\n\t}\n}\n```\n\n\n\n#### ApiKeyProvider.cs\n```C#\nusing AspNetCore.Authentication.ApiKey;\npublic class ApiKeyProvider : IApiKeyProvider\n{\n\tprivate readonly ILogger\u003cIApiKeyProvider\u003e _logger;\n\tprivate readonly IApiKeyRepository _apiKeyRepository;\n\t\n\tpublic ApiKeyProvider(ILogger\u003cIApiKeyProvider\u003e logger, IApiKeyRepository apiKeyRepository)\n\t{\n\t\t_logger = logger;\n\t\t_apiKeyRepository = apiKeyRepository;\n\t}\n\n\tpublic async Task\u003cIApiKey\u003e ProvideAsync(string key)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// write your validation implementation here and return an instance of a valid ApiKey or retun null for an invalid key.\n\t\t\t// return await _apiKeyRepository.GetApiKeyAsync(key);\n\t\t\treturn null;\n\t\t}\n\t\tcatch (System.Exception exception)\n\t\t{\n\t\t\t_logger.LogError(exception, exception.Message);\n\t\t\tthrow;\n\t\t}\n\t}\n}\n```\n\n#### ApiKey.cs\n```C#\nusing AspNetCore.Authentication.ApiKey;\nclass ApiKey : IApiKey\n{\n\tpublic ApiKey(string key, string owner, List\u003cClaim\u003e claims = null)\n\t{\n\t\tKey = key;\n\t\tOwnerName = owner;\n\t\tClaims = claims ?? new List\u003cClaim\u003e();\n\t}\n\n\tpublic string Key { get; }\n\tpublic string OwnerName { get; }\n\tpublic IReadOnlyCollection\u003cClaim\u003e Claims { get; }\n}\n```\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Configuration (ApiKeyOptions)\n\n### KeyName\nRequired to be set. It is the name of the header if it is setup as in header or the name of the query parameter if set as in query_params or the name of the route key if set as in route_values.\n\n### Realm\nRequired to be set if SuppressWWWAuthenticateHeader is not set to true. It is used with WWW-Authenticate response header when challenging un-authenticated requests.  \n\n### SuppressWWWAuthenticateHeader\nDefault value is false.  \nIf set to true, it will NOT return WWW-Authenticate response header when challenging un-authenticated requests.  \nIf set to false, it will return WWW-Authenticate response header when challenging un-authenticated requests.\n\n### IgnoreAuthenticationIfAllowAnonymous (available on ASP.NET Core 3.0 onwards)\nDefault value is false.  \nIf set to true, it checks if AllowAnonymous filter on controller action or metadata on the endpoint which, if found, it does not try to authenticate the request.\n\n### ForLegacyIgnoreExtraValidatedApiKeyCheck\nDefault value is false. \nIf set to true, IApiKey.Key property returned from IApiKeyProvider.ProvideAsync(string) method is not compared with the key parsed from the request.\nThis extra check did not existed in the previous version. So you if want to revert back to old version validation, please set this to true.\n\n### ForLegacyUseKeyNameAsSchemeNameOnWWWAuthenticateHeader\nDefault value is false. \nIf set to true, value of KeyName property is used as scheme name on the WWW-Authenticate response header when challenging un-authenticated requests.\nIf set to false, the authentication scheme name (set when setting up authentication on authentication builder) is used as scheme name on the WWW-Authenticate response header when challenging un-authenticated requests.\n\n### Events\nThe object provided by the application to process events raised by the api key authentication middleware.  \nThe application may implement the interface fully, or it may create an instance of ApiKeyEvents and assign delegates only to the events it wants to process.\n- #### OnValidateKey\n\tA delegate assigned to this property will be invoked just before validating the api key.  \n\tYou must provide a delegate for this property for authentication to occur.  \n\tIn your delegate you should either call context.ValidationSucceeded() which will handle construction of authentication claims principal from the api key which will be assiged the context.Principal property and calls context.Success(), or construct an authentication claims principal from the api key and assign it to the context.Principal property and finally call context.Success() method.  \n\tIf only context.Principal property set without calling context.Success() method then, Success() method is automaticalled called.\n\n- #### OnAuthenticationSucceeded  \n\tA delegate assigned to this property will be invoked when the authentication succeeds. It will not be called if OnValidateKey delegate is assigned.  \n    It can be used for adding claims, headers, etc to the response.\n\n- #### OnAuthenticationFailed  \n\tA delegate assigned to this property will be invoked when any unexpected exception is thrown within the library.\n\n- #### OnHandleChallenge  \n\tA delegate assigned to this property will be invoked before a challenge is sent back to the caller when handling unauthorized response.  \n\tOnly use this if you know what you are doing and if you want to use custom implementation. Set the delegate to deal with 401 challenge concerns, if an authentication scheme in question deals an authentication interaction as part of it's request flow. (like adding a response header, or changing the 401 result to 302 of a login page or external sign-in location.)  \n    Call context.Handled() at the end so that any default logic for this challenge will be skipped.\n\n- #### OnHandleForbidden  \n\tA delegate assigned to this property will be invoked if Authorization fails and results in a Forbidden response.  \n\tOnly use this if you know what you are doing and if you want to use custom implementation.  \n\tSet the delegate to handle Forbid.  \n\tCall context.Handled() at the end so that any default logic will be skipped.\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Extension Methods  \nMany overloads for each of the below are available to follow the same convension as Microsoft follows.  \n\n### AddApiKeyInHeader  \nAdds ApiKey authentication which can handle the api key in the Header.  \nWWW-Authenticate challenge header will contain parameter `in=\"header\"`.  \n\n### AddApiKeyInAuthorizationHeader  \nAdds ApiKey authentication which can handle the api key in the Authorization Header.  \nWWW-Authenticate challenge header will contain parameter `in=\"authorization_header\"`.  \n\n### AddApiKeyInQueryParams  \nAdds ApiKey authentication which can handle the api key in the url query paramter.  \nWWW-Authenticate challenge header will contain parameter `in=\"query_params\"`.  \n\n### AddApiKeyInHeaderOrQueryParams  \nAdds ApiKey authentication which can handle the api key in the either Header, Authorization Header or Query Parameter.  \nWWW-Authenticate challenge header will contain parameter `in=\"header_or_query_params\"`.  \n\n### AddApiKeyInRouteValues  \nAdds ApiKey authentication which can handle the api key in the url route identified by the route pattern key.  \nWWW-Authenticate challenge header will contain parameter `in=\"route_values\"`.  \n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## WWW-Authenticate Header\nThe WWW-Authenticate header returned for unauthorized requests.  \n\n\tWWW-Authenticate: \u003cSCHEME_NAME\u003e realm=\"\u003cREALM\u003e\", charset=\"UTF-8\", in=\"\u003cIN_PARAMERTER\u003e\", key_name=\"\u003cKEY_NAME\u003e\"  \n\nwhere,  \n- \u003cSCHEME_NAME\u003e == The authentication scheme name. But, if *ApiKeyOptions.ForLegacyUseKeyNameAsSchemeNameOnWWWAuthenticateHeader* is set to true then it will be *ApiKeyOptions.KeyName*  \n\n- \u0026lt;REALM\u0026gt; == *ApiKeyOptions.Realm*  \n\n- \u003cIN_PARAMERTER\u003e == Depending on the [extension method](#extension-methods) used, it could be either of *header*, *authorization_header*, *query_params*, *header_or_query_params*, *route_values*  \n\n- \u003cKEY_NAME\u003e == *ApiKeyOptions.KeyName*  \n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Additional Notes\n\n### API Key Authentication Not Challenged\nWith ASP.NET Core, all the requests are not challenged for authentication by default. So don't worry if your *ApiKeyProvider* or *OnValidateKey* is not hit when you don't pass the required api key authentication details with the request. It is a normal behaviour. ASP.NET Core challenges authentication only when it is specifically told to do so either by decorating controller/method with *[Authorize]* filter attribute or by some other means. \n\nHowever, if you want all the requests to challenge authentication by default, depending on what you are using, you can add the below options line to *ConfigureServices* method on *Startup* class.\n\n```C#\n// On ASP.NET Core 3.0 onwards\nservices.AddAuthorization(options =\u003e\n{\n    options.FallbackPolicy = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();\n});\n\n// OR\n\n// On ASP.NET Core 2.0 onwards\nservices.AddMvc(options =\u003e \n{\n    options.Filters.Add(new AuthorizeFilter(new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build()));\n});\n```\n  \nIf you are not using MVC but, using Endpoints on ASP.NET Core 3.0 or newer, you can add a chain method `.RequireAuthorization()` to the endpoint map under *Configure* method on *Startup* class as shown below.\n\n```C#\n// ASP.NET Core 3.0 onwards\napp.UseEndpoints(endpoints =\u003e\n{\n    endpoints.MapGet(\"/\", async context =\u003e\n    {\n        await context.Response.WriteAsync(\"Hello World!\");\n    }).RequireAuthorization();  // NOTE THIS HERE!!!! \n});\n```\n\n### Multiple Authentication Schemes\nASP.NET Core supports adding multiple authentication schemes which this library also supports. Just need to use the extension method which takes scheme name as parameter. The rest is all same. This can be achieved in many different ways. Below is just a quick rough example. Also refer to [this conversation here](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/20).  \n\nPlease note that scheme name parameter can be any string you want.\n\n```C#\npublic void ConfigureServices(IServiceCollection services)\n{\n\tservices.AddTransient\u003cIApiKeyRepository, InMemoryApiKeyRepository\u003e();\n\n\tservices.AddAuthentication(\"InHeader\")\n\t\t\t\t\n\t\t.AddApiKeyInHeader\u003cApiKeyProvider\u003e(\"InHeader\", options =\u003e\n\t\t{\n\t\t\toptions.Realm = \"Sample Web API\";\n\t\t\toptions.KeyName = \"X-API-KEY\";\n\t\t})\n\n\t\t.AddApiKeyInQueryParams\u003cApiKeyProvider_2\u003e(\"InQueryParams\", options =\u003e\n\t\t{\n\t\t\toptions.Realm = \"Sample Web API\";\n\t\t\toptions.KeyName = \"key\";\n\t\t})\n\n\t\t.AddApiKeyInAuthorizationHeader(\"XYZ\", options =\u003e\n\t\t{\n\t\t\toptions.Realm = \"Sample Web API\";\n\t\t\toptions.KeyName = \"APIKEY\";\n\t\t\toptions.Events = new ApiKeyEvents\n\t\t\t{\n\t\t\t\tOnValidateKey = async context =\u003e\n\t\t\t\t{\n\t\t\t\t\tvar apiKeyRepository = context.HttpContext.RequestServices.GetRequiredService\u003cIApiKeyRepository\u003e();\n\t\t\t\t\tvar apiKeyObj = await apiKeyRepository.GetApiKeyAsync(context.ApiKey);\n\t\t\t\t\tif (apiKeyObj != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontext.ValidationSucceeded(apiKeyObj.Claims);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tcontext.ValidationFailed();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t});\n\n\tservices.AddAuthorization(options =\u003e\n\t{\n\t\toptions.FallbackPolicy = new AuthorizationPolicyBuilder(\"InHeader\", \"InQueryParams\",\"XYZ\")\n\t\t\t.RequireAuthenticatedUser()\n\t\t\t.Build();\n\t});\n}\n```\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## Release Notes\n| Version | \u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; Notes |\n|---------|-------|\n|8.0.1    | \u003cul\u003e\u003cli\u003eAdded support to have ApiKey in request route identified by route pattern key from netcoreapp3.0 onwards [#41](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/41)\u003c/li\u003e\u003cli\u003eReadme updated\u003c/li\u003e\u003c/ul\u003e |\n|8.0.0    | \u003cul\u003e\u003cli\u003enet8.0 support added\u003c/li\u003e\u003cli\u003eSample project for net8.0 added\u003c/li\u003e\u003cli\u003eApiKeySamplesClient.http file added for testing sample projects\u003c/li\u003e\u003cli\u003eReadme updated\u003c/li\u003e\u003c/ul\u003e |\n|7.0.0    | \u003cul\u003e\u003cli\u003enet7.0 support added\u003c/li\u003e\u003cli\u003eInformation log on handler is changed to Debug log when API Key is not found on the request\u003c/li\u003e\u003cli\u003eAdded package validations\u003c/li\u003e\u003cli\u003eSample project for net7.0 added\u003c/li\u003e\u003cli\u003eReadme updated\u003c/li\u003e\u003cli\u003eReadme added to package\u003c/li\u003e\u003c/ul\u003e |\n|6.0.1    | \u003cul\u003e\u003cli\u003enet6.0 support added\u003c/li\u003e\u003cli\u003eInformation log on handler is changed to Debug log when IgnoreAuthenticationIfAllowAnonymous is enabled\u003c/li\u003e\u003cli\u003eSample project added\u003c/li\u003e\u003cli\u003eReadme updated\u003c/li\u003e\u003cli\u003eCopyright year updated on License\u003c/li\u003e\u003c/ul\u003e |\n|5.1.0    | \u003cul\u003e\u003cli\u003eWWW-Authenticate challenge header now returns SchemeName as scheme part instead of ApiKeyOptions.KeyName\u003c/li\u003e\u003cli\u003eWWW-Authenticate challenge header now has 2 new parameters 'in' and 'key_name' in value part\u003c/li\u003e\u003cli\u003eForLegacyUseKeyNameAsSchemeNameOnWWWAuthenticateHeader added to the ApiKeyOptions\u003c/li\u003e\u003cli\u003eIn Authorization Header now able to use either SchemeName or ApiKeyOptions.KeyName when matching AuthorizationHeader Scheme\u003c/li\u003e\u003cli\u003eVisibility of all the handlers changed to public [#21](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/21)\u003c/li\u003e\u003cli\u003eTests added\u003c/li\u003e\u003cli\u003eReadme updated\u003c/li\u003e\u003cli\u003eCopyright year updated on License\u003c/li\u003e\u003c/ul\u003e |\n|5.0.0    | \u003cul\u003e\u003cli\u003eNet 5.0 target framework added\u003c/li\u003e\u003cli\u003eIgnoreAuthenticationIfAllowAnonymous added to the ApiKeyOptions from netcoreapp3.0 onwards [#15](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/15)\u003c/li\u003e\u003c/ul\u003e |\n|3.1.1    | \u003cul\u003e\u003cli\u003eAbility to have ApiKey in Authorization header added\u003c/li\u003e\u003cli\u003eFixed extensions methods to use correct handler [#13](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/13)\u003c/li\u003e\u003cli\u003eFixed issue with resolving of IApiKeyProvider implementation when using multiple schemes [#12](https://github.com/mihirdilip/aspnetcore-authentication-apikey/issues/12)\u003c/li\u003e\u003c/ul\u003e |\n|3.1.0    | \u003cul\u003e\u003cli\u003eMultitarget framework support added\u003c/li\u003e\u003cli\u003eStrong Name Key support added\u003c/li\u003e\u003cli\u003eSource Link support added\u003c/li\u003e\u003cli\u003eSuppressWWWAuthenticateHeader added to configure options\u003c/li\u003e\u003cli\u003eForLegacyIgnoreExtraValidatedApiKeyCheck added to configure options\u003c/li\u003e\u003cli\u003eEvents added to configure options\u003c/li\u003e\u003c/ul\u003e |\n|2.2.0    | \u003cul\u003e\u003cli\u003eAPI Key Authentication Implementation for ASP.NET Core. It can be setup so that it can accept API Key in Header, QueryParams or HeaderOrQueryParams.\u003c/li\u003e\u003c/ul\u003e |\n\n\u003cbr/\u003e\n\u003cbr/\u003e\n\n## References\n- [ASP.NET Core Security documentation](https://docs.microsoft.com/en-us/aspnet/core/security)\n- [aspnet/Security](https://github.com/dotnet/aspnetcore/tree/master/src/Security)\n\n## License\n[MIT License](https://github.com/mihirdilip/aspnetcore-authentication-apikey/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihirdilip%2Faspnetcore-authentication-apikey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmihirdilip%2Faspnetcore-authentication-apikey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmihirdilip%2Faspnetcore-authentication-apikey/lists"}