The request signature we calculated does not match the signature you provided. When I tried to access cloudfront.

0

After I deployed this library https://github.com/aws-samples/image-optimization I coundn't archive images by cloudfront url. Error: {"message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details."}

2 Answers
1

I had a look at the GitHub repository and there is an open issue related to signature errors caused by spaces in the file name when signing through CloudFront. The author has commented that they are testing a possible fix that should be published within the next two weeks. The thread also includes current workaround you can try.

If your error was related you can expect the upcoming release to fix your problem.

AWS
Gary_S
answered 7 days ago
0

Hi Katya,

Please try this solution,

troubleshooting steps for the CloudFront signature mismatch.

Step 1 Double-check Credentials:

Make sure you're using the correct Access Key ID and Secret Access Key for your AWS account.

Step 2 Verify Library Usage:

If you're using the aws-samples/image-optimization library, follow the library's instructions exactly for signing requests to CloudFront. This might involve specific functions or configurations.

Step 3 Check Custom Code (if applicable):

If you wrote your own code for signing, ensure it follows the AWS Signature Version 4 (SigV4) protocol accurately This involves building specific parts of the request to create the signature. https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingAWSSDK.html

Step 4 Simple CloudFront Test (optional):

Try using the AWS Console to access a CloudFront resource directly. If it works there, the issue likely lies with your code or library.

EXPERT
answered 7 days ago