You need to sign in to do that
Don't have an account?

Amazon S3 SOAP signature creation
Hi,
Does anyone know how to generate the correct signature for Amazon S3's soap services ?
I'm going with their docs :
http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?SOAPAuthentication.html
and so far I've got :
I'm getting a SOAP exception back :
'SOAP Fault: The request signature we calculated does not match the signature you provided. Check your key and signing method.'
thanks,
David
Does anyone know how to generate the correct signature for Amazon S3's soap services ?
I'm going with their docs :
http://docs.amazonwebservices.com/AmazonS3/2006-03-01/index.html?SOAPAuthentication.html
and so far I've got :
Code:
S3.AmazonS3 as3 = new S3.AmazonS3(); Datetime now = Datetime.now(); //format should be like 2006-01-01T12:00:00.000Z String formattednow = now.formatGmt('yyyy-MM-dd')+'T'+now.formatGmt('HH:mm:ss')+'.000Z'; System.Debug('Formatted date : '+formattednow); String canonical = 'AmazonS3'+'ListAllMyBuckets'+formattednow; //"AmazonS3" + OPERATION + Timestamp System.debug('CANONICAL = '+canonical); Blob bsig = Crypto.generateMac('HmacSHA1', Blob.valueOf(canonical), Blob.valueOf('myS3secretkey')); String signature = EncodingUtil.base64Encode(bsig); System.debug('SIGNATURE = ' + signature); S3.ListAllMyBucketsResult result = as3.ListAllMyBuckets('myS3accesskey',now,signature);
'SOAP Fault: The request signature we calculated does not match the signature you provided. Check your key and signing method.'
thanks,
David
I'll answer my own question, it might be of use to someone out there :
I knew that the timestamp had to be within 15 minutes of amazon's server's clocks so I hadn't bothered with the milliseconds. What I had totally forgotten was that of course these milliseconds are also included in the String to be signed ...
duh !
Anyway, the working code is :
David
Message Edited by David VP on 09-29-2008 06:42 AM
Message Edited by David VP on 09-29-2008 06:42 AM
All Answers
I'll answer my own question, it might be of use to someone out there :
I knew that the timestamp had to be within 15 minutes of amazon's server's clocks so I hadn't bothered with the milliseconds. What I had totally forgotten was that of course these milliseconds are also included in the String to be signed ...
duh !
Anyway, the working code is :
David
Message Edited by David VP on 09-29-2008 06:42 AM
Message Edited by David VP on 09-29-2008 06:42 AM
1. Create Amazon S3 file for standard Salesforce attachment through
trigger.
2. Upload attachments on Amazon S3 and create reference in Salesforc to
access those attachments
3. Attach file related to any Salesforce object on Amazon.
4. Unlimited free storage.
5. Auto backup Event logs / inbound email attachments.
6. Server Side Encryption: AES-256
7. No file size limit for upload.
8. File access control capabiliy.
9. Track file downloads by users.
10. File exlorer capability.
https://appexchange.salesforce.com/listingDetail?listingId=a0N3000000CW1OXEA1
Here is our email address. Let us know if you have any query.
support@neiloncloud.com
Thanks.