Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent CloudFrontClient->getSignedUrl() Results #38

Closed
sadarby opened this issue Jan 31, 2013 · 6 comments
Closed

Inconsistent CloudFrontClient->getSignedUrl() Results #38

sadarby opened this issue Jan 31, 2013 · 6 comments

Comments

@sadarby
Copy link

sadarby commented Jan 31, 2013

Hello, I am receiving inconsistent results when I call the getSignedUrl method from a CloudFrontClient object, similar to the following code:

$this->aws = AWS::factory(array(
'key' => '...',
'secret' => '...',
'region' => Region::CONSTANT
));
$cf_client = $this->aws->get('cloudfront');
$result= $cf_client->getSignedUrl(array(
'url' => 'http://test.test.com/test.jpg',
'expires' => (time() + 600)
));

It seems that the resulting url has about a 50% chance of successfully accessing the query-string-protected S3 bucket. An 'Access Denied' page is returned by the cloudfront endpoint when the url is unsuccessful. Furthermore, I looked into the RFC 2045 code for base64 encoding, and I noticed that the resulting URL is Never successful when the SSL signature ends with '==', or '__' after being url-encoded. This has something to do with how the octets are represented, but I am not too clear on the specifics. Any solution to this issue would be greatly appreciated!

@mtdowling
Copy link
Member

Sorry to hear that you are having trouble with this. Thanks for trying to dig in with some details on the failure cases. I'll take a look at this and post back when I have more information.

@mtdowling
Copy link
Member

This issue is now fixed in master. It looks like there was an error the documentation on how a signed URL is created. I'll work with the documentation team to have this corrected.

@sadarby
Copy link
Author

sadarby commented Feb 1, 2013

Thank you so much! My signed url's are working 100% of the time. Your effort is greatly appreciated.

@davidtiede
Copy link

I'm having the same issue, and just downloaded the latest aws.phar file from http://aws.amazon.com/sdkforphp/. The SDK shows version 2.1.0 but the getSignedUrl() doesn't have this commit. Any ETA on when the aws.phar file will be updated?

@mtdowling
Copy link
Member

This has not yet been released. This will change will be present in the phar and PEAR package after the next release. We don't have a definitive timeframe for the next release, but it should be soon. In the meantime, you could grab the latest version of the SDK from master using Composer.

@davidtiede
Copy link

Okay, thanks. Guess this is a good time to learn about Composer then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants