打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
HMAC-SHA1 Signatures

HMAC-SHA1 Signatures

When accessing Amazon SQS using Query, SOAP (without using WS-Security), or REST, you must provide the following items so the request can be authenticated:

  • AWSAccessKeyID—Your AWS account is identified by your Access Key ID, which AWS uses to look up your Secret Access Key.
  • Signature—Each request must contain a valid request signature, or the request is rejected. A request signature is calculated using your Secret Access Key, which is a shared secret known only to you and AWS.
  • Date—Each request must contain the time stamp of the request. Depending on the API you're using (Query, SOAP, or REST), you can provide an expiration date and time for the request instead of or in addition to the time stamp. See the authentication topic for the particular API for details of what is required and allowed for that API.

Below is the series of tasks required to authenticate requests to AWS. It is assumed you have already created an AWS account and received an Access Key ID and Secret Access Key.

You perform the first three tasks.


AWS performs the next three tasks.


Each AWS request you send must include an HMAC-SHA1 request signature calculated with your Secret Access Key (except for SOAP requests using WS-Security). The string you use to calculate the signature (the string to sign) varies depending on the API you're using (Query, SOAP, or REST). The details are covered in the following topics:

Tip

If you're using the Query API, you can use the Amazon SQS scratchpad to help you troubleshoot authentication issues. The scratchpad is a simple HTML and JavaScript application that allows you to explore the 2008-01-01 Amazon SQS API without writing any code. The tool constructs a Query request and shows the string to sign and the final signature (using signature version 1) that you would include in the request. To download the scratchpad, go tohttp://developer.amazonwebservices.com/connect/entry.jspa?externalID=1254&categoryID=30.

The time stamp (or expiration time) you use in the request must be a dateTime object (http://www.w3.org/TR/xmlschema-2/#dateTime). Although it is not required, we recommend you provide the time stamp in the Coordinated Universal Time (Greenwich Mean Time) time zone. For example: 2007-01-31T23:59:59.183Z.

If you specify a time stamp (instead of an expiration time), the request automatically expires 15 minutes after the time stamp (in other words, AWS does not process a request if the request time stamp is more than 15 minutes earlier than the current time on AWS servers). Make sure your server's time is set correctly.

Important

If you are using .NET you must not send overly specific time stamps, due to different interpretations of how extra time precision should be dropped. To avoid overly specific time stamps, manually construct dateTime objects with no more than millisecond precision.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
C# RSACryptoServiceProvider加密解密签名验签和DESCryptoServic
怎样创建安全的Rest WebService API 请求
银行卡四要素认证
腾讯云对象存储(COS)服务的 API
OAuth协议中的HMAC_SHA1算法
API Client Authentication
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服