Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 8.0.0-preview.149

About

An open-source family of assemblies (MIT license) that targets and complements the Microsoft .NET platform (.NET 7, .NET 6, .NET Standard 2, Universal Windows Platform and .NET Framework 4.6.1 and newer) by providing vast ways of possibilities for all breeds of coders, programmers, developers and the likes thereof.

It is, by heart, free, flexible and built to extend and boost your agile codebelt.

Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 for .NET

The Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 namespace complements the Cuemon.AspNetCore.Authentication namespace while providing a way making and signing HTTP requests in the context of specific AWS services using Signature Version 4.

More documentation available at Cuemon for .NET documentation.

CSharp Example

using var mw = MiddlewareTestFactory.Create();
var context = mw.ServiceProvider.GetRequiredService<IHttpContextAccessor>().HttpContext;

var timestamp = DateTime.Parse("2022-07-10T12:50:42.2737531Z"); // <-- change this to valid date/time

context.Request.Headers.Add(HttpHeaderNames.Host, "cuemon.s3.amazonaws.com");
context.Request.Headers.Add("x-amz-date", timestamp.ToAwsDateTimeString());
context.Request.Headers.Add("x-amz-content-sha256", UnkeyedHashFactory.CreateCryptoSha256().ComputeHash("").ToHexadecimalString());
context.Request.QueryString = QueryString.Create("list-type", "2");

var headerBuilder = new Aws4HmacAuthorizationHeaderBuilder()
    .AddFromRequest(context.Request)
    .AddClientId("AKIAIOSFODNN7EXAMPLE") // <-- change this to valid access key
    .AddClientSecret("wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY") // <-- change this to valid secret
    .AddCredentialScope(timestamp);

var header = headerBuilder.Build().ToString(); // <-- send this AWS

cURL Example

curl --location --request GET 'https://cuemon.s3.amazonaws.com/?list-type=2' --header 'Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20220710/eu-west-1/s3/aws4_request, SignedHeaders=host;x-amz-content-sha256;x-amz-date, Signature=feeb4c8ba41733fadc73cba6631ddfc9a729f371206bbaa77f216a69dd5299c5' --header 'x-amz-date: 20220710T145042Z' --header 'x-amz-content-sha256: e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'

No packages depend on Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4.

Version: 7.1.0 Availability: .NET Standard 2.0, .NET 6.0, .NET 7.0   # ALM - REMOVED TFM for .NET Core 3.1 - CHANGED Dependencies to latest and greatest with respect to TFM   Version: 7.0.0 Availability: .NET Core 3.1, .NET 6.0, .NET 7.0   # New Features - ADDED Aws4HmacAuthorizationHeader class in the Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 namespace that provides a representation of a HTTP AWS4-HMAC-SHA256 Authentication header - ADDED Aws4HmacAuthorizationHeaderBuilder class in the Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 namespace that provides a way to fluently represent a HTTP AWS4-HMAC-SHA256 Authentication header - ADDED Aws4HmacFields class in the Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 namespace that is a collection of constants for Aws4HmacAuthorizationHeaderBuilder and related - ADDED DateTimeExtensions class in the Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 namespace that consist of extension methods for the DateTime struct: ToAwsDateString, ToAwsDateTimeString

.NET 6.0

.NET 7.0

.NET 8.0

Version Downloads Last updated
8.0.0-preview.149 1 11/06/2023
8.0.0-preview.135 0 11/06/2023
8.0.0-preview.106 0 10/25/2023
8.0.0-preview.63 0 10/13/2023
8.0.0-preview.61 0 10/11/2023
8.0.0-preview.60 0 10/05/2023
7.1.0-preview.18 0 06/29/2023
7.1.0-preview.16 0 12/10/2022
7.1.0-preview.15 0 12/09/2022
7.1.0-preview.13 0 12/04/2022
7.1.0-preview.10 0 12/03/2022
7.0.0-preview.270 0 11/08/2022
7.0.0-preview.263 0 11/07/2022
7.0.0-preview.257 0 11/03/2022
7.0.0-preview.245 0 11/01/2022
7.0.0-preview.242 0 11/01/2022
7.0.0-preview.239 0 11/01/2022
7.0.0-preview.235 0 10/30/2022
7.0.0-preview.234 0 10/30/2022
7.0.0-preview.230 0 10/28/2022
7.0.0-preview.226 0 10/27/2022
7.0.0-preview.224 0 10/25/2022
7.0.0-preview.219 0 10/25/2022
7.0.0-preview.218 0 10/24/2022
7.0.0-preview.214 0 10/23/2022
7.0.0-preview.213 0 10/23/2022
7.0.0-preview.207 0 10/20/2022
7.0.0-preview.206 0 10/20/2022
7.0.0-preview.203 0 10/18/2022
7.0.0-preview.190 0 10/16/2022
7.0.0-preview.188 0 10/16/2022
7.0.0-preview.167 0 10/02/2022
7.0.0-preview.163 0 10/01/2022
7.0.0-preview.155 0 09/25/2022
7.0.0-preview.153 0 09/23/2022
7.0.0-preview.150 0 09/22/2022
7.0.0-preview.149 0 09/22/2022
7.0.0-preview.148 0 09/22/2022
7.0.0-preview.126 1 07/12/2022
7.0.0-preview.122 1 07/11/2022