AmazonSecurityTokenServiceClient.GetSessionToken Method (GetSessionTokenRequest)

.NET Framework 3.5
 
 
 
Did this page help you?  Yes  No   Tell us about it...

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 GetSessionToken if you want use MFA to protect programmatic calls to specific AWS APIs like Amazon EC2 StopInstances . MFA-enabled IAM users would need to call GetSessionToken and submit an MFA code that is associated with their MFA device. Using the temporary security credentials that are returned from the call, IAM users can then make programmatic calls to APIs that require MFA authentication.

The GetSessionToken action must be called by using the long-term AWS security credentials of the AWS account or an IAM user. Credentials that are created by IAM users are valid for the duration that you specify, between 900 seconds (15 minutes) and 129600 seconds (36 hours); credentials that are created by using account credentials have a maximum duration of 3600 seconds (1 hour).

The permissions that are granted to the federated user are the intersection of the policy that is passed with the GetSessionToken request and policies that are associated with of the entity making the GetSessionToken call.

For more information about using GetSessionToken to create temporary credentials, go to Creating Temporary Credentials to Enable Access for IAM Users in Using IAM .

Namespace: Amazon.SecurityToken
Assembly: AWSSDK.dll
Version: 2.0.0.3

Syntax

C#
public virtual GetSessionTokenResponse GetSessionToken(
         GetSessionTokenRequest getSessionTokenRequest
)

Parameters

getSessionTokenRequest
Type: Amazon.SecurityToken.Model.GetSessionTokenRequest

Container for the necessary parameters to execute the GetSessionToken service method on AmazonSecurityTokenService.

Return Value
Type: Amazon.SecurityToken.Model.GetSessionTokenResponse
The response from the GetSessionToken service method, as returned by AmazonSecurityTokenService.

Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5