user3024827
user3024827

Reputation: 1258

AWS API Gateway as Serivce proxy for S3 upload

I have been reading about creating an API which can be used to upload objects directly to S3. I have followed the guides from Amazon with little success.

I am currently getting the following error:

{"message":"Missing Authentication Token"}

My API call configuration:

enter image description here

The role ARN assigned is not in the image, but has been set up and assigned.

Upvotes: 3

Views: 2389

Answers (1)

Lorenzo d
Lorenzo d

Reputation: 2066

The "Missing Authentication Token" error can be interpreted as either

  1. Enabling AWS_IAM authentication for your method and making a request to it without signing it with SigV4, or
  2. Hitting a non-existent path in your API.

For 1, if you use the generated SDK the signing is done for you.

For 2, if you're making raw http requests make sure you're making requests to /<stage>/s3/{key}

BTW, the path override for s3 puts needs to be {bucket}/{key}, not just {key}. You may need to create a two-level hierarchy with bucket as the parent, or just hardcode the bucket name in the path override if it will always be the same. See: http://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-s3.html

Upvotes: 5

Related Questions