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:// | + | https://docs.aws.amazon.com/cli/latest/reference/sts/get-session-token.html |
− | + | * <code>[[aws sts]] get-session-token --serial-number <mfa_device> --token-code <token></code> | |
− | |||
− | |||
− | |||
− | |||
− | * <code>[[aws sts]] get-session-token --serial-number < | ||
* <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> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Example == | == Example == | ||
Line 25: | Line 10: | ||
[[--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", |
− | " | + | "SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY", |
− | " | + | "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 37: | Line 22: | ||
== Errors == | == Errors == | ||
[[An error occurred (AccessDenied) when calling the GetSessionToken operation: MultiFactorAuthentication failed, unable to validate MFA code. Please verify your MFA serial number is valid and associated with this user.]] | [[An error occurred (AccessDenied) when calling the GetSessionToken operation: MultiFactorAuthentication failed, unable to validate MFA code. Please verify your MFA serial number is valid and associated with this user.]] | ||
− | Solution: | + | Solution: Make sure you are using a [[mfa]] [[ARN]], <code>arn:aws:iam::62405745487395:[[mfa]]/yourname</code> |
+ | |||
[[An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials]] | [[An error occurred (AuthFailure) when calling the DescribeInstances operation: AWS was not able to validate the provided access credentials]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Related terms == | == Related terms == | ||
Line 54: | Line 31: | ||
* <code>[[aws iam list-virtual-mfa-devices --output text]]</code> | * <code>[[aws iam list-virtual-mfa-devices --output text]]</code> | ||
* <code>[[AWS_SESSION_TOKEN]]</code> | * <code>[[AWS_SESSION_TOKEN]]</code> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | == See also == | + | ==See also== |
* {{aws sts}} | * {{aws sts}} | ||
* {{aws iam}} | * {{aws iam}} | ||
[[Category:AWS]] | [[Category:AWS]] |
Advertising: