SignatureDoesNotMatch error with Amazon S3 and php pre-signed urls

I am trying to get a pre-signed url for an object from S3 using php. I keep getting SignatureDoesNotMatch error. Below is my code.

$client = S3Client::factory(array(
            'key'    => getenv('S3_KEY'),
            'secret' => getenv('S3_SECRET'),
            'region' => 'us-east-1', // @todo does this matter?
        ));

$presignedUrl = $client->getObjectUrl(getenv('S3_BUCKET'), $id, '+5 minutes');

return $presignedUrl;

      

Then I get a properly formatted url, however, when I try to POST a photo with a url from a third party app, I get the following error: SignatureDoesNotMatch. Any ideas on what I am doing wrong here?

Thank!

+3


source to share





All Articles