Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The authorization mechanism you have provided is not supported #125

Open
10 tasks
isaacguerreir opened this issue Nov 24, 2016 · 3 comments
Open
10 tasks
Labels

Comments

@isaacguerreir
Copy link

Subject of the issue

Appear a error. InvalidRequest: The authorization mechanism you have provided is not supported. Please use AWS4-HMAC-SHA256.

What is that?

Your environment

  • Operating system
    • Mac
    • Windows
    • Linux
  • Node.js version (node --version)
    • Node.js v4.x
    • Node.js v6.x
  • ImageMagick version (identify -version)
    • ImageMagick v6.9.x
    • ImageMagick v7.0.x
  • s3-uploader version
    • v0.x
    • v1.x
    • v2.x

Steps to reproduce

Tell us how to reproduce this issue. Please provide a minimal code example to demonstrate the problem.

// your code here

Expected behaviour

Tell us what should happen.

Actual behaviour

Tell us what happens instead.

// log outoput or error messages here
@Starefossen
Copy link
Contributor

Hi @isaacguerreir, could you fill out the rest of the template and I'll be happy to debug the problem with you 😊

@flxbe
Copy link

flxbe commented Nov 30, 2016

Hey guys,

I had the same issue after I initialized my AWS-credentials directly with the sdk and not explicitly passing them to the s3-uploader.

The problem here is that the s3-uploader always sets the aws-region when creating the S3-object. This is us-east-1 by default, which still supports the old aws-signature-version v2. However, newer regions do not support it anymore. You therefore always have to explicitly set your aws-region when initializing the Upload-object:

const client = new Upload("bucket", {
  aws: {
    region: "eu-central-1"
  },
  /**
  * ...
  **/
})

This solved the issue for me. Seems to me as if the aws-sdk still uses the endpoint you specified when updating your sdk-configuration although one can specify an alternative region when creating the S3-object. Anyway I hope this helps you as well.

@azkarmoulana
Copy link

azkarmoulana commented Apr 30, 2018

@isaacguerreir it's because you are using the old aws signature version v2. You can prevent this error by moving to new aws signature version v4.

when initializing your s3 client pass this signatureVersion: 'v4' as a parameter.

let s3bucket = new AWS.S3({ accessKeyId: IAM_USER_KEY, secretAccessKey: IAM_USER_SECRET, Bucket: BUCKET_NAME, signatureVersion: 'v4' },);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants