Signing requests with AWS Signature
Sign requests to AWS services with Signature Version 4.
Overview
AWS services, and API Gateway endpoints that use IAM authorization, require each request to be signed with AWS Signature Version 4. Relay signs the request when it sends it, after it has built the body, so the signature covers exactly what goes out.
To use it, open the Auth tab of a request, folder, collection or workspace, click the auth type menu and choose AWS Signature.
Enter your credentials
The Credentials card holds your IAM credentials:
- Access Key ID: The access key, such as
AKIA…. - Secret Access Key: The key's secret.
- Session Token: For temporary credentials, such as those from AWS STS or IAM Identity Center. Relay sends it as
X-Amz-Security-Token. Leave it empty for long-term keys.
Use variables to keep each environment's credentials separate, such as {{awsAccessKeyId}} and {{awsSecretAccessKey}}.
Choose the region and service
In the Signing card, enter:
- Region: The region the request goes to, such as
us-east-1. - Service: The service's signing name, such as
s3,execute-api,stsores.
Relay needs an access key ID, secret access key, region and service to sign. If one is missing, the request isn't sent and the response inspector says which.
Sign with a header or a presigned URL
Sign With decides where the signature goes:
- Authorization Header: Relay adds
X-Amz-Dateand anAuthorizationheader, plusx-amz-content-sha256for S3. This is the usual choice. - Presigned URL: Relay adds the signature and its inputs to the URL's query, as AWS does for a presigned link. Enter how long it stays valid in Expires In (Seconds), from 1 to 604800. The default is 3600.
Relay sorts and encodes the query parameters the way AWS signs them, so the URL that's sent can differ from the one you typed in the order and encoding of its parameters. To see exactly what was sent, open the response inspector's Headers tab after sending.
If the request has its own Authorization header in the Headers tab, Relay doesn't add a header signature.
See Also
- Inheriting authentication: Set authentication once on a workspace, collection or folder and let requests inherit it.
- Managing environments: Switch between sets of variables for development, staging and production.
- Keeping secrets on your Mac: Keep tokens and passwords out of shared workspace files.