What does 'The request signature we calculated does not match the signature you provided' mean?
AWS recomputed the Signature Version 4 signature for your request and got a different value. The usual causes are a wrong or rotated secret access key, whitespace in the key, the wrong region, a modified header or URL after signing, or a clock more than a few minutes off. If you're fixing a key that was in frontend code, rotate it instead.
Last updated 2026-11-25 · Reviewed by ProofForge
The exact error
<Error><Code>SignatureDoesNotMatch</Code><Message>The request signature we calculated does not match the signature you provided. Check your key and signing method.</Message></Error>Why it happens
- Access key ID and secret access key from different keys, or a secret with a trailing newline.
- Signing for one region and sending to another.
- A proxy or your code changes headers, query string or path encoding after signing.
- System clock skew.
How to fix it
- Re-copy both values for the same access key, and check for whitespace.
- Set the region explicitly in the SDK client.
- Use the official SDK or presigner instead of hand-rolled signing.
- Sync the clock (NTP).
import { S3Client } from '@aws-sdk/client-s3'
const s3 = new S3Client({
region: 'us-east-1',
credentials: {
accessKeyId: process.env.AWS_ACCESS_KEY_ID!.trim(),
secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!.trim(),
},
})Check it's fixed
aws sts get-caller-identity with the same credentials succeeds, then the original call succeeds.
Check your live app
A free, read-only public-surface scan. It cannot diagnose private sessions or every cause described above.
FAQ
Does this mean my key leaked?
No. It means the signature didn't match. But if AWS keys are in browser code, use presigned URLs from a server or short-lived credentials instead.
Why does it fail only for some file names?
Special characters in object keys that are encoded differently when signing and sending.
Is it a permissions error?
No. Permission problems return AccessDenied. SignatureDoesNotMatch happens before authorization.