Request signature examples - Amazon Identity and Access Management
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

Request signature examples

The following examples of Amazon signing requests show you how you can use SigV4 to sign requests sent without the Amazon SDK or Amazon command line tool.

Browser based Amazon S3 upload using HTTP POST

Authenticating Requests: Browser-Based Uploads describes the signature and relevant information that Amazon S3 uses to calculate the signature upon receiving the request.

Example: Browser-Based Upload using HTTP POST (Using Amazon Signature Version 4) provides more information with a sample POST policy and a form that you can use to upload a file. The example policy and fictitious credentials show you the workflow and resulting signature and policy hash.

VPC Lattice authenticated requests

Examples for Signature Version 4 (SigV4) authenticated requests provides Python and Java examples showing how you can perform request signing with and without custom interceptors.

Using Signature Version 4 with Amazon Translate

Using Signature Version 4 with Amazon Translate shows how to use a Python program to add authentication information to Amazon Translate requests. The example makes a POST request, creates a JSON structure that contains the text to be translated in the body (payload) of the request, and passes authentication information in an Authorization header.

Using Signature Version 4 with Neptune

Example: Connecting to Neptune Using Python with Signature Version 4 Signing shows how to make signed requests to Neptune using Python. This example includes variations for using an access key or temporary credentials.

Signing HTTP requests to S3 Glacier

Example Signature Calculation for Streaming API walks you through the details of creating a signature for Upload Archive (POST archive), one of the two streaming APIs in S3 Glacier.

Making HTTP Requests to Amazon SWF

Making HTTP Requests to Amazon SWF shows the header contents for a JSON request to Amazon SWF.

Signing an Amazon OpenSearch Service search request with Amazon SDK for PHP Version 3 includes an example of how to send signed HTTP requests to Amazon OpenSearch Service.

Example projects in Amazon samples repository

The following example projects show how to sign requests to make Rest API requests to Amazon services with common languages such as Python, Node.js, Java, C#, Go and Rust.

Signature Version 4a projects

The sigv4-signing-examples project provides examples of how to sign requests with SigV4A to make Rest API requests to Amazon Web Services with common languages such as Python, Node.js, Java, C#, Go and Rust.

The sigv4a-signing-examples project provides examples for signing multi-Region API requests, for example Multi-Region Access Points in Amazon S3.

Publish to Amazon IoT Core

Python code to publish to Amazon IoT Core using HTTPs protocol provides guidance on how to publish messages to Amazon IoT Core using HTTPS protocol and Amazon SigV4 authentication. It has two reference implementations - one in Python and other in NodeJs.

.Net Framework application to publish to Amazon IoT Core using HTTPs protocol provides guidance on how to publish messages to Amazon IoT Core using HTTPS protocol and Amazon SigV4 authentication. This project also includes a .NET core equivalent implementation.