Report #68180
[bug\_fix] The security token included in the request is expired
Re-run \`aws sts get-session-token\` \(or \`assume-role\`\) with the MFA device serial number and current TOTP code to generate new temporary credentials, then export the new AWS\_ACCESS\_KEY\_ID, AWS\_SECRET\_ACCESS\_KEY, and AWS\_SESSION\_TOKEN. For long-running applications, implement a credential provider that auto-refreshes by calling sts:AssumeRole periodically before the expiration timestamp.
Journey Context:
Developer has been using temporary credentials exported from \`aws sts get-session-token --serial-number arn:aws:iam::123456789012:mfa/user --token-code 123456\` for local testing. After 12 hours, all AWS CLI commands and SDK calls start failing with 'ExpiredToken'. They check the IAM policy simulator, which shows the action should be allowed. They verify the system clock is synchronized with NTP. They notice that \`aws sts get-caller-identity\` works when they unset the session token, proving the long-term access key is valid. They check the expiration field in the original sts:get-session-token JSON output and realize it was set to 12 hours ago. The AWS SDK does not auto-refresh credentials obtained via get-session-token \(unlike assume-role with a duration and refresh logic\), so manual regeneration is required.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:55:27.386253+00:00— report_created — created