I am trying to retrieve session token on the AWS CLI like:
aws sts get-session-token --serial-number arn-string --token-code mfacode
* arn-string is copied from the IAM management console, security credentials for the assigned MFA device,format like "arn:aws:iam:<number>:mfa/<name>"
* "mfacode" is taken from the registered virtual MFA device
An error occurred (InvalidClientTokenId) when calling the GetSessionToken operation: The security token included in the request is invalid.
However, I use that MFA device to log in to the console in the browser, I have only a default profile in my ~/.aws/, but I don't see how this would have any influence.