Editing Aws sts get-session-token

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
 
{{lowercase}}
 
{{lowercase}}
https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sts/get-session-token.html
+
https://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html
 
 
[[aws sts]] get-session-token --profile "$1"  [[--serial-number]] "$2" [[--token-code]] $MFA_CODE
 
 
 
* Duration: 12 hours (43,200 seconds) as the default. Valid range: 15 minutes to 36 hours (129,600 seconds).
 
  
 
== Examples ==
 
== Examples ==
 
* <code>[[aws sts]] get-session-token --serial-number <[[mfa_device]]> [[--token-code]] <token></code>
 
* <code>[[aws sts]] get-session-token --serial-number <[[mfa_device]]> [[--token-code]] <token></code>
 
* <code>[[aws sts]] get-session-token --serial-number [[arn]]:aws:iam::62405745487395:mfa/yourname --token-code 123456</code>
 
* <code>[[aws sts]] get-session-token --serial-number [[arn]]:aws:iam::62405745487395:mfa/yourname --token-code 123456</code>
* <code>[[aws sts]] get-session-token --serial-number [[arn]]:aws:iam::62405745487395:mfa/yourname --duration-seconds 129600 --token-code 123456  </code>
 
* <code>[[aws sts]] get-session-token --serial-number [[arn]]:aws:iam::62405745487395:mfa/yourname --duration-seconds 129600 --token-code 123456  --output text</code>
 
  
 
== Synopsys ==
 
== Synopsys ==
Line 25: Line 19:
 
     [[--serial-number]] "[[arn]]:aws:iam::62405745487395:[[mfa]]/yourname" \
 
     [[--serial-number]] "[[arn]]:aws:iam::62405745487395:[[mfa]]/yourname" \
 
     --token-code 123456
 
     --token-code 123456
+
 
 
  {
 
  {
 
     "Credentials": {
 
     "Credentials": {
         "[[AccessKeyId]]": "AKIAIOSFODNN7EXAMPLE",
+
         "AccessKeyId": "AKIAIOSFODNN7EXAMPLE",
         "[[SecretAccessKey]]": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
+
         "SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
         "[[SessionToken]]":  "AQoEXAMPLEH4aoAH0gNCAPyJxz4BlCFFxWNE1OPTgk5TthT+FvwqnKwRcOIfrRh3c/LTo6UDdyJwOOvEVPvLXCrrrUtdnniCEXAMPLE/IvU1dYUg2RVAJBanLiHb4IgRmpRV3zrkuWJOgQs8IZZaIv2BXIa2R4OlgkBN9bkUDNCJiBeb/AXlzBBko7b15fjrBs2+cTQtpZ3CYWFXG8C5zqx37wnOE49mRl/+OtkIKGO7fAE",
+
         "SessionToken":  "AQoEXAMPLEH4aoAH0gNCAPyJxz4BlCFFxWNE1OPTgk5TthT+FvwqnKwRcOIfrRh3c/LTo6UDdyJwOOvEVPvLXCrrrUtdnniCEXAMPLE/IvU1dYUg2RVAJBanLiHb4IgRmpRV3zrkuWJOgQs8IZZaIv2BXIa2R4OlgkBN9bkUDNCJiBeb/AXlzBBko7b15fjrBs2+cTQtpZ3CYWFXG8C5zqx37wnOE49mRl/+OtkIKGO7fAE",
 
         "Expiration": "2020-05-19T18:06:10+00:00"
 
         "Expiration": "2020-05-19T18:06:10+00:00"
 
     }
 
     }
Line 43: Line 37:
  
 
  [[An error occurred (AccessDenied) when calling the GetSessionToken operation: MultiFactorAuthentication failed, must provide both MFA serial number and one time pass code.]]
 
  [[An error occurred (AccessDenied) when calling the GetSessionToken operation: MultiFactorAuthentication failed, must provide both MFA serial number and one time pass code.]]
 
An error occurred ([[ExpiredToken]]) when calling the XXX operation: The provided token has expired.
 
 
An error occurred ([[InvalidClientTokenId]]) when calling the GetSessionToken operation: [[The security token included in the request is invalid]]
 
 
An error occurred ([[ExpiredToken]]) when calling the GetSessionToken operation: [[The security token included in the request is expired]]
 
  
 
== Related terms ==
 
== Related terms ==
Line 55: Line 43:
 
* <code>[[AWS_SESSION_TOKEN]]</code>
 
* <code>[[AWS_SESSION_TOKEN]]</code>
 
* <code>[[AWS_DEFAULT_REGION]]</code>
 
* <code>[[AWS_DEFAULT_REGION]]</code>
* <code>[[aws-sts-get-session-token]]</code> script
 
* [[Terraform AWS provider]]: <code>[[assume_role]]</code>
 
* <code>[[aws sts get-federation-token]]</code>
 
* [[1password]]
 
* [[EKS]]: <code>[[aws eks get-token]]</code>
 
* <code>[[aws sts get-access-key-info]]</code>
 
 
== Activities ==
 
* Read https://aws.amazon.com/premiumsupport/knowledge-center/authenticate-mfa-cli/
 
* [[Using temporary credentials with AWS resources]]
 
  
== See also ==
+
==See also==
 
* {{aws sts}}
 
* {{aws sts}}
 
* {{aws iam}}
 
* {{aws iam}}
  
 
[[Category:AWS]]
 
[[Category:AWS]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: