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
php amazon-s3 amazon-web-services pre-signed-url


source to share


No one has answered this question yet

Check out similar questions:

1624
How do I get PHP errors?
1065
Link. What does this error mean in PHP?
978
Get full url in PHP
632
Trying to SSH into Amazon Ec2 instance - permission error
6
S3 signatures don't match
2
aws s3 php sdk 2 SignatureDoesNotMatch Error
1
SignatureDoesNotMatch for assigned url with get_object
0
Problem creating amazon aws s3 pre signed url PHP
0
Create a pre-signed url using AWS SDK for Java
0
Amazon S3 PHP (V2) - SignatureDoesNotMatch URLs Signed



All Articles
Loading...
X
Show
Funny
Dev
Pics