-
Notifications
You must be signed in to change notification settings - Fork 634
Closed
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp2This is a standard priority issueThis is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.
Description
Checkboxes for prior research
- I've gone through Developer Guide and API reference
- I've checked AWS Forums and StackOverflow.
- I've searched for previous similar issues and didn't find any solution.
Describe the bug
I am generating a signed URL using @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner for a custom domain mapped to my S3 bucket. However, when I call the signed URL, I receive a 403 Forbidden response with the following error:
Error Code: SignatureDoesNotMatch
Error Message: 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.
SDK version number
@aws-sdk/[email protected], @aws-sdk/[email protected]
Which JavaScript Runtime is this issue in?
Node.js
Details of the browser/Node.js/ReactNative version
nodejs18.x
Reproduction Steps
- Code Used to Generate Signed URL:
import { S3, GetObjectCommand } from '@aws-sdk/client-s3';
import { getSignedUrl } from '@aws-sdk/s3-request-presigner';
async function buildSignedUrl() {
const s3 = new S3({
region: 'eu-west-1',
bucketEndpoint: true,
});
const command = new GetObjectCommand({
Bucket: 'my-custom-domain',
Key: 'my-file-key',
});
const signedUrl = await getSignedUrl(s3, command, { expiresIn: 3600 });
console.log(signedUrl);
return signedUrl;
}
- Signed URL is generated successfully and appears correct.
- Calling the Signed URL using curl or a browser results in:
<Error>
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided.</Message>
</Error>
Observed Behavior
Signed URL results in a 403 Forbidden
with SignatureDoesNotMatch
.
Expected Behavior
It should download file.
Possible Solution
No response
Additional Information/Context
No response
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.closed-for-stalenessp2This is a standard priority issueThis is a standard priority issueresponse-requestedWaiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days.