Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 7.0.0-alpha

Prefix Reserved
This is a prerelease version of Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4.
There is a newer version of this package available.
See the version list below for details.
dotnet add package Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 --version 7.0.0-alpha                
NuGet\Install-Package Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 -Version 7.0.0-alpha                
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="Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4" Version="7.0.0-alpha" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 --version 7.0.0-alpha                
#r "nuget: Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4, 7.0.0-alpha"                
#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 Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 as a Cake Addin
#addin nuget:?package=Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4&version=7.0.0-alpha&prerelease

// Install Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4 as a Cake Tool
#tool nuget:?package=Cuemon.Extensions.AspNetCore.Authentication.AwsSignature4&version=7.0.0-alpha&prerelease                

About

An open-source family of assemblies (MIT license) that targets and complements the Microsoft .NET platform (.NET 6, .NET Core 3.1, .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'
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp3.1 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
8.3.2 93 8/4/2024
8.3.1 113 6/2/2024
8.3.0 135 4/9/2024
8.2.0 129 3/3/2024
8.1.0 160 2/10/2024
8.1.0-rc1 115 2/8/2024
8.1.0-preview.52 61 2/5/2024
8.1.0-preview.20 73 1/22/2024
8.1.0-preview 111 1/16/2024
8.0.1 200 1/11/2024
8.0.0 212 11/14/2023
8.0.0-rc2 107 11/13/2023
8.0.0-rc1 122 11/7/2023
8.0.0-preview.183 69 11/13/2023
8.0.0-preview.176 70 11/12/2023
8.0.0-preview.158 71 11/9/2023
7.1.0 458 12/11/2022
7.0.0 462 11/9/2022
7.0.0-rc.2 118 11/3/2022
7.0.0-rc.1 112 10/26/2022
7.0.0-alpha.2 114 10/16/2022
7.0.0-alpha.1 131 9/23/2022
7.0.0-alpha 196 7/12/2022

Version: 7.0.0
Availability: .NET Core 3.1, .NET 6.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