samedi 12 avril 2014

Amazon web services - SDK PHP de AWS SES demandes doivent provenir domaine vérifiée ? -Débordement de pile


Using the Amazon SDK to try and send emails out from our system.


Steps I've followed:


Created AWS account, verified a mydomainname.co.uk and also verified 2 email addresses. me@personal.co.uk and me@mydomainname.co.uk


I then setup SMTP credentials and am using the API key and secret key as my access credentials to create the client


    $sesClient = SesClient::factory(array(
'key' => 'AKIAIXXXXXXXXXXX5LGQ',
'secret' => 'AqNL4XXXXXXXXXXXCaBxDMWjzcY4zGbN8tR2S',
'region' => 'us-west-2',

));


var_dump($sesClient->getSendQuota());

As soon as I run anything which interacts with the API I get the following exception


The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

To clarify:



  • I've sent out test emails successfully on the AWS web interface

  • I've tried this with a number of different users

  • I did also try this with SMTP user/pass but got a response that my credentials were invalid

  • I've tried this with various library wrapper codes I've found dotted on the net, same error

  • I'm still in test mode, but this should be ok as I'm only trying to send from a validated email address to a validated email address - right?


The only thing I can think of: I've got a test environment setup on my local machine which is NOT on my verified domain, could it be that AWS wants me to send my request from the verified domain name in order to validate it?


edit


Just tried to run this code on my production box and I get the same error


Perhaps I need production mode?




The exception you are receiving means that your credentials (key and secret) are not correct. Try sending a request to another service (e.g. $s3Client->listBuckets()) to double check, then log into your account and get the right ones. If something still doesn't seem right, contact AWS support.



Using the Amazon SDK to try and send emails out from our system.


Steps I've followed:


Created AWS account, verified a mydomainname.co.uk and also verified 2 email addresses. me@personal.co.uk and me@mydomainname.co.uk


I then setup SMTP credentials and am using the API key and secret key as my access credentials to create the client


    $sesClient = SesClient::factory(array(
'key' => 'AKIAIXXXXXXXXXXX5LGQ',
'secret' => 'AqNL4XXXXXXXXXXXCaBxDMWjzcY4zGbN8tR2S',
'region' => 'us-west-2',

));


var_dump($sesClient->getSendQuota());

As soon as I run anything which interacts with the API I get the following exception


The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.

To clarify:



  • I've sent out test emails successfully on the AWS web interface

  • I've tried this with a number of different users

  • I did also try this with SMTP user/pass but got a response that my credentials were invalid

  • I've tried this with various library wrapper codes I've found dotted on the net, same error

  • I'm still in test mode, but this should be ok as I'm only trying to send from a validated email address to a validated email address - right?


The only thing I can think of: I've got a test environment setup on my local machine which is NOT on my verified domain, could it be that AWS wants me to send my request from the verified domain name in order to validate it?


edit


Just tried to run this code on my production box and I get the same error


Perhaps I need production mode?



The exception you are receiving means that your credentials (key and secret) are not correct. Try sending a request to another service (e.g. $s3Client->listBuckets()) to double check, then log into your account and get the right ones. If something still doesn't seem right, contact AWS support.


0 commentaires:

Enregistrer un commentaire