Skip to content
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

Getting error regarding signing request #3558

Closed
1 task done
RobQuatela opened this issue Nov 24, 2024 · 3 comments
Closed
1 task done

Getting error regarding signing request #3558

RobQuatela opened this issue Nov 24, 2024 · 3 comments
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made.

Comments

@RobQuatela
Copy link

RobQuatela commented Nov 24, 2024

Describe the bug

When using the SDK I am receiving this error below. I am not sure if this has something to do with using version 4 for signing. All I did was update the nuget packages to 4.x

The request signature we calculated does not match the signature you provided. Check your key and signing method.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

I expected to make a PutObject request using the SDK

Current Behavior

I am receiving the error below on the same code before I updated the package

The request signature we calculated does not match the signature you provided. Check your key and signing method.

Reproduction Steps

`using var client = new AmazonS3Client("ACCESS_KEY", "SECRET_KEY",RegionEndpoint.USEast1);
try
{
var bytes = Convert.FromBase64String(base64Content);
using var stream = new MemoryStream(bytes);
var putRequest = new PutObjectRequest()
{
BucketName = "cdn.test.com/vcards",
Key = $"{fileName}.vcf",
InputStream = stream,
ContentType = "text/x-vcard"
};

            var response = await client.PutObjectAsync(putRequest);
            return $"https://cdn.test.com/vcards/{fileName}.vcf";
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
            throw;
        }`

Possible Solution

No response

Additional Information/Context

No response

AWS .NET SDK and/or Package version used

AWSSDK 4.0.0-preview.4

Targeted .NET Platform

.NET 7

Operating System and version

MacOS & Docker

@RobQuatela RobQuatela added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Nov 24, 2024
@github-actions github-actions bot added the potential-regression Marking this issue as a potential regression to be checked by team member label Nov 24, 2024
@dscpinheiro
Copy link
Contributor

No, this is not a regression in V4. Newer versions of the S3 package (after 3.7.100) do not allow the bucket name to contain the key prefix (i.e the slash character).

This comment has more details: #2622 (comment)

For your code, I don't know what cdn.test.com is but I assume changing the PutRequest to the following should work:

var putRequest = new PutObjectRequest
{
    BucketName = "cdn.test.com",
    Key = $"vcards/{fileName}.vcf",
    InputStream = stream,
    ContentType = "text/x-vcard"
};

@dscpinheiro dscpinheiro added closing-soon This issue will automatically close in 4 days unless further comments are made. and removed needs-triage This issue or PR still needs to be triaged. potential-regression Marking this issue as a potential regression to be checked by team member labels Nov 25, 2024
@RobQuatela
Copy link
Author

That was it! Thank you again for this!!

Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. closing-soon This issue will automatically close in 4 days unless further comments are made.
Projects
None yet
Development

No branches or pull requests

2 participants