0

I am unable to access the file, that I am trying to access through pre-signed URL.

    $cmd = $s3Client->getCommand('GetObject', [
            'Bucket' => 'test-bucket-pcloud',
            'Key'    => 'testfile.txt'
    ]);

    $request = $s3Client->createPresignedRequest($cmd, '+20 minutes');

    // Get the actual presigned-url
    $presignedUrl = (string) $request->getUri();

When the URL is accessed on browser I get:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
    <Error>
    <Code>AuthorizationQueryParametersError</Code>
    <Message>X-Amz-Algorithm only supports "AWS4-HMAC-SHA256"</Message>
    <RequestId>8D109D39C69E665D</RequestId>
    <HostId>
    lH+u+MEnbF+Sps0kd/tMEGS0ePHjQlUDGWN8lLnzkXYkrIb0YksK6ahzUflPFMbQG8zUzLFl9y4=
    </HostId>
    </Error>

What could be the reason for it? Also, when I try to access the bucket from the URL obtained as:

$signedURL = $s3Client->getObjectUrl('test-bucket-pcloud','testfile.txt');

I still get the same error.

Here is the permission snapshot for the bucket:

enter image description here

Suhail Gupta
  • 22,386
  • 64
  • 200
  • 328
  • Looks like your client doesn't support the necessary encryption algorithms. – Gerald Schneider Jan 20 '16 at 12:41
  • @GeraldSchneider Sorry but what does that mean? – Suhail Gupta Jan 20 '16 at 12:42
  • I have no experience with AWS, so this is just a guess. But the server is complainging that your client doesn't support `AWS4-HMAC-SHA256`, which is an amazon variation of a common part in encryption algorithms. Either your client doesn't support it (maybe it is outdated), or it is configured wrong. – Gerald Schneider Jan 20 '16 at 12:49

1 Answers1

0

Did you check you CORS Configuration?

https://aws.amazon.com/blogs/aws/amazon-s3-cross-origin-resource-sharing/

In a common CORS Configuration, you can allow origin, method and header. I'll start by adding a CORS Configuration.