Skip to content

Commit be49f1e

Browse files
committed
Readme updated
1 parent 9c7f589 commit be49f1e

File tree

1 file changed

+40
-4
lines changed

1 file changed

+40
-4
lines changed

README.md

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@ Easy to use and very light weight Microsoft style API Key Authentication Impleme
33

44
[View On GitHub](https://github.com/mihirdilip/aspnetcore-authentication-apikey)
55

6+
<br/>
7+
68
## .NET (Core) Frameworks Supported
79
.NET Framework 4.6.1 and/or NetStandard 2.0 onwards
810
Multi targeted: net5.0; netcoreapp3.1; netcoreapp3.0; netstandard2.0; net461
911

12+
<br/>
13+
1014
## Installing
1115
This 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.
1216

@@ -18,6 +22,8 @@ Or by running the below command on your project.
1822
PM> Install-Package AspNetCore.Authentication.ApiKey
1923
```
2024

25+
<br/>
26+
2127
## Example Usage
2228

2329
Samples are available under [samples directory](samples).
@@ -178,7 +184,11 @@ class ApiKey : IApiKey
178184
}
179185
```
180186

187+
<br/>
188+
<br/>
189+
181190
## Configuration (ApiKeyOptions)
191+
182192
### KeyName
183193
Required 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.
184194

@@ -231,6 +241,9 @@ The application may implement the interface fully, or it may create an instance
231241
Set the delegate to handle Forbid.
232242
Call context.Handled() at the end so that any default logic will be skipped.
233243

244+
<br/>
245+
<br/>
246+
234247
## Extension Methods
235248
Many overloads for each of the below are available to follow the same convension as Microsoft follows.
236249

@@ -250,6 +263,25 @@ WWW-Authenticate challenge header will contain parameter `in="query_params"`.
250263
Adds ApiKey authentication which can handle the api key in the either Header, Authorization Header or Query Parameter.
251264
WWW-Authenticate challenge header will contain parameter `in="header_or_query_params"`.
252265

266+
<br/>
267+
<br/>
268+
269+
## WWW-Authenticate Header
270+
The WWW-Authenticate header returned for unauthorized requests.
271+
272+
WWW-Authenticate: <SCHEME_NAME> realm="<REALM>", charset="UTF-8", in="<IN_PARAMERTER>", key_name="<KEY_NAME>"
273+
274+
where,
275+
- <SCHEME_NAME> == The authentication scheme name. But, if *ApiKeyOptions.ForLegacyUseKeyNameAsSchemeNameOnWWWAuthenticateHeader* is set to true then it will be *ApiKeyOptions.KeyName*
276+
277+
- &lt;REALM&gt; == *ApiKeyOptions.Realm*
278+
279+
- <IN_PARAMERTER> == Depending on the [extension method](#extension-methods) used, it could be either of *header*, *authorization_header*, *query_params*, *header_or_query_params*
280+
281+
- <KEY_NAME> == *ApiKeyOptions.KeyName*
282+
283+
<br/>
284+
<br/>
253285

254286
## Additional Notes
255287

@@ -342,16 +374,20 @@ public void ConfigureServices(IServiceCollection services)
342374
}
343375
```
344376

345-
377+
<br/>
378+
<br/>
346379

347380
## Release Notes
348381
| Version | &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Notes |
349382
|---------|-------|
350-
|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</li><li>Tests added</li><li>Readme updated</li><li>Copyright year updated on License</li></ul> |
351-
|5.0.0 | <ul><li>Net 5.0 target framework added</li><li>IgnoreAuthenticationIfAllowAnonymous added to the ApiKeyOptions from netcoreapp3.0 onwards</li></ul> |
352-
|3.1.1 | <ul><li>Ability to have ApiKey in Authorization header added</li><li>Fixed extensions methods to use correct handler</li><li>Fixed issue with resolving of IApiKeyProvider implementation when using multiple schemes</li></ul> |
383+
|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> |
384+
|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> |
385+
|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> |
353386
|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> |
354387
|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> |
355388

389+
<br/>
390+
<br/>
391+
356392
## License
357393
[MIT License](https://github.com/mihirdilip/aspnetcore-authentication-apikey/blob/master/LICENSE)

0 commit comments

Comments
 (0)