A2v10.Identity.ApiKey 10.1.8504

dotnet add package A2v10.Identity.ApiKey --version 10.1.8504                
NuGet\Install-Package A2v10.Identity.ApiKey -Version 10.1.8504                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="A2v10.Identity.ApiKey" Version="10.1.8504" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add A2v10.Identity.ApiKey --version 10.1.8504                
#r "nuget: A2v10.Identity.ApiKey, 10.1.8504"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install A2v10.Identity.ApiKey as a Cake Addin
#addin nuget:?package=A2v10.Identity.ApiKey&version=10.1.8504

// Install A2v10.Identity.ApiKey as a Cake Tool
#tool nuget:?package=A2v10.Identity.ApiKey&version=10.1.8504                

About

A2v10.Identity.ApiKey allows the ApiKey authorization for the A2v10 platform applications.

How to use

The ApiKey may be plain text (KeyType.ApiKey) or contain encoded user claims (KeyType.EncodedClaims).

If you use KeyType.EncodedClaims, you must specify the encryption key and vector.

Use

ApiKeyUserHelper<T>.GenerateApiKey(User, Сonfiguration)

for generate encoded ApiKey.

// T - type of user identifier
.AddApiKeyAuthorization<T>(options => {
    // options is read only
});

// configure
services.Configure<ApiKeyConfigurationOptions>(options =>
{
	options.KeyType = KeyType.EncodedClaims; /* or KeyType.ApiKey */
	/* for KeyType.EncodedClaims */
	options.AesEncryptKey = "Aes_Encrypt_Key";
	options.AesEncryptVector = "Aes_Encrypt_Vector";
	options.SkipCheckUser = true;
	/* or */
	options.Configure<Int64>(KeyType.EncodedClaims, Configuration);
});

appsettings.json (for KeyType.EncodedClaims)

"AesEncrypt": {
	"Key": "my_encrypt_key_1", /* 16 chars min */
	"Vector": "my_encrypt_vector_1" /* 16 chars min */
}

Feedback

A2v10.Identity.ApiKey is released as open source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
10.1.8504 104 12/21/2024
10.1.8503 142 12/5/2024
10.1.8500 102 11/19/2024
10.1.8363 137 11/3/2024
10.1.8360 137 10/25/2024
10.1.8358 95 10/25/2024
10.1.8351 147 10/9/2024
10.1.8348 97 10/5/2024
10.1.8347 96 10/1/2024
10.1.8346 105 9/29/2024
10.1.8341 134 9/6/2024
10.1.8340 93 9/2/2024
10.1.8339 145 8/24/2024
10.1.8338 136 8/23/2024
10.1.8332 107 8/7/2024
10.1.8328 71 7/31/2024
10.1.8327 87 7/25/2024
10.1.8325 80 7/23/2024
10.1.8322 125 7/17/2024
10.1.8319 105 7/10/2024
10.1.8315 110 7/5/2024
10.1.8306 141 6/20/2024
10.1.8305 110 6/18/2024
10.1.8303 101 6/13/2024
10.1.8301 115 6/8/2024
10.1.8296 125 5/28/2024
10.1.8295 105 5/28/2024
10.1.8286 116 5/14/2024
10.1.8282 125 5/8/2024
10.1.8280 158 4/26/2024
10.1.8276 161 4/15/2024
10.1.8275 144 4/7/2024
10.1.8271 148 3/30/2024
10.1.8268 162 3/18/2024
10.1.8267 117 3/18/2024
10.1.8266 111 3/16/2024
10.1.8261 155 3/8/2024
10.1.8259 145 2/28/2024
10.1.8255 117 2/25/2024
10.1.8251 118 2/23/2024
10.1.8235 141 2/3/2024
10.1.8233 132 1/30/2024
10.1.8226 146 1/18/2024
10.1.8222 131 1/11/2024
10.1.8220 127 1/10/2024
10.1.8214 146 1/2/2024
10.1.8213 127 12/31/2023
10.1.8198 131 12/21/2023
10.1.8188 160 12/9/2023
10.1.8186 160 11/29/2023
10.1.8184 134 11/24/2023
10.1.8183 145 11/23/2023
10.1.8180 140 11/18/2023
10.1.8171 159 11/9/2023
10.1.8168 168 11/6/2023
10.1.8159 145 9/27/2023
10.1.8152 183 9/11/2023
10.1.8150 171 9/3/2023
10.1.8147 195 9/2/2023
10.1.8143 229 8/22/2023
10.1.8134 210 8/5/2023
10.1.8126 208 7/25/2023
10.1.8114 229 7/7/2023
10.1.8109 231 6/12/2023
10.1.8097 227 4/21/2023
10.1.8096 220 4/10/2023
10.1.8095 235 4/9/2023
10.1.8094 208 4/9/2023
10.1.8093 263 3/22/2023
10.1.8092 252 3/12/2023
10.1.8091 224 3/7/2023
10.1.8090 268 3/7/2023
10.1.8089 259 3/2/2023
10.1.8088 292 2/10/2023
10.1.8087 301 1/31/2023
10.1.8086 346 1/29/2023
10.1.8085 348 1/22/2023
10.1.8084 337 1/20/2023
10.1.8083 317 1/12/2023
10.1.8078 338 12/8/2022
10.1.8076 468 10/21/2022
10.1.8075 488 10/19/2022