Using Temporary Security Credentials
AWS STS (API Version 2011-06-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

Using Temporary Security Credentials to Access AWS

As described in Creating Temporary Security Credentials, when you create temporary security credentials, the AWS Security Token Service (STS) returns temporary security credentials that consist of a token, an access key ID, and a secret access key. To give a user access to your resources, you distribute the temporary security credentials to the user you are granting temporary access to. You can distribute these credentials manually or programmatically. When the user makes calls to your resources, the user passes the token and access key ID, and signs the request with the secret access key. (The token works only with the access keys that it was generated with.)

How the user passes in the token depends on the API and version of the AWS product the user is making calls to. The following table describes the AWS products that currently support temporary security credentials, and provides links to information about how to make a call with temporary security credentials using each product API. If service-specific information is not available, general information about using temporary security credentials is provided in the following section, Using Temporary Security Credentials to Authenticate an AWS Request.

Note

The AWS services listed in the following table also support using temporary security credentials to access AWS through the AWS Management Console.

AWS productGetSessionTokenGetFederationTokenAssumeRoleMore Information

Amazon CloudFront

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon CloudSearch
Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon CloudWatch

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

AWS Data Pipeline
Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon DynamoDB

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon EC2

Check
Check
Check

Using Temporary Security Credentials in the Amazon Elastic Compute Cloud User Guide

Amazon Elastic Transcoder
Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon ElastiCache

Check
Check

 

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon Glacier
Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon Redshift
Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon RDS

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon Route 53

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon S3

Check
Check
Check

Making Requests Using IAM User Temporary Credentials or Making Requests Using Federated User Temporary Credentials in the Amazon Simple Storage Service Developer Guide

Amazon SES

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon SimpleDB

Check
Check
Check

Using Temporary Security Credentials in the Amazon SimpleDB Developer Guide

Amazon SNS

Check
Check
Check

Using Temporary Security Credentials in the Amazon Simple Notification Service Getting Started Guide

Amazon SQS

Check
Check
Check

Using Temporary Security Credentials in the Amazon Simple Queue Service Developer Guide

Amazon SWF

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Amazon VPC

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

AWS IAM

 

Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

*You can access IAM only when you use GetFederationToken to sign in to the AWS Management Console. For more information, see Giving Federated Users Direct Access to the AWS Management Console.

AWS OpsWorks
Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

AWS STS

 

 

Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

*Although you can access AWS STS by using AssumeRole, you can only call AssumeRole with those temporary security credentials.

AWS Storage Gateway

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Auto Scaling
Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Elastic Load Balancing

Check
Check
Check

Using Temporary Security Credentials to Authenticate an AWS Request, below

Using Temporary Security Credentials to Authenticate an AWS Request

The way you format a request for an AWS service varies depending on the service. For most services, you will need to do the following:

  • Replace your usual AWSAccessKeyId parameter with the user access key ID provided by IAM.

  • Include the IAM session token.

  • Sign the request with the user SecretKeyId provided by IAM.

If you send requests using expired credentials, AWS denies the request.

The following examples uses temporary security credentials to authenticate a ListUsers request to IAM. The request uses Signature Version 4 and includes authorization information in the headers.

Sample for services that use Signature Version 4 and add authorization information in the header

POST http://iam.amazonaws.com/ HTTP/1.1
Authorization: AWS4-HMAC-SHA256 Credential=Access Key ID provided by AWS Security Token Service/20110909/us-east-1/iam/aws4_request, SignedHeaders=host, Signature=Signature calculated using the SecretKeyId provided by AWS Security Token Service
host: iam.amazonaws.com
Content-type: application/x-www-form-urlencoded; charset=utf-8
X-Amz-Date: 20110909T233600Z
X-Amz-Security-Token: Security Token Value

Action=ListUsers&Version=2010-05-08


The following example shows an Amazon SimpleDB request that uses Signature Version 2 and includes authorization information in the query string.

Sample for services that use Signature Version 2 and add authorization information in the query string

https://sdb.amazonaws.com/
?Action=GetAttributes
&AWSAccessKeyId=Access Key ID provided by AWS Security Token Service 
&DomainName=MyDomain
&ItemName=MyItem
&SignatureVersion=2
&SignatureMethod=HmacSHA256
&Timestamp=2010-01-25T15%3A03%3A07-07%3A00
&Version=2009-04-15
&Signature=Signature calculated using the SecretKeyId provided by AWS Security Token Service
&SecurityToken=Security Token Value		


Note

AWS provides support for temporary security credentials and session tokens in the AWS SDKs so that you can implement temporary security credentials or session tokens with a specific programming language. Each SDK has its own instructions for implementing this feature. For a current list of AWS SDKs that support this feature, see Ways to Access the AWS Security Token Service.