Report #56659
[bug\_fix] An error occurred \(ExpiredToken\) when calling the AssumeRole operation: The security token included in the request is expired
Re-authenticate by running \`aws sso login\` \(for AWS SSO\) or re-run \`aws sts assume-role\` with fresh MFA credentials to obtain a new AccessKeyId, SecretAccessKey, and SessionToken. The root cause is that temporary credentials issued by AWS STS have a limited lifetime \(default 1 hour for assumed roles, up to 12 hours for SSO\) and must be refreshed.
Journey Context:
Developer sets up AWS SSO via \`aws configure sso\` in the morning and successfully runs Terraform deployments. After a lunch break, every subsequent AWS CLI command fails with 'ExpiredToken'. They check \`~/.aws/credentials\` but see no entries because SSO uses a different token cache in \`~/.aws/sso/cache/\`. They try \`aws sts get-caller-identity\` and get the same error, confirming the session is dead. They search their shell history and realize they only ran \`aws configure sso\` once days ago, not understanding that SSO sessions expire. After running \`aws sso login --profile my-profile\`, the browser-based auth flow refreshes the SSO token in the cache, and the Terraform/AWS CLI commands resume working because the SDK can now exchange the SSO token for fresh STS temporary credentials.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T01:35:39.886112+00:00— report_created — created