jegan
jegan

Reputation: 41

generating presigned url shows AuthorizationQueryParametersError

While creating the presigned url for my private image.png file in my s3 bucket, i used the below template

require 'aws-sdk-s3'

s3 = Aws::S3::Client.new(

region: 'us-east-1',

access_key_id: Access_key_id,

secret_access_key: Secret_access_key

)

signer = Aws::S3::Presigner.new(client: s3)

url = signer.presigned_url(

:get_object,

bucket: 'mybuck1',

key: "${image.png}-#{SecureRandom.uuid}"

)

while running the code, i get the follwing error as

AuthorizationQueryParametersError

Query-string authentication version 4 requires the X-Amz-Algorithm, X-Amz-Credential, X-Amz-Signature, X-Amz-Date, X-Amz-SignedHeaders, and X-Amz-Expires parameters.

so what might be the reason of this error, and how to fix this error

thanks in advance

Upvotes: 0

Views: 487

Answers (0)

Related Questions