The AWS Security Token Service is a web service that enables you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that you authenticate (federated users). This guide provides descriptions of the AWS Security Token Service API.
For more detailed information about using this service, go to Using Temporary Security Credentials.
For information about setting up signatures and authorization through the API, go to Signing AWS API Requests in the AWS General Reference . For general information about the Query API, go to Making Query Requests in Using IAM . For information about using security tokens with other AWS products, go to Using Temporary Security Credentials to Access AWS in Using Temporary Security Credentials .
If you're new to AWS and need additional technical information about a specific AWS product, you can find the product's technical documentation at http://aws.amazon.com/documentation/.
We will refer to Amazon Identity and Access Management using the abbreviated form IAM. All copyrights and legal protections still apply.
Inheritance Hierarchy
Amazon.Runtime.AbstractWebServiceClient
Amazon.Runtime.AmazonWebServiceClient
Amazon.SecurityToken.AmazonSecurityTokenServiceClient
Namespace: Amazon.SecurityToken
Assembly: AWSSDK.dll
Version: 2.0.0.3
Syntax
public class AmazonSecurityTokenServiceClient : AmazonWebServiceClient IAmazonSecurityTokenService, IDisposable
The AmazonSecurityTokenServiceClient type exposes the following members
Constructors
Name | Description | |
---|---|---|
![]() |
AmazonSecurityTokenServiceClient() |
Constructs AmazonSecurityTokenServiceClient with the credentials loaded from the application's
default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
Example App.config with credentials set.
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="AWSAccessKey" value="********************"/> <add key="AWSSecretKey" value="****************************************"/> </appSettings> </configuration> |
![]() |
AmazonSecurityTokenServiceClient(RegionEndpoint) |
Constructs AmazonSecurityTokenServiceClient with the credentials loaded from the application's
default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
Example App.config with credentials set.
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="AWSAccessKey" value="********************"/> <add key="AWSSecretKey" value="****************************************"/> </appSettings> </configuration> |
![]() |
AmazonSecurityTokenServiceClient(AmazonSecurityTokenServiceConfig) |
Constructs AmazonSecurityTokenServiceClient with the credentials loaded from the application's
default configuration, and if unsuccessful from the Instance Profile service on an EC2 instance.
Example App.config with credentials set.
<?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key="AWSAccessKey" value="********************"/> <add key="AWSSecretKey" value="****************************************"/> </appSettings> </configuration> |
![]() |
AmazonSecurityTokenServiceClient(AWSCredentials) | Constructs AmazonSecurityTokenServiceClient with AWS Credentials |
![]() |
AmazonSecurityTokenServiceClient(AWSCredentials, RegionEndpoint) | Constructs AmazonSecurityTokenServiceClient with AWS Credentials |
![]() |
AmazonSecurityTokenServiceClient(AWSCredentials, AmazonSecurityTokenServiceConfig) | Constructs AmazonSecurityTokenServiceClient with AWS Credentials and an AmazonSecurityTokenServiceClient Configuration object. |
![]() |
AmazonSecurityTokenServiceClient(string, string) | Constructs AmazonSecurityTokenServiceClient with AWS Access Key ID and AWS Secret Key |
![]() |
AmazonSecurityTokenServiceClient(string, string, RegionEndpoint) | Constructs AmazonSecurityTokenServiceClient with AWS Access Key ID and AWS Secret Key |
![]() |
AmazonSecurityTokenServiceClient(string, string, AmazonSecurityTokenServiceConfig) | Constructs AmazonSecurityTokenServiceClient with AWS Access Key ID, AWS Secret Key and an AmazonSecurityTokenServiceClient Configuration object. If the config object's UseSecureStringForAwsSecretKey is false, the AWS Secret Key is stored as a clear-text string. Please use this option only if the application environment doesn't allow the use of SecureStrings. |
![]() |
AmazonSecurityTokenServiceClient(string, string, string) | Constructs AmazonSecurityTokenServiceClient with AWS Access Key ID and AWS Secret Key |
![]() |
AmazonSecurityTokenServiceClient(string, string, string, RegionEndpoint) | Constructs AmazonSecurityTokenServiceClient with AWS Access Key ID and AWS Secret Key |
![]() |
AmazonSecurityTokenServiceClient(string, string, string, AmazonSecurityTokenServiceConfig) | Constructs AmazonSecurityTokenServiceClient with AWS Access Key ID, AWS Secret Key and an AmazonSecurityTokenServiceClient Configuration object. If the config object's UseSecureStringForAwsSecretKey is false, the AWS Secret Key is stored as a clear-text string. Please use this option only if the application environment doesn't allow the use of SecureStrings. |
Methods
Name | Description | |
---|---|---|
![]() |
AssumeRole(AssumeRoleRequest) |
Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you
can use to access AWS resources that you might not normally have access to. Typically, you use For cross-account access, imagine that you own multiple accounts and need to access resources in each account. You could create long-term credentials in each account to access those resources. However, managing all those credentials and remembering which one can access which account can be time consuming. Instead, you can create one set of long-term credentials in one account and then use temporary security credentials to access all the other accounts by assuming roles in those accounts. For more information about roles, see Roles in Using IAM . For federation, you can, for example, grant single sign-on access to the AWS Management Console. If you already have an
identity and authentication system in your corporate network, you don't have to recreate user identities in AWS in order to grant those user
identities access to AWS. Instead, after a user has been authenticated, you call The temporary security credentials are valid for the duration that you specified when calling The temporary security credentials that are
returned from the To assume a role, your AWS account must be trusted by the role. The trust
relationship is defined in the role's trust policy when the IAM role is created. You must also have a policy that allows you to call
Important: You cannot call |
![]() |
AssumeRoleAsync(AssumeRoleRequest, CancellationToken) |
Initiates the asynchronous execution of the AssumeRole operation.
|
![]() |
AssumeRoleWithWebIdentity(AssumeRoleWithWebIdentityRequest) |
Returns a set of temporary security credentials for users who have been authenticated in a mobile or web application with a web
identity provider, such as Login with Amazon, Facebook, or Google. The temporary security credentials consist of an access key ID, a secret access key, and a security token. Applications can
use these temporary security credentials to sign calls to AWS service APIs. The credentials are valid for the duration that you specified
when calling The temporary security credentials that are returned from the
Before your application can call
|
![]() |
AssumeRoleWithWebIdentityAsync(AssumeRoleWithWebIdentityRequest, CancellationToken) |
Initiates the asynchronous execution of the AssumeRoleWithWebIdentity operation.
|
![]() |
Dispose() | Disposes of all managed and unmanaged resources. |
![]() |
GetFederationToken(GetFederationTokenRequest) |
Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a
federated user. A typical use is in a proxy application that is getting temporary security credentials on behalf of distributed applications
inside a corporate network. Because you must call the
Note: Do not use this call in mobile applications or client-based web applications that directly get temporary security
credentials. For those types of applications, use The The permissions that are granted to the federated user are the intersection of the policy that is passed with the
For more information about how permissions work, see Controlling Permissions in Temporary Credentials in Using Temporary Security
Credentials . For information about using |
![]() |
GetFederationTokenAsync(GetFederationTokenRequest, CancellationToken) |
Initiates the asynchronous execution of the GetFederationToken operation.
|
![]() |
GetSessionToken(GetSessionTokenRequest) |
Returns a set of temporary credentials for an AWS account or IAM user. The credentials consist of an access key ID, a secret access
key, and a security token. Typically, you use The The permissions that are granted to the federated user are the intersection
of the policy that is passed with the For more information about using |
![]() |
GetSessionToken() |
Returns a set of temporary credentials for an AWS account or IAM user. The credentials consist of an access key ID, a secret access
key, and a security token. Typically, you use The The permissions that are granted to the federated user are the intersection
of the policy that is passed with the For more information about using |
![]() |
GetSessionTokenAsync(GetSessionTokenRequest, CancellationToken) |
Initiates the asynchronous execution of the GetSessionToken operation.
|
Version Information
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8
.NET for Windows Phone:
Supported in: Window Phone 8