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

前端 未结 20 1166
既然无缘
既然无缘 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

    For Android SDK, setEndpoint solves the problem, although it's been deprecated.

    CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(
                    context, "identityPoolId", Regions.US_EAST_1);
    AmazonS3 s3 = new AmazonS3Client(credentialsProvider);
    s3.setEndpoint("s3.us-east-2.amazonaws.com");
    
    0 讨论(0)
  • 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'
    });
    
    0 讨论(0)
提交回复
热议问题