The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256

前端 未结 20 1570
既然无缘
既然无缘 2020-11-22 14:19

I get an error AWS::S3::Errors::InvalidRequest The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256. when I try upload fi

20条回答
  •  臣服心动
    2020-11-22 15:13

    Basically the error was because I was using old version of aws-sdk and I updated the version so this error occured.

    in my case with node js i was using signatureVersion in parmas object like this :

    const AWS_S3 = new AWS.S3({
      params: {
        Bucket: process.env.AWS_S3_BUCKET,
        signatureVersion: 'v4',
        region: process.env.AWS_S3_REGION
      }
    });
    

    Then I put signature out of params object and worked like charm :

    const AWS_S3 = new AWS.S3({
      params: {
        Bucket: process.env.AWS_S3_BUCKET,
        region: process.env.AWS_S3_REGION
      },
      signatureVersion: 'v4'
    });
    

提交回复
热议问题