Dotnet AWS SDK not working? #308

Closed
opened 2022-05-20 13:54:18 +00:00 by schmitch · 1 comment

Hello, I tried to use garage with the dotnet aws sdk, however I always get the following:

Response: error 400 Bad Request, Authorization header malformed, expected scope: 20220520/us-east-1/s3/aws4_request

the sdk sets a header like that (looked via wireshark) (truncated):

Authorization: AWS4-HMAC-SHA256 Credential=GK5bd52c23174d4eab734ac433/20220520/us-east-1/s3/aws4_request, SignedHeaders=host;user-agent;x-amz-content-sha256;x-amz-date, Signature=fe3dd21995d65bc7c26d450d6465826d564a6d647d17dba25be7d8d34469c1fc

this is the Config I'm using:

var s3Config = new AmazonS3Config
{
            AuthenticationServiceName = "s3",
            AuthenticationRegion = "us-east-1",
            SignatureMethod = SigningAlgorithm.HmacSHA256,
            SignatureVersion = "s3v4", // can wire s3 or v4 makes no difference
            UseHttp = true,
            ServiceURL = "http://192.168.179.212:3900",
            ForcePathStyle = true,
};

anybody got an idea why that's the case?

I'm using Garage 0.7 S3 in K8s and my dotnet aws sdk is version: 3.7.9.4

it looks like that garage does not expect the access key id, like defined in: https://docs.amazonaws.cn/en_us/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html

Hello, I tried to use `garage` with the dotnet aws sdk, however I always get the following: ``` Response: error 400 Bad Request, Authorization header malformed, expected scope: 20220520/us-east-1/s3/aws4_request ``` the sdk sets a header like that (looked via wireshark) (truncated): ``` Authorization: AWS4-HMAC-SHA256 Credential=GK5bd52c23174d4eab734ac433/20220520/us-east-1/s3/aws4_request, SignedHeaders=host;user-agent;x-amz-content-sha256;x-amz-date, Signature=fe3dd21995d65bc7c26d450d6465826d564a6d647d17dba25be7d8d34469c1fc ``` this is the Config I'm using: ``` var s3Config = new AmazonS3Config { AuthenticationServiceName = "s3", AuthenticationRegion = "us-east-1", SignatureMethod = SigningAlgorithm.HmacSHA256, SignatureVersion = "s3v4", // can wire s3 or v4 makes no difference UseHttp = true, ServiceURL = "http://192.168.179.212:3900", ForcePathStyle = true, }; ``` anybody got an idea why that's the case? I'm using Garage 0.7 S3 in K8s and my dotnet aws sdk is version: 3.7.9.4 it looks like that garage does not expect the access key id, like defined in: https://docs.amazonaws.cn/en_us/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html
Author

I'm dump, somehow the region was wrong and should be garage

I'm dump, somehow the region was wrong and should be garage
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Deuxfleurs/garage#308
No description provided.