Status Code 403: SignatureDoesNotMatch when I am using Amazon SES

假装没事ソ 提交于 2020-06-24 11:22:41

问题


I created a new Amazon account. Created SMTP Credentials and used AWS Java SDK to send emails. But it is failing with following error:

Status Code: 403, AWS Service: AmazonSimpleEmailService, AWS Request ID: xyz, AWS Error Code: SignatureDoesNotMatch, AWS Error Message: 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.


回答1:


The keys to be provided to send Emails are not "SMTP Credentials" . The keys are instead Global access key which can be retrieved http://docs.amazonwebservices.com/ses/latest/GettingStartedGuide/GetAccessIDs.html.




回答2:


SMTP Credentials are not valid for use with SES API (AWS Java SDK). SMTP credential are in fact different to the ones manually created for IAM users, even that this different is not visible anywhere on AWS Console. Take a look here to see differences: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/using-credentials.html

You don't actually need to create Global Access credentials (which could be a security leak), but you should create a new IAM user with the following security policy, and create new credentials for that user.

{
"Version": "2012-10-17",
"Statement":[{
   "Effect":"Allow",
   "Action":["ses:SendEmail", "ses:SendRawEmail"],
   "Resource":"*"
   }
]
}

PS: Probably, you could just add new credentials to the SMTP IAM user already created for SES, but I haven't yet tested this.



来源:https://stackoverflow.com/questions/14296999/status-code-403-signaturedoesnotmatch-when-i-am-using-amazon-ses

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!