InvalidAccessKeyId Error when attemping to upload object to S3 using temporary credentials issued by STS. #6081
Unanswered
morgan-dgk
asked this question in
Q&A
Replies: 2 comments
-
Okay, solved this finally. The order of form fields is important for presigned post requests. It appears the documentation for the SDK may be missing some mandatory fields. I got this working for the V4 signature with the form fields ordered as below:
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
Hoping somebody can assist me with this issue as I have been attempting to resolve for several days now.
I am attempting to upload an object directly to a private S3 bucket using a presigned url. This url is generated using the code below:
where
getScopedS3Client
is a simple helper function, which creates a client using the temporary credentials returned by STS:This approach works fine when generating presigned URLs to download objects from the relevant S3 bucket. However, when I attempt to send multipart/form-encoded data with the keys/fields returned from the createPresignedPost I get an InvalidAccessKeyId returned from the S3 endpoint.
I have verified that the credentials included in the presigned url matches the temporary credentials returned by STSAssumeRoleCommand. The IAM role used to generate the temporary credentials from STS has full access to S3 bucket/object operations.
I am also including the X-Amz-Security-Token field with the session token returned with the temporary credentials generated when attempting to post the form data.
Is this a limitation with the JS SDK or S3 endpoints? I believe I had a similar example previously working using boto3 but have so far been unable to resolve this issue.
Any help is much appreciated!
Beta Was this translation helpful? Give feedback.
All reactions