Skip to content

api.aws.sts.getSessionToken@v1

tristanls edited this page Nov 25, 2012 · 1 revision

Get session token.

Since Version 1.0.0
Scope
accepts: public

Parameters

All parameters are optional, unless otherwise indicated.

awsAccessKeyId AKIAIOSFODNN7EXAMPLE required AWS Access Key Id
secretAccessKey wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY required AWS Secret Access Key
durationSeconds 3600 The duration, in seconds, that the credentials should remain valid
serialNumber arn:aws:iam::123456789012:mfa/user The identification number of the MFA device for the user
tokenCode 586910 The value provided by the MFA device

Response fields

Response

credentials {awsAccessKeyId:"...",secretAccessKey:"...",sessionToken:"..."} Temporary AWS credentials

Error

message Error message Error message

Example

Request

crosstalk.emit( 
  '~crosstalk.api.aws.sts.getSessionToken@v1', 
  {
    awsAccessKeyId : 'ACFFIOSFODNN7EXAMPLE',
    secretAccessKey : "kpRSrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY"
  }, 
  '~crosstalk', 
  function ( error, response ) { /* ... */ } 
);

Response:

{
  "credentials":{
    "accessKeyId":"AKIAIOSFODNN7EXAMPLE",
    "secretAccessKey":"wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY",
    "sessionToken":"AQoDYXdzEMT//////////wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEYbkSwJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEYHwJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEYrsORiFIg89JlREcTV6XpMnwJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEYz5ZLNFkfvvG2HFpNYYuAnPDGAzJ5aada4+VW/qd03WMJSjieBR2MnnbkVBcu9a7dbiSThwJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEYUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEwJalrXUtnFEMwJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY"
  }
}

Error:

{
  "message": "Error message"
}
Clone this wiki locally