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 96 12/21/2024
10.1.8503 138 12/5/2024
10.1.8500 100 11/19/2024
10.1.8363 135 11/3/2024
10.1.8360 130 10/25/2024
10.1.8358 94 10/25/2024
10.1.8351 146 10/9/2024
10.1.8348 96 10/5/2024
10.1.8347 95 10/1/2024
10.1.8346 104 9/29/2024
10.1.8341 133 9/6/2024
10.1.8340 92 9/2/2024
10.1.8339 144 8/24/2024
10.1.8338 135 8/23/2024
10.1.8332 106 8/7/2024
10.1.8328 70 7/31/2024
10.1.8327 86 7/25/2024
10.1.8325 79 7/23/2024
10.1.8322 122 7/17/2024
10.1.8319 104 7/10/2024
10.1.8315 109 7/5/2024
10.1.8306 140 6/20/2024
10.1.8305 107 6/18/2024
10.1.8303 100 6/13/2024
10.1.8301 114 6/8/2024
10.1.8296 124 5/28/2024
10.1.8295 104 5/28/2024
10.1.8286 115 5/14/2024
10.1.8282 124 5/8/2024
10.1.8280 157 4/26/2024
10.1.8276 160 4/15/2024
10.1.8275 143 4/7/2024
10.1.8271 147 3/30/2024
10.1.8268 161 3/18/2024
10.1.8267 116 3/18/2024
10.1.8266 110 3/16/2024
10.1.8261 154 3/8/2024
10.1.8259 144 2/28/2024
10.1.8255 116 2/25/2024
10.1.8251 117 2/23/2024
10.1.8235 140 2/3/2024
10.1.8233 131 1/30/2024
10.1.8226 145 1/18/2024
10.1.8222 130 1/11/2024
10.1.8220 126 1/10/2024
10.1.8214 145 1/2/2024
10.1.8213 126 12/31/2023
10.1.8198 130 12/21/2023
10.1.8188 159 12/9/2023
10.1.8186 159 11/29/2023
10.1.8184 133 11/24/2023
10.1.8183 144 11/23/2023
10.1.8180 139 11/18/2023
10.1.8171 158 11/9/2023
10.1.8168 167 11/6/2023
10.1.8159 144 9/27/2023
10.1.8152 182 9/11/2023
10.1.8150 170 9/3/2023
10.1.8147 194 9/2/2023
10.1.8143 228 8/22/2023
10.1.8134 209 8/5/2023
10.1.8126 207 7/25/2023
10.1.8114 228 7/7/2023
10.1.8109 230 6/12/2023
10.1.8097 226 4/21/2023
10.1.8096 219 4/10/2023
10.1.8095 234 4/9/2023
10.1.8094 207 4/9/2023
10.1.8093 262 3/22/2023
10.1.8092 251 3/12/2023
10.1.8091 223 3/7/2023
10.1.8090 267 3/7/2023
10.1.8089 258 3/2/2023
10.1.8088 291 2/10/2023
10.1.8087 300 1/31/2023
10.1.8086 345 1/29/2023
10.1.8085 347 1/22/2023
10.1.8084 336 1/20/2023
10.1.8083 316 1/12/2023
10.1.8078 337 12/8/2022
10.1.8076 467 10/21/2022
10.1.8075 487 10/19/2022