Signature Version 4 signing process - AWS General Reference

Signature Version 4 signing process


The AWS SDKs, AWS Command Line Interface (AWS CLI), and other AWS tools sign API requests for you using the access key that you specify when you configure the tool. When you use these tools, you don’t need to learn how to sign API requests. The following documentation explains how to sign API requests, but is only useful if you’re writing your own code to send and sign AWS API requests. We recommend that you use the AWS SDKs or other AWS tools to send API requests, instead of writing your own code.

Signature Version 4 (SigV4) is the process to add authentication information to AWS API requests sent by HTTP. For security, most requests to AWS must be signed with an access key. The access key consists of an access key ID and secret access key, which are commonly referred to as your security credentials. For details on how to obtain credentials for your account, see Understanding and getting your AWS credentials.

How Signature Version 4 works

  1. Create a canonical request.

  2. Use the canonical request and additional metadata to create a string for signing.

  3. Derive a signing key from your AWS secret access key. Then use the signing key, and the string from the previous step, to create a signature.

  4. Add the resulting signature to the HTTP request in a header or as a query string parameter.

When an AWS service receives the request, it performs the same steps that you did to calculate the signature you sent in your request. AWS then compares its calculated signature to the one you sent with the request. If the signatures match, the request is processed. If the signatures don't match, the request is denied.

For more information, see the following resources: