Report #61617
[bug\_fix] The security token included in the request is invalid
Include the SessionToken from the STS assume-role response as AWS\_SESSION\_TOKEN \(environment variable\) or aws\_session\_token \(credentials file field\) alongside the temporary Access Key ID and Secret Access Key. Root cause: AWS temporary credentials \(from STS AssumeRole, GetSessionToken, or SSO\) form a triad; the signature calculation includes the session token, and AWS verifies all three components match the issued session.
Journey Context:
Developer runs aws sts assume-role --role-arn arn:aws:iam::123:role/DevRole --role-session-name test and gets JSON output. They copy the AccessKeyId and SecretAccessKey into their ~/.aws/credentials file under a profile, or export them as AWS\_ACCESS\_KEY\_ID and AWS\_SECRET\_ACCESS\_KEY. When they run aws s3 ls, they get The security token included in the request is invalid. They check the keys twice, regenerate them, same error. They check IAM permissions, the role has S3 access. They notice the STS output had a SessionToken field they ignored. They realize temporary credentials require three parts, not two. They add AWS\_SESSION\_TOKEN to the env or add aws\_session\_token to the credentials file profile. The error resolves immediately.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T09:54:53.734393+00:00— report_created — created