-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DotNet Credential should be scoped to a valid region when using CloudFront KeyValueStore #3143
Comments
@genifycom This is a bug on our side. The CloudFront KeyValueStore service uses SigV4a for signing and our automations systems didn't pick that up and is signing with SigV4 which causes the error you are seeing. We will work to get this addressed so it uses SigV4a. If you need an immediate work around you can subclass public class AmazonCloudFrontKeyValueStoreClientWithSigV4a : AmazonCloudFrontKeyValueStoreClient
{
public AmazonCloudFrontKeyValueStoreClientWithSigV4a(AWSCredentials creds, AmazonCloudFrontKeyValueStoreConfig config)
: base(creds, config) { }
public AmazonCloudFrontKeyValueStoreClientWithSigV4a(AmazonCloudFrontKeyValueStoreConfig config)
: base(config) { }
protected override AbstractAWSSigner CreateSigner()
{
return new Amazon.Runtime.Internal.Auth.AWS4aSignerCRTWrapper();
}
} Since this is using SigV4a you also need to include the |
Good day @genifycom |
Thanks so much! |
|
@genifycom The release is completed, please update CloudFrontKeyValueStore nuget package to v3.7.300.28 |
Don't forget to add NuGet AWSSDK.Extensions.CrtIntegration v3.7.300 as a dependency for CloudFrontKeyValueStore v3.7.300.28 otherwise this will not work. Thanks |
I tested with Windows and everything is fine. Under Android (MAUI Android) however result = await kvs.ListKeysAsync(request); //Gives "The type initializer for 'Aws.Crt.NativeAPI' threw an exception" The call stack shows nothing useful. Using the latest:
|
Oh, I think this is an issue with the CRT library, as far as I know it doesn't support .NET bindings on Android / IOS. We have a separate issue with the same root cause (#2126), I'll close this one and also follow up on the |
Comments on closed issues are hard for our team to see. |
Describe the bug
Error: "Credential should be scoped to a valid region" when attempting to read keys from the CloudFront KeyValueStore.
Might be related to #1097 in the JS AWS-SDK
Expected Behavior
As per AWS CLI, the keys/values are returned from the KeyValueStore
Current Behavior
c# Exception with the Message "Credential should be scoped to a valid region"
Reproduction Steps
The following c# code dementrates the issue. Checked kvarn using AWS CLI and results return as expected.
`
BasicAWSCredentials creds = new BasicAWSCredentials(aws_access_key, aws_secret_key);
`
Possible Solution
Maybe something with signing as per #1097 in the JS AWS-SDK
Additional Information/Context
No response
AWS .NET SDK and/or Package version used
Targeted .NET Platform
.NET Core .8
Operating System and version
Windows 11
The text was updated successfully, but these errors were encountered: